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);
        }
Ejemplo n.º 2
0
 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());
 }
Ejemplo n.º 3
0
 public CloseTabCommand(BrowserTabSelectorViewModel tabSelector, BrowserTabViewModel currentPage)
 {
     _tabSelector = tabSelector;
     _currentPage = currentPage;
     _tabSelector.Tabs.CollectionChanged += TabsOnCollectionChanged;
 }