1

I have the following XAML:

<Page
    x:Class="Proto.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Proto"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" RenderTransformOrigin="0.5,0.5">
    <Grid>
        <NavigationView IsBackButtonVisible="Collapsed" CompactModeThresholdWidth="9999" ExpandedModeThresholdWidth="9999" CompactPaneLength="96">
            <NavigationView.MenuItems>
                <NavigationViewItem Name="1Item" Content="1" Tag="1Page" FontSize="22" HorizontalAlignment="Center" FontWeight="Bold" Foreground="MediumPurple"/>
                <NavigationViewItem Name="2Item" Content="2" Tag="2Page" FontSize="22" HorizontalAlignment="Center" FontWeight="Bold" Foreground="MediumPurple"/>
                <NavigationViewItem Name="3Item" Content="3" Tag="3Page" FontSize="22" HorizontalAlignment="Center" FontWeight="Bold" Foreground="MediumPurple"/>
                <NavigationViewItem Name="4Item" Content="4" Tag="4Page" FontSize="22" HorizontalAlignment="Center" FontWeight="Bold" Foreground="MediumPurple"/>
                <NavigationViewItem Name="5Item" Content="5" Tag="5Page" FontSize="22" HorizontalAlignment="Center" FontWeight="Bold" Foreground="MediumPurple"/>
            </NavigationView.MenuItems>
        </NavigationView>
    </Grid>
</Page>

The C# is as follows:

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409

namespace Proto
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
        }
    }
}

Its currently just numbers in the Navigation menu that im just experimenting with as i get used to UWP. Im targeting the latest build of Windows which seems to incorperate some nice extra features into UWP.

Im wondering if its possible to add extra options, like more options above settings and Icons at the top etc to the Navigation view. An example would be like the image below:

The Current Layout

Thanks for the advice

Batteredburrito
  • 579
  • 1
  • 5
  • 34
  • 1
    Possible duplicate of [NavigationView and additional settings button](https://stackoverflow.com/questions/48885189/navigationview-and-additional-settings-button) – TheTanic Aug 13 '18 at 09:51
  • This thread doesnt apply to any newer build of windows since February. I was wondering if anything has changed that may allow this to be possible. It also only references the option selection above Settings. Not the extra possibility of icons nested within navigationview – Batteredburrito Aug 13 '18 at 09:54

1 Answers1

1

I would recommend you to use latest NavigationView control released in preview release of WinUI library, it has backward compatability to Anniversary update also it has lot more flexibility in left pane like putting extra content, header, footer or even grouped items with headers and so on.

https://learn.microsoft.com/en-us/uwp/toolkits/winui/

you can try and see the sample code in dev branch of the Windows controls samples. ( link is available in the docs provided above ) Hope that helps!

Muhammad Touseef
  • 4,357
  • 4
  • 31
  • 75