-
Notifications
You must be signed in to change notification settings - Fork 313
Expand file tree
/
Copy pathMainWindow.xaml.cs
More file actions
47 lines (43 loc) · 1.49 KB
/
MainWindow.xaml.cs
File metadata and controls
47 lines (43 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using WindowsAISample.ViewModels;
using WindowsAISample.Pages;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace WindowsAISample;
/// <summary>
/// An empty window that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
rootFrame.DataContext = new CopilotRootViewModel();
rootFrame.Navigate(typeof(LanguageModelPage));
}
private void NavView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
{
if (args.SelectedItemContainer != null)
{
switch (args.SelectedItemContainer.Tag)
{
case "LanguageModel":
rootFrame.Navigate(typeof(LanguageModelPage));
break;
case "ImageScaler":
rootFrame.Navigate(typeof(ImageScalerPage));
break;
case "ImageObjectExtractor":
rootFrame.Navigate(typeof(ImageObjectExtractorPage));
break;
case "ImageDescription":
rootFrame.Navigate(typeof (ImageDescriptionPage));
break;
case "TextRecognizer":
rootFrame.Navigate(typeof(TextRecognizerPage));
break;
}
}
}
}