-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml.cs
37 lines (31 loc) · 1.11 KB
/
MainWindow.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
using DevExpress.XtraReports.UI;
using System.Windows;
using System.Windows.Input;
using DevExpress.Mvvm;
namespace T461248 {
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
Loaded += MainWindow_Loaded;
}
void MainWindow_Loaded(object sender, RoutedEventArgs e) {
var viewModel = new MainWindowViewModel(new SampleReport());
DataContext = viewModel;
designer.RegisterHotKey(Key.OemTilde, ModifierKeys.Control, () => viewModel.TestCommand, null);
}
}
public class MainWindowViewModel : ViewModelBase {
public XtraReport Report { get; private set; }
public ICommand TestCommand { get; private set; }
public MainWindowViewModel(XtraReport report) {
Report = report;
TestCommand = new DelegateCommand(RunTestCommand);
}
void RunTestCommand() {
GetService<IMessageBoxService>().ShowMessage("Test command.");
}
}
}