/// <summary> /// Initializes a new instance of the <see cref="MonitorToolWindow"/> class. /// </summary> public MonitorToolWindow() : base(null) { this.Caption = "NetRx.Store Monitor"; _monitorToolViewModel = new MonitorToolViewModel(); ThreadHelper.ThrowIfNotOnUIThread(); _debuggerEvents = MonitorToolWindowCommand.Instance.Ide.Events.DebuggerEvents; _debuggerEvents.OnEnterDesignMode += OnExitDebuggerMode; _debugPaneListener = new DebugPaneListener( MonitorToolWindowCommand.Instance.Ide.Events.OutputWindowEvents, new OutputPaneParser()) { HandleUpdate = message => _monitorToolViewModel.AddStateRecord(message) }; this.Content = new MonitorToolWindowControl(_monitorToolViewModel); }
public MonitorToolWindowControl(MonitorToolViewModel viewModel) { this.InitializeComponent(); this.DataContext = viewModel; Observable.FromEventPattern <TextChangedEventHandler, TextChangedEventArgs>( h => FilterTextBox.TextChanged += h, h => FilterTextBox.TextChanged -= h) .Throttle(TimeSpan.FromMilliseconds(700)) #pragma warning disable VSTHRD101 // Avoid unsupported async delegates .Subscribe(async arg => { if (viewModel.SelectedStoreHistory != null && arg.Sender is TextBox textBox) { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); viewModel.SelectedStoreHistory.ActionFilter = textBox.Text.ToLower(); viewModel.SelectedStoreHistory.ApplyFilterCommand?.Execute(null); } }); #pragma warning restore VSTHRD101 // Avoid unsupported async delegates }