示例#1
0
        public MainConfigView()
        {
            InitializeComponent();
            Loaded += (_, _) => {
                RegionManagerA.RegisterViewWithRMAware <NavigationMenuView>(RegionNames.MENU_REGION);
                RegionManagerA.RequestNavigate(RegionNames.SHELL_CONFIG_REGION, nameof(GeneralConfigView));

                // Window Setup
                _window = GetWindow(this);
                Debug.Assert(_window != null, nameof(_window) + " != null");
                _window.Background = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
                WindowChrome windowChrome = new() {
                    ResizeBorderThickness = new Thickness(9),
                    CaptionHeight         = 0
                };
                WindowChrome.SetWindowChrome(_window, windowChrome);

                (double dpiWidthFactor, double dpiHeightFactor) = WindowHelpers.GetDpiFactors(_window);
                _window.CenterOnScreen(dpiWidthFactor, dpiHeightFactor);
            };

            MouseDown += (_, e) => {
                if (e.ChangedButton == MouseButton.Left)
                {
                    DependencyObject scope = FocusManager.GetFocusScope(Root);
                    FocusManager.SetFocusedElement(scope, _window);
                    _window.DragMove();
                }
            };
        }
示例#2
0
 public TimersListItemView(TimersListItemViewModel vm)
 {
     InitializeComponent();
     ViewModel   = vm;
     DataContext = ViewModel;
     Loaded     += (_, _) => {
         RegionManagerA.AddToRegionRMAware(TIMER_IN_LIST_REGION, new TimerView(new TimerViewModel(ViewModel.Timer)));
     };
 }
示例#3
0
 public NavigationMenuViewModel()
 {
     GenConfigButton = new DelegateCommand(() => {
         RegionManagerA.RequestNavigate(SHELL_CONFIG_REGION, nameof(GeneralConfigView));
         Selected = SelectedButton.GenConfig;
     });
     TimersButton = new DelegateCommand(() => {
         RegionManagerA.RequestNavigate(SHELL_CONFIG_REGION, nameof(TimersListView));
         Selected = SelectedButton.Timers;
     });
 }