-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml.cs
More file actions
47 lines (41 loc) · 1.65 KB
/
Copy pathMainWindow.xaml.cs
File metadata and controls
47 lines (41 loc) · 1.65 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
using Microsoft.UI.Xaml;
using Microsoft.UI.Windowing;
namespace AutoSales
{
public sealed partial class MainWindow : Window
{
public MainWindow()
{
this.InitializeComponent();
// Extend our content all the way to the top so the blue header IS the title bar.
// The system still draws min/max/close on top of our content; LeftInset/RightInset
// tell us how much space to reserve so our buttons don't sit under the system ones.
this.ExtendsContentIntoTitleBar = true;
this.SetTitleBar(AppTitleBar);
var appWindow = this.AppWindow;
if (appWindow != null)
{
appWindow.TitleBar.IconShowOptions = IconShowOptions.HideIconAndSystemMenu;
// AppWindow.Changed fires for size, position, presentation, and the
// LeftInset/RightInset reserved by the system caption-button area.
appWindow.Changed += (sender, args) => UpdateTitleBarInsets();
UpdateTitleBarInsets();
}
}
private void UpdateTitleBarInsets()
{
var tb = this.AppWindow?.TitleBar;
if (tb == null) return;
/*LeftPaddingColumn.Width = new GridLength(tb.LeftInset);
RightPaddingColumn.Width = new GridLength(tb.RightInset);*/
}
private void OnMapNavClicked(object sender, RoutedEventArgs e)
{
// Map view is the default; placeholder for navigation.
}
private void OnInfoClicked(object sender, RoutedEventArgs e)
{
// About dialog placeholder.
}
}
}