Exemplo n.º 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));
 }
Exemplo n.º 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"};
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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();
        }
Exemplo n.º 5
0
 private void CreateRelayCommands(ViewManager viewManager)
 {
     _viewManager = viewManager;
     ShowHelpWindowCommand = new RelayCommand(() => _viewManager.Show(View.Help));
 }
Exemplo n.º 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);
 }
Exemplo n.º 7
0
 public MenuWindowViewModel(ViewManager viewManager)
 {
     CreateRelayCommands(viewManager);
 }
Exemplo n.º 8
0
 private void CreateRelayCommands(ViewManager viewManager)
 {
     _viewManager = viewManager;
     ShowInfoAboutCountryCommand = new RelayCommand<string>(ShowInfoAboutCountry);
 }
Exemplo n.º 9
0
 public MainWindowViewModel(ViewManager viewManager)
 {
     CreateRelayCommands(viewManager);
     ColorNumber = ShapeNumber = AddNumber = 0;
     ShowPleaseWaitInfo = false;
 }
Exemplo n.º 10
0
        private void CreateRelayCommands(ViewManager viewManager)
        {
            _viewManager = viewManager;

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