Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public Shell(VkPostponeSaveLoader saveLoader)
 {
     _saveLoader = saveLoader;
     InitializeComponent();
     _viewModel = (ShellViewModel)DataContext;
 }