public MainWindowViewModel() { instance = this; if (!InstanceCollectionView.View.IsEmpty) SelectedIndex = 0; _updateTimer = new DispatcherTimer { IsEnabled = true, Interval = TimeSpan.FromSeconds(App.Settings.UpdateInterval) }; _updateTimer.Tick += (obj, args) => { DoRefreshList(); }; }
public MainWindow() { instance = this; _model = new MainWindowViewModel(); DataContext = _model; InitializeComponent(); // Provent losing focus when invoked using hotkey Loaded += (s, e) => Activate(); // Return focus for mouse clicks etc. //new DispatcherTimer { IsEnabled = true, Interval = TimeSpan.FromMilliseconds(200) } // .Tick += (obj, args) => { if (!textBox.IsFocused) textBox.Focus(); }; }