public SettingsViewModel(VkPostponeSaveLoader saveLoader, Settings settings) { _saveLoader = saveLoader; _settings = settings; OkCommand = new DelegateCommand <Window>(okCommandexecute); RevertSettingsCommand = new DelegateCommand(revert); CurrentSettings = new Settings(); PingProxyCommand = new DelegateCommand(pingProxy, () => CurrentSettings.Proxy.UseProxy && UrlHelper.IsUrlIsValid(CurrentSettings.Proxy.ProxyAddress)); PingHistoryServerCommand = new DelegateCommand(pingHistoryServerCommandExecute, () => CurrentSettings.History.Use && UrlHelper.IsUrlIsValid(CurrentSettings.History.Url)); revert(); }
public ShellViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, VkPostponeSaveLoader saveLoader, Settings settings) { _regionManager = regionManager; _eventAggregator = eventAggregator; _saveLoader = saveLoader; _settings = settings; _eventAggregator.GetEvent <VkAuthorizationEvents.AcquiredTheToken>().Subscribe((accessToken) => { _regionManager.RequestNavigate(RegionNames.MainRegion, ViewNames.AvailableWalls); }); _eventAggregator.GetEvent <WallSelectorEvents.WallSelected>().Subscribe(onWallItemClicked); _eventAggregator.GetEvent <MainBottomEvents.Back>().Subscribe(onBackRequested); _eventAggregator.GetEvent <MainBottomEvents.Settings>().Subscribe(onSettingsRequested); _eventAggregator.GetEvent <AuthBarEvents.AuthorizationCompleted>().Subscribe(onAthorizationCompleted); _eventAggregator.GetEvent <AuthBarEvents.LogOutCompleted>().Subscribe(onLogOutCompleted); }
public Shell(VkPostponeSaveLoader saveLoader) { _saveLoader = saveLoader; InitializeComponent(); _viewModel = (ShellViewModel)DataContext; }