Example #1
0
 public TimerView()
 {
     InitializeComponent();
     this.MaximizeToSecondaryMonitor();
     ViewModel.Context = this;
     _viewModel        = base.DataContext as TimerViewModel;
 }
Example #2
0
        public TimerView(TimerViewModel vm = null)
        {
            InitializeComponent();
            SizeChanged += TimerAspectRatioLimits;

            if (vm != null)
            {
                DataContext = vm;
            }
            _vm = (TimerViewModel)DataContext;

            Loaded += (_, _) => {
                _window = Window.GetWindow(this) as TimerWindow; // This ensures the timer is a floating window
                if (_window != null)
                {
                    InitializeFloatingWindow();
                }
                TimerAspectRatioLimits();
            };
        }