예제 #1
0
        private void MenuListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (MenuGrid.Width > 180)
            {
                var closeMenu = (Storyboard)OpenCloseMenuButton.FindResource("CloseMenu");
                closeMenu.Begin();
                OpenCloseMenuButton.IsChecked = false;
                _mainViewModel.IsDialogOpen   = false;
            }

            if (!_firstChange)
            {
                switch (MenuListView.SelectedIndex)
                {
                case 0:
                    _mainViewModel.WindowManager.UpdateWindowCommand.Execute(ViewType.Rozhodci);
                    break;

                case 1:
                    _mainViewModel.WindowManager.UpdateWindowCommand.Execute(ViewType.Ceta);
                    break;

                case 2:
                    _mainViewModel.WindowManager.UpdateWindowCommand.Execute(ViewType.Settings);
                    break;
                }
            }
            else
            {
                _firstChange = !_firstChange;
            }
        }
예제 #2
0
 private void MenuGrid_MouseLeave(object sender, MouseEventArgs e)
 {
     if (MenuGrid.Width > 180)
     {
         var closeMenu = (Storyboard)OpenCloseMenuButton.FindResource("CloseMenu");
         closeMenu.Begin();
         OpenCloseMenuButton.IsChecked = false;
         _mainViewModel.IsDialogOpen   = false;
     }
 }
예제 #3
0
 private void OpenCloseMenuButton_Click(object sender, RoutedEventArgs e)
 {
     if (OpenCloseMenuButton.IsChecked != null && OpenCloseMenuButton.IsChecked.Value)
     {
         var openMenu = (Storyboard)OpenCloseMenuButton.FindResource("OpenMenu");
         openMenu.Begin();
         _mainViewModel.IsDialogOpen = true;
     }
     else
     {
         var closeMenu = (Storyboard)OpenCloseMenuButton.FindResource("CloseMenu");
         closeMenu.Begin();
         _mainViewModel.IsDialogOpen = false;
     }
 }