-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HomeControlViewModel.cs
31 lines (25 loc) · 1.01 KB
/
HomeControlViewModel.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
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Leosac.WpfApp;
using MaterialDesignThemes.Wpf;
namespace WpfAppDemo.Domain
{
public class HomeControlViewModel : ObservableValidator
{
private readonly ISnackbarMessageQueue _snackbarMessageQueue;
public HomeControlViewModel(ISnackbarMessageQueue snackbarMessageQueue)
{
_snackbarMessageQueue = snackbarMessageQueue;
SnackbarInfoCommand = new RelayCommand(() =>
{
SnackbarHelper.EnqueueMessage(_snackbarMessageQueue, "Simple information message.");
});
SnackbarErrorCommand = new RelayCommand(() =>
{
SnackbarHelper.EnqueueError(_snackbarMessageQueue, "An error message. This message is usually longer than other messages as some details may be included.");
});
}
public RelayCommand SnackbarInfoCommand { get; }
public RelayCommand SnackbarErrorCommand { get; }
}
}