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;
using demo_NavBar.Pages;
// The Blank Page item template is
documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
namespace demo_NavBar
{
/// <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();
}
private void NavView_SelectionChanged(NavigationView
sender, NavigationViewSelectionChangedEventArgs args)
{
}
private void NavView_ItemInvoked(NavigationView
sender, NavigationViewItemInvokedEventArgs args)
{
if (args.IsSettingsInvoked)
{
ContentFrame.Navigate(typeof(PageSettings));
}
else
{
switch (args.InvokedItem)
{
case "Home":
ContentFrame.Navigate(typeof(PageHome
));
break;
case "Page1":
ContentFrame.Navigate(typeof(Page1));
break;
case "Page2":
ContentFrame.Navigate(typeof(Page2));
break;
case "Page3":
ContentFrame.Navigate(typeof(Page3));
break;
case "Nav Min/Max":
if (NavView.IsPaneOpen)
{
NavView.IsPaneOpen = false;
}
else
{
NavView.IsPaneOpen = true;
}
break;
case "Content on/off":
if(ContentFrame.Visibility ==
Visibility.Collapsed)
{
ContentFrame.Visibility = Visibility.Visible ; }
else
{
ContentFrame.Visibility = Visibility.Collapsed; }
break;
case "Nav0":
//ContentFrame.Navigate(typeof(DBNull
));*error
//UnloadObject(ContentFrame);
//no
//ContentFrame.Content=null;
//*Error
//ContentFrame.ClearValue();
ContentFrame.Navigate(typeof(PageEmpty));
break;
}
}
}
}
}
|