markus / MarkusAutoUpdate / src / NetSparkle.UI.Avalonia / MessageNotificationWindow.xaml.cs @ d8f5045e
이력 | 보기 | 이력해설 | 다운로드 (1.08 KB)
1 |
using Avalonia; |
---|---|
2 |
using Avalonia.Controls; |
3 |
using Avalonia.Markup.Xaml; |
4 |
using Avalonia.Media.Imaging; |
5 |
using NetSparkleUpdater.UI.Avalonia.ViewModels; |
6 |
|
7 |
namespace NetSparkleUpdater.UI.Avalonia |
8 |
{ |
9 |
public class MessageNotificationWindow : Window |
10 |
{ |
11 |
public MessageNotificationWindow() |
12 |
{ |
13 |
this.InitializeComponent(); |
14 |
#if DEBUG |
15 |
this.AttachDevTools(); |
16 |
#endif |
17 |
DataContext = new MessageNotificationWindowViewModel(); |
18 |
} |
19 |
|
20 |
public MessageNotificationWindow(MessageNotificationWindowViewModel viewModel, IBitmap iconBitmap) |
21 |
{ |
22 |
this.InitializeComponent(); |
23 |
#if DEBUG |
24 |
this.AttachDevTools(); |
25 |
#endif |
26 |
DataContext = viewModel; |
27 |
/*var imageControl = this.FindControl<Image>("AppIcon"); |
28 |
if (imageControl != null) |
29 |
{ |
30 |
imageControl.Source = iconBitmap; |
31 |
}*/ |
32 |
} |
33 |
|
34 |
private void InitializeComponent() |
35 |
{ |
36 |
AvaloniaXamlLoader.Load(this); |
37 |
} |
38 |
|
39 |
public void CloseMessage() |
40 |
{ |
41 |
Close(); |
42 |
} |
43 |
} |
44 |
} |