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; /// /// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { private bool isReady = false; private INavigationService navSvc; /// /// main Window constructor /// 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(); } } }