Пример #1
0
 public BrowserTabSelectorViewModel(string defaultUrl, ILogger logger, Dispatcher dispatcher)
 {
     _closeTabCommandFactory = new CloseTabCommandFactory(this);
     _defaultUrl             = defaultUrl;
     _logger     = logger;
     _dispatcher = dispatcher;
     Tabs        = new ObservableCollection <BrowserTabViewModel>();
     SelectedTab = NewTab();
     _emptyTab   = NewTab();
 }
 public BrowserTabViewModel(string startingAddress, ILogger logger, CloseTabCommandFactory closeTabCommandFactory, Dispatcher dispatcher)
 {
     Id          = Guid.NewGuid();
     _logger     = logger;
     _dispatcher = dispatcher;
     _embeddedDb = new EmbeddableDocumentStore()
     {
         DataDirectory = "data" + Id
     }.Initialize();
     TabHeaderViewModel      = new TabHeaderViewModel(closeTabCommandFactory.Create(this), Id);
     NavigationItemViewModel = new NavigationElementViewModel(dispatcher);
     AddressBarViewModel     = new AddressBarViewModel(startingAddress, _logger);
     _logger.Info("open page tab " + Id + " with address: " + startingAddress, LogEventTypes.Common);
 }