Esempio n. 1
0
        internal RequestViewModel(Xamarin.Forms.View element, SelectedViewModel SelectedViewModel, Xamarin.Forms.StackLayout spList, Xamarin.Forms.ControlTemplate ctControlTemplate)
        {
            this._element          = element;
            this.SelectedViewModel = SelectedViewModel;

            this._spList            = spList;
            this._ctControlTemplate = ctControlTemplate;
        }
Esempio n. 2
0
 public void PopViewModel(object viewModel)
 {
     if (!(viewModel is ShellViewModel) && SelectedViewModel.Equals(viewModel))
     {
         m_viewModelStack.Pop();
         SetViewRelatedHeaders();
         RaisePropertyChangedEvent("SelectedViewModel");
     }
 }
Esempio n. 3
0
        public Selected()
        {
            InitializeComponent();
            var vm = new SelectedViewModel();

            Machine.ViewModels.Ioc.SimpleIoc <IMachineStructEditor> .Register(vm);

            DataContext = vm;
        }
Esempio n. 4
0
 private bool CanExecuteOuvrirAcceuil(object obj)
 {
     if (SelectedViewModel.GetType() != typeof(ViewAccueilViewModel))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 5
0
        public ActionResult Selected(string handle, int?v)
        {
            var model = new SelectedViewModel();

            if (model.Get(handle, v))
            {
                TempData["TOC"] = model.OuterTOC;
                return(View(model));
            }
            return(RedirectToAction("Index", "Help"));
        }
Esempio n. 6
0
        private void Picker_SelectedIndexChanged(object sender, EventArgs e)
        {
            SelectedViewModel view = this.BindingContext as SelectedViewModel;

            if (null != view)
            {
                if (null != view.SelectedLang && null != view.GoCommand)
                {
                    view.GoCommand.Execute("Lang");
                }
            }
        }
Esempio n. 7
0
 private void OnRefresh(object sender, EventArgs e)
 {
     if (SelectedViewModel.GetType() == typeof(ViewAccueilViewModel) || SelectedViewModel.GetType() == typeof(ViewSerieViewModel) || SelectedViewModel.GetType() == typeof(ViewRechercheViewModel))
     {
         SelectedViewModel = new ViewAccueilViewModel();
         OpenInfoSerieEvent.GetInstance().Handler       += OnOpenInfoSerie;
         RetourWindowAccueilEvent.GetInstance().Handler += OnRetourAccueil;
     }
     if (SelectedViewModel.GetType() == typeof(ViewProfilViewModel))
     {
         SelectedViewModel = new ViewProfilViewModel();
         OpenInfoSerieEvent.GetInstance().Handler += OnOpenInfoSerie;
     }
 }
Esempio n. 8
0
 public void PushViewModel(object viewModel)
 {
     Debug.Assert(!(viewModel is ShellViewModel), "ShellViewModel incorrectly pushed onto stack.  Use ClearViewModels().");
     ClearModalViewModel();
     if (viewModel is ShellViewModel)
     {
         ClearViewModels();
     }
     else if (!SelectedViewModel.Equals(viewModel))
     {
         m_viewModelStack.Push(viewModel);
     }
     SetViewRelatedHeaders();
     RaisePropertyChangedEvent("SelectedViewModel");
 }
Esempio n. 9
0
        public MainViewModel()
        {
            AppInfo appInfo = new AppInfo(typeof(MainViewModel).Assembly);

            Title      = appInfo.Title;
            ViewModels = new ObservableCollection <ViewModelBase>
            {
                new ObservableDictionaryViewModel(),
                new ObservableHashSetViewModel(),
                new ObservableKeyedDictionaryViewModel(),
                new ObservableListViewModel(),
                new ObservableSortedSetViewModel()
            };
            ChangeViewCommand = new RelayCommand <ViewModelBase>(vm => SelectedViewModel = vm, vm => vm != SelectedViewModel);
            GenerateCommand   = new RelayCommand(() => SelectedViewModel.Generate(), () => SelectedViewModel != null);
            ClearCommand      = new RelayCommand(() => SelectedViewModel.Clear(), () => SelectedViewModel != null);
        }
Esempio n. 10
0
 internal ChangeCountViewModel(Xamarin.Forms.View element, SelectedViewModel SelectedViewModel, Action Recalc)
 {
     this._element          = element;
     this.SelectedViewModel = SelectedViewModel;
     this.Recalc            = Recalc;
 }
Esempio n. 11
0
 private void ShowCustom(object obj)
 {
     SelectedViewModel = new SelectedViewModel {
         ViewModel = new CustomViewModel(), ViewModelName = nameof(CustomViewModel)
     };
 }
Esempio n. 12
0
 private void ShowCertificationLvl(object obj)
 {
     SelectedViewModel = new SelectedViewModel {
         ViewModel = new CertificationLvlViewModel(), ViewModelName = nameof(CertificationLvlViewModel)
     };
 }
Esempio n. 13
0
 private void ShowBigBox(object obj)
 {
     SelectedViewModel = new SelectedViewModel {
         ViewModel = new BigBoxViewModel(), ViewModelName = nameof(BigBoxViewModel)
     };
 }
Esempio n. 14
0
 private void SaveButton_Click(object sender, RoutedEventArgs e) => SelectedViewModel?.Save();