コード例 #1
0
        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(); };
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: poma/SshConnect
        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(); };
        }