NavigationPane Image size

Navigation for WPF Forum

Posted 11 years ago by Krijn Michiels
Avatar
Hi

When I create a simple Wpf Window with a NavigationBar/NavigationPane the navigationpane stretches the small ImageSource.

Example :


<Window x:Class="Window2"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:navigation="http://schemas.actiprosoftware.com/winfx/xaml/navigation">
    
    <navigation:NavigationBar>
        <navigation:NavigationPane x:Name="mailPane" 
                                   Title="Mail" 
                                   ImageSourceSmall="/Resources/Small/Picture16.png" >
            <StackPanel>
                <TextBlock Text="Variant size:" />
                <TextBlock Text="{Binding ElementName=mailPane, Path=VariantSize}"
                           FontWeight="SemiBold" />
             </StackPanel>
        </navigation:NavigationPane>
    </navigation:NavigationBar>
 </Window>

The current variantSize is 'Large'. This explains the image sizing behavior, but where does this VariantSize come from ? How can I change this ? Does it come from the current Theme ?

Thanks

Comments (1)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi,

You don't want to change variant size. That is just indicating the variant currently in use by the pane's button. Each pane requires both a 32x32 image in ImageSourceLarge and a 16x16 image in ImageSourceSmall if you want things to look right.

If you only want to use the small image, then you could create a blank 32x32 image, paste your small image in the middle of it and use the resulting image as your "large" image and your original image as the "small" image.

But things will look better if you have a truly "large" variant of your image that is closer to 32x32.


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.