File tree 4 files changed +28
-0
lines changed
4 files changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using Microsoft . UI ;
3
+ using Microsoft . UI . Windowing ;
4
+ using Microsoft . UI . Xaml ;
5
+ using Microsoft . UI . Xaml . Controls . Primitives ;
6
+ using WinRT . Interop ;
7
+
8
+ namespace Coder . Desktop . App . Utils
9
+ {
10
+ public static class TitleBarIcon
11
+ {
12
+ public static void SetTitlebarIcon ( Window window )
13
+ {
14
+ var hwnd = WindowNative . GetWindowHandle ( window ) ;
15
+ var windowId = Win32Interop . GetWindowIdFromWindow ( hwnd ) ;
16
+ AppWindow . GetFromWindowId ( windowId ) . SetIcon ( "coder.ico" ) ;
17
+ }
18
+ }
19
+ }
Original file line number Diff line number Diff line change 8
8
using Microsoft . UI . Xaml . Media ;
9
9
using WinRT . Interop ;
10
10
using WinUIEx ;
11
+ using Coder . Desktop . App . Utils ;
11
12
12
13
namespace Coder . Desktop . App . Views ;
13
14
@@ -16,6 +17,8 @@ public sealed partial class DirectoryPickerWindow : WindowEx
16
17
public DirectoryPickerWindow ( DirectoryPickerViewModel viewModel )
17
18
{
18
19
InitializeComponent ( ) ;
20
+ TitleBarIcon . SetTitlebarIcon ( this ) ;
21
+
19
22
SystemBackdrop = new DesktopAcrylicBackdrop ( ) ;
20
23
21
24
viewModel . Initialize ( this , DispatcherQueue ) ;
Original file line number Diff line number Diff line change 2
2
using Coder . Desktop . App . Views . Pages ;
3
3
using Microsoft . UI . Xaml . Media ;
4
4
using WinUIEx ;
5
+ using Coder . Desktop . App . Utils ;
5
6
6
7
namespace Coder . Desktop . App . Views ;
7
8
@@ -13,11 +14,14 @@ public FileSyncListWindow(FileSyncListViewModel viewModel)
13
14
{
14
15
ViewModel = viewModel ;
15
16
InitializeComponent ( ) ;
17
+ TitleBarIcon . SetTitlebarIcon ( this ) ;
18
+
16
19
SystemBackdrop = new DesktopAcrylicBackdrop ( ) ;
17
20
18
21
ViewModel . Initialize ( this , DispatcherQueue ) ;
19
22
RootFrame . Content = new FileSyncListMainPage ( ViewModel ) ;
20
23
21
24
this . CenterOnScreen ( ) ;
22
25
}
26
+
23
27
}
Original file line number Diff line number Diff line change 6
6
using Microsoft . UI . Windowing ;
7
7
using Microsoft . UI . Xaml ;
8
8
using Microsoft . UI . Xaml . Media ;
9
+ using Coder . Desktop . App . Utils ;
9
10
10
11
namespace Coder . Desktop . App . Views ;
11
12
@@ -22,6 +23,7 @@ public sealed partial class SignInWindow : Window
22
23
public SignInWindow ( SignInViewModel viewModel )
23
24
{
24
25
InitializeComponent ( ) ;
26
+ TitleBarIcon . SetTitlebarIcon ( this ) ;
25
27
SystemBackdrop = new DesktopAcrylicBackdrop ( ) ;
26
28
RootFrame . SizeChanged += RootFrame_SizeChanged ;
27
29
You can’t perform that action at this time.
0 commit comments