-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMainPage.xaml.cs
48 lines (45 loc) · 1.73 KB
/
MainPage.xaml.cs
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
48
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel.Core;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.ViewManagement;
using Windows.UI;
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 Transhef.SubPages;
using Windows.UI.WindowManagement;
using Windows.UI.Xaml.Hosting;
namespace Transhef
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
Window.Current.SetTitleBar(TTB);
CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;
titleBar.ButtonBackgroundColor = Colors.Transparent;
titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
MainNavView.SelectedItem = Home;
}
private void Home_Loaded(object sender, RoutedEventArgs e)
{
MainFrame.Focus(FocusState.Programmatic); // remove ugly focus rectangle on startup (moving it directly to the language selector), while keeping all elements focusable
}
private void MainNavView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
{
if (args.SelectedItem == Home) { MainFrame.Navigate(typeof(TranslatePage)); }
else if (args.SelectedItem == History) { MainFrame.Navigate(typeof(HistoryPage)); }
}
}
}