Exemple #1
0
        public RestorationUpdateViewModel(IRestorationsManager restorationManager)
        {
            _restorationManager = restorationManager;

            _customNavigationService = ServiceLocator.Current.GetInstance <ICustomNavigationService>("RepairInternal");

            _restoration = _customNavigationService.CurrentPageParams as RestorationModel;

            SaveChangesCommand = new RelayCommand(async() => await UpdateRestoration());

            ActionText = "Редактирование";
            ButtonText = "Сохранить изменения";

            InitData();
            SetupFields();
        }
        public FriendsListViewModel(
            IProfilesManager profilesManager,
            IFriendsManager friendsManager,
            IPreferencesService preferencesService)
        {
            _profilesManager         = profilesManager;
            _friendsManager          = friendsManager;
            _preferencesService      = preferencesService;
            _customNavigationService = ServiceLocator.Current.GetInstance <ICustomNavigationService>("PeopleInternal");

            _currentUser = preferencesService.User;

            RemoveFriendCommand = new RelayCommand <string>(RemoveFriend);

            LoadData();
        }
        public PeopleProfileViewModel(
            IProfilesManager profilesManager,
            IFriendsManager friendsManager,
            IPreferencesService preferencesService)
        {
            _profilesManager    = profilesManager;
            _friendsManager     = friendsManager;
            _preferencesService = preferencesService;

            _customNavigationService = ServiceLocator.Current.GetInstance <ICustomNavigationService>("PeopleInternal");
            _personProfileId         = (string)_customNavigationService.CurrentPageParams;

            _profile = preferencesService.Profile;

            LoadProfile();
        }
        public StyleAddViewModel(IStylesManager stylesManager)
        {
            _stylesManager = stylesManager;

            _customNavigationService = ServiceLocator.Current.GetInstance <ICustomNavigationService>("StyleInternal");

            _style = _customNavigationService.CurrentPageParams as StyleModel;

            SaveCommand = _style == null
             ? new RelayCommand(async() => await AddStyle())
             : new RelayCommand(async() => await UpdateStyle());

            ActionText = _style == null ? "Добавление" : "Редактирование";
            ButtonText = _style == null ? "Добавить" : "Сохранить изменения";

            SetupFields();
        }
        public ArchitectAddViewModel(
            IArchitectManager architectsManager)
        {
            _architectsManager = architectsManager;

            _customNavigationService = ServiceLocator.Current.GetInstance <ICustomNavigationService>("ArchitectInternal");

            _architect = _customNavigationService.CurrentPageParams as ArchitectModel;

            SaveCommand = _architect == null
             ? new RelayCommand(async() => await AddArchitect())
             : new RelayCommand(async() => await UpdateArchitect());

            ActionText = _architect == null ? "Добавление" : "Редактирование";
            ButtonText = _architect == null ? "Добавить" : "Сохранить изменения";

            SetupFields();
        }
        public ArchitectureStatisticsViewModel(IRepairsManager repairsManager, IArchitecturesManager architecturesManager,
                                               IStylesManager stylesManager)
        {
            _repairsManager          = repairsManager;
            _architecturesManager    = architecturesManager;
            _stylesManager           = stylesManager;
            _customNavigationService = ServiceLocator.Current.GetInstance <ICustomNavigationService>("ArchitectureInternal");

            _architectureCountryStateList = new List <object>();
            _architectureArchStyleList    = new List <object>();
            _dateSumRepairList            = new List <object>();
            _restorationKindList          = new List <object>();
            DataList = new List <object>();

            LoadData();

            StatisticsType = "Состояние сооружений по странам";
        }
Exemple #7
0
        public SourceAddViewModel(ISourcesManager sourcesManager, IArchitecturesManager architecturesManager)
        {
            _sourcesManager       = sourcesManager;
            _architecturesManager = architecturesManager;

            _customNavigationService = ServiceLocator.Current.GetInstance <ICustomNavigationService>("SourceInternal");

            _source = _customNavigationService.CurrentPageParams as SourceModel;

            SaveCommand = _source == null
             ? new RelayCommand(async() => await AddSource())
             : new RelayCommand(async() => await UpdateSource());

            ActionText = _source == null ? "Добавление" : "Редактирование";
            ButtonText = _source == null ? "Добавить" : "Сохранить изменения";

            InitData();
            SetupFields();
        }
        public ActivityViewModel(IDataService dataService, ICustomNavigationService customNavigationService)
        {
            _dataService             = dataService;
            _customNavigationService = customNavigationService;

            LoadedCommand                     = new RelayCommand(OnLoaded);
            UserTappedCommand                 = new RelayCommand <User>(OnUserTapped);
            SetSubscribtionCommand            = new RelayCommand(OnSetSubscribtion);
            UnLoadedCommand                   = new RelayCommand(OnUnloaded);
            SubscriberSelectionChangedCommand = new RelayCommand <SelectionChangedEventArgs>(OnSubscriberSelectionChanged);

            SimpleIoc.Default.GetInstance <UserViewModel>().User = null; //hack ?
            Subscribers = new ObservableCollection <User>();

            if (IsInDesignModeStatic)
            {
                CreateDummyActivity();
            }
        }
        public SourceAddArchitectureViewModel(ISourcesManager sourcesManager, IArchitecturesManager architecturesManager,
                                              IArchitectureSourceManager architectureSourceManager)
        {
            _sourcesManager            = sourcesManager;
            _architecturesManager      = architecturesManager;
            _architectureSourceManager = architectureSourceManager;

            _customNavigationService = ServiceLocator.Current.GetInstance <ICustomNavigationService>("SourceInternal");

            _source = _customNavigationService.CurrentPageParams as SourceModel;

            _architectures = new ObservableCollection <ArchitectureModel>(
                _architecturesManager.GetArchitecturesListBySourceId(_source.Id));

            SaveCommand = new RelayCommand(async() => await AddSourceArchitecture());

            ActionText = "Добавление сооружения";
            ButtonText = "Добавить";

            InitData();
        }
Exemple #10
0
 public ModificationsPageDependencyBlock(ICustomNavigationService navigationService)
 {
     NavigationService = navigationService;
 }
Exemple #11
0
 public MainPageDependencyBlock(IWebService webService, ICustomNavigationService navigationService)
 {
     WebService        = webService;
     NavigationService = navigationService;
 }
        public StatisticsMainViewModel()
        {
            _customNavigationService = ServiceLocator.Current.GetInstance <ICustomNavigationService>("StatisticsInternal");

            NavTo = new RelayCommand <PageKeys>(NavigateTo);
        }