I Have a navigation view like this:
<NavigationView
MenuItemsSource="{Binding HamMneuItems}"
IsPaneOpen="False"
Margin="0,0,0,0"
Grid.Row="0"
Grid.RowSpan="2"
CompositeMode="SourceOver"
x:Name="nvSample"
IsSettingsVisible="True"
IsTabStop="False"
Header="{Binding Titulo,UpdateSourceTrigger=PropertyChanged,Mode=OneWay}" SelectionChanged="NvSample_SelectionChanged">
<Frame x:Name="ScenarioFrame"
Margin="5,0,5,5"
Grid.Column="0"
Grid.Row="0"
Grid.RowSpan="2"
d:IsHidden="True"/>
</NavigationView>
The property IsPaneOpen is set to false, but it always show the pane opened, y tried setting IsPaneOpen to false at code behind in Page_Loaded event, at navigation view Loaded event with no results.
Now my question is how can I do to show NavigationView in compact mode first time it's showed ?.
or
Where to set IsPaneOpen to Hide pane at code behind ?
In xaml setup a 'Loaded' event
<NavigationView
Loaded="nvSample_Loaded"
In code behind nvSample_Loaded Event:
private void nvSample_Loaded(object sender, RoutedEventArgs e)
{
nvSample.IsPaneOpen = false;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With