none
[UWP] navigationview - username-property in NavigationView.PaneFooter RRS feed

  • Question

  • Hello!

    In the article https://docs.microsoft.com/en-us/windows/uwp/design/controls-and-patterns/navigationview

    paragraph "Pane Footer", you see in the Screenshot the item "User Name". But I can't figure out how to recreate it.

    Thank you for your help!


    Tuesday, August 21, 2018 8:41 PM

All replies

  • Hello,

    If you don't konw how to customize a new item. Simply you can add a PaneFooter like the following:

     <NavigationView.PaneFooter>
                    <NavigationViewItem>
                        <NavigationViewItem.Icon>
                            <SymbolIcon Symbol="Contact"/>
                        </NavigationViewItem.Icon>
                        <NavigationViewItem.Content>
                            <ContentPresenter Content="User"/>
                        </NavigationViewItem.Content>
                    </NavigationViewItem>
                </NavigationView.PaneFooter>

    But that would put an item above the setting item. 

    If you need exactly the same like the doc you shows, you need to right click your  navigationview from xaml, then create a copy of the template. Then add the following:

    1. Find PaneContentGrid and add a line:

     <Grid x:Name="PaneContentGrid">
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="0"/>
                                                <RowDefinition x:Name="PaneContentGridToggleButtonRow" Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="8"/>
                                                <RowDefinition Height="*"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="8"/>
                                            </Grid.RowDefinitions>

    2. At the end of NavigationPane, add the following:

     <NavigationViewItem x:Name="test" Grid.Row="8">
                                                <NavigationViewItem.Icon>
                                                    <SymbolIcon Symbol="Contact"/>
                                                </NavigationViewItem.Icon>
                                                <NavigationViewItem.Content>
                                                    <ContentPresenter Content="User"/>
                                                </NavigationViewItem.Content>
                                            </NavigationViewItem>
                                        </Grid>

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, August 22, 2018 7:21 AM
    Moderator
  • hi,

    Have you tried like what I mentioned?

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, August 30, 2018 5:52 AM
    Moderator