Search code examples
xamluinavigationcontrollerxamarin.uwp

how can i default navigationviwe display mode in uwp?


I try to change it and I use navigation view display mode tag but it doesn't work?

<NavigationView
        Canvas.ZIndex="0"
        x:Name="NavigationViewControl"
        Grid.Column="1"
        AlwaysShowHeader="True"
        Header=" "
        HeaderTemplate="{StaticResource NavigationViewHeaderTemplate}"
        IsTabStop="False"
        ItemInvoked="OnNavigationViewItemInvoked"
        DispalyMode="Minimal">

Solution

  • The NavigationView has three display mode options: Minimal, Compact and Expanded. By default, the system automatically selects the optimal display mode based on the amount of screen space available to the control. But you can override this setting by using configuring its OpenPaneLength, CompactModeThresholdWidth and ExpandedModeThresholdWidth properties.

    For example, if you want the NavigationView to be Minimal mode, you can try to set the properties:

    <NavigationView CompactModeThresholdWidth="1920" ExpandedModeThresholdWidth="1920">
    

    More details, you can look into the NavigationView display modes and Overriding the default adaptive behavior topic.