12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- namespace GDNXFD.Alert.Config.Views
- {
- using GDNXFD.Alert.Config.ViewModel;
- using System;
- using System.ComponentModel;
- using System.Windows;
- using System.Windows.Input;
- using GDNXFD.Alert.Config.Services.Navigation;
- using Data;
- /// <summary>
- /// Interaction logic for MainWindow.xaml
- /// </summary>
- public partial class MainWindow : Window
- {
- private bool isReady = false;
- private INavigationService navSvc;
- /// <summary>
- /// main Window constructor
- /// </summary>
- public MainWindow()
- {
- var vm = ViewModelLocator.Instance.Main;// (MainViewModel)this.DataContext;
- this.DataContext = vm;
- InitializeComponent();
- vm.InitializeData();
- navSvc = ViewModelLocator.Instance.NavService;
- isReady = true;
- }
- private void Window_Closing(object sender, CancelEventArgs e)
- {
- //if (!String.IsNullOrWhiteSpace(SecurityService.AccessToken))
- //{
- // e.Cancel = true;
- // var task = SecurityService.Logout();
- //}
- }
- private void MainWindow_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
- if (e.ClickCount == 2)
- {
- if (this.WindowState == System.Windows.WindowState.Maximized)
- this.WindowState = System.Windows.WindowState.Normal;
- else
- this.WindowState = System.Windows.WindowState.Maximized;
- }
- this.DragMove();
- }
- private void MinimizeButton(object sender, RoutedEventArgs e)
- {
- this.WindowState = WindowState.Minimized;
- }
- private void MaximizeButton(object sender, RoutedEventArgs e)
- {
- if (WindowState == WindowState.Normal)
- {
- this.WindowState = System.Windows.WindowState.Maximized;
- }
- else
- {
- this.WindowState = System.Windows.WindowState.Normal;
- }
- }
- private void CloseButton(object sender, RoutedEventArgs e)
- {
- this.Close();
- }
- private void rbtnCustom_Checked(object sender, RoutedEventArgs e)
- {
- if (isReady == false)
- return;
- navSvc.NavigateToRuleList();
- }
- private void rbtnDI_Checked(object sender, RoutedEventArgs e)
- {
- navSvc.NavigateToDIList();
- }
- }
- }
|