public MainViewModel(string defaultUrl, Dispatcher dispatcher) { _dispatcher = dispatcher; var logger = new Logger(dispatcher); BrowserTabSelectorViewModel = new BrowserTabSelectorViewModel(defaultUrl, logger, dispatcher); ObservationViewModel = new ToolsViewModel(logger, BrowserTabSelectorViewModel); OpenToolsCommand = new DelegateCommand(OpenToolsExecute); CloseApplicationCommand = new DelegateCommand(CloseApplicationExecute); }
public ToolsViewModel(ILogger logger, BrowserTabSelectorViewModel tabSelectorViewModel) { _tabSelectorViewModel = tabSelectorViewModel; Logger = logger; TakeScreenshotCommand = new DelegateCommand(TakeScreenshotExecute); LogTypes = new ReadOnlyCollection <string>( new string[3] { LogEventTypes.Focus, LogEventTypes.MouseOver, LogEventTypes.Mutation }); ToggleTypeCommand = new DelegateCommand((o) => Logger.ToggleType(o.ToString())); ShowDevToolsCommand = new DelegateCommand(() => tabSelectorViewModel.SelectedTab.Browser.ShowDevTools()); }
public CloseTabCommand(BrowserTabSelectorViewModel tabSelector, BrowserTabViewModel currentPage) { _tabSelector = tabSelector; _currentPage = currentPage; _tabSelector.Tabs.CollectionChanged += TabsOnCollectionChanged; }