예제 #1
0
 private void CreateRelayCommands(ViewManager viewManager)
 {
     _viewManager = viewManager;
     ShowMainWindowCommand = new RelayCommand(() => _viewManager.Show(View.Main));
     ShowCountriesListWindowCommand = new RelayCommand(() => _viewManager.Show(View.CountriesList));
     ShowHelpWindowCommand = new RelayCommand(() => _viewManager.Show(View.Help));
     ShowHistoryWindowCommand = new RelayCommand(() => _viewManager.Show(View.History));
 }
예제 #2
0
        public CountryDetailsWindowViewModel(ViewManager viewManager, ICountrySelector countrySelector)
        {
            CreateRelayCommands(viewManager);

            _countrySelector = countrySelector;

            Messenger.Default.Register<CountryToShowDetailsMessage>(this, SelectCountry);

            // For Expression Blend only
            if (IsInDesignModeStatic)
            {
                SelectedCountry = new Country {Tag = "no", Name = "Norway", Continent = "Europe", Capital = "Oslo"};
            }
        }
예제 #3
0
        public ResultsWindowViewModel(ViewManager viewManager, ICountrySelector countrySelector)
        {
            CreateRelayCommands(viewManager);

            _countrySelector = countrySelector;

            Countries = new ObservableCollection<Country>();
            Messenger.Default.Register<SearchParamsMessage>(this, ParseMessageFromMainWindow);

            // For Expression Blend only
            if (IsInDesignModeStatic)
            {
                _countrySelector.GetCountriesByParams(Countries, 123, 345, 567);
            }
        }
예제 #4
0
        public CountriesListWindowViewModel(ViewManager viewManager, ICountrySelector countrySelector)
        {
            CreateRelayCommands(viewManager);

            _countrySelector = countrySelector;

            Countries = new ObservableCollection<Country>();
            _countrySelector.GetAllCountries(Countries);

            SelectedCountry = null;
            #if !WINDOWS_PHONE
            if (Countries.Count > 0)
                SelectedCountry = Countries[0];
            #endif

            CreateGroups();
        }
예제 #5
0
 private void CreateRelayCommands(ViewManager viewManager)
 {
     _viewManager = viewManager;
     ShowHelpWindowCommand = new RelayCommand(() => _viewManager.Show(View.Help));
 }
예제 #6
0
 private void CreateRelayCommands(ViewManager viewManager)
 {
     _viewManager = viewManager;
     ShowCountryDetailsWindowCommand = new RelayCommand(ShowCountryDetails);
     ShowHelpWindowCommand = new RelayCommand(() => _viewManager.Show(View.Help));
     SelectionChanged = new RelayCommand<object>(ChangeSelection);
 }
예제 #7
0
 public MenuWindowViewModel(ViewManager viewManager)
 {
     CreateRelayCommands(viewManager);
 }
예제 #8
0
 private void CreateRelayCommands(ViewManager viewManager)
 {
     _viewManager = viewManager;
     ShowInfoAboutCountryCommand = new RelayCommand<string>(ShowInfoAboutCountry);
 }
예제 #9
0
 public MainWindowViewModel(ViewManager viewManager)
 {
     CreateRelayCommands(viewManager);
     ColorNumber = ShapeNumber = AddNumber = 0;
     ShowPleaseWaitInfo = false;
 }
예제 #10
0
        private void CreateRelayCommands(ViewManager viewManager)
        {
            _viewManager = viewManager;

            ModifyColorNumberCommand = new RelayCommand<string>(ModifyColorNumber);
            ModifyShapeNumberCommand = new RelayCommand<string>(ModifyShapeNumber);
            ModifyAddNumberCommand = new RelayCommand<string>(ModifyAddNumber);
        }