Example #1
0
 public GuestBookViewModel()
 {
     AddGuestCommand = new MvxCommand(AddGuest);
 }
Example #2
0
 public MainViewModel()
 {
     ShowInitialViewModelsCommand = new MvxCommand(ShowInitialViewModels);
 }
Example #3
0
 public Tab1ViewModel()
 {
     OpenChildCommand = new MvxCommand(() => ShowViewModel <TabChildViewModel>());
     OpenModalCommand = new MvxCommand(() => ShowViewModel <ModalViewModel>());
 }
Example #4
0
        public ChooseZipViewModel(IMvxNavigationService navigationService)
        {
            _navigationService = navigationService;

            ShowDetailsCommand = new MvxCommand <string>(OnShowDetailsCommandExecute, CanExecuteShowDetailsCommand);
        }
Example #5
0
 public override void Start()
 {
     _navigateToFirstViewCommand = new MvxCommand(async() => await NavigateToFirstView());
     base.Start();
 }
 public CommentsNewsViewModel()
 {
     Comments           = new ObservableCollection <CommentsNewsItemViewModel>();
     SendCommentCommand = new MvxCommand(SendCommentExecute);
     Title = "Comments";
 }
Example #7
0
 public FirstViewModel(IMvxNavigationService navigationService)
 {
     _navigationService = navigationService;
     GoToCmd            = new MvxCommand(() => { _navigationService.Navigate <SecondViewModel>(); });
 }
Example #8
0
 public SettingsViewModel()
 {
     LogOutCommand = new MvxCommand(LogOutAction);
 }
Example #9
0
 public HomeViewModel()
 {
     FindCoffee = new MvxCommand(ExecuteFindCoffee);
 }
Example #10
0
 public ItemViewModel(MvxCommand <ItemViewModel> deleteCommand)
 {
     DeleteCommand = deleteCommand;
 }
 public UserCredentialsViewModel()
 {
     Title = "Login";
     ForgotPasswordCommand = new MvxCommand(ShowForgotPasswordVm);
     LoginCommand          = new MvxCommand(Login, CanExecuteLogin);
 }
 public PlayerViewModel(IMvxNavigationService navigationService)
 {
     _navigationService = navigationService;
     SaveCommand        = new MvxCommand(Save);
 }
Example #13
0
 public DayPageViewModel()
 {
     ShowAverage();
     FilterCommand = new MvxCommand(execute: ShowFilter);
     SelectedTime  = DateTime.Now.TimeOfDay;
 }
Example #14
0
 public PickerViewModel(IList <string> values, Action <string> selectionChanged)
 {
     Values      = values;
     SelectValue = new MvxCommand <string>(selectionChanged);
 }
Example #15
0
 public MainViewModel(IRepository repository, IAzureClientService clientService)
 {
     _repository    = repository;
     _clientService = clientService;
     ShowInitialViewModelsCommand = new MvxCommand(ShowInitialViewModels);
 }
Example #16
0
 public FirstViewModel()
 {
     MyCommand = new MvxCommand(() => Hello = "Command run", () => Hello.Length == 0);
 }
 public MenuItem(string title, HomeViewModel parent, string viewModelUrl)
 {
     Title = title;
     // Will change to navigate to type once https://github.com/MvvmCross/MvvmCross/pull/2148 is in.
     ShowCommand = new MvxCommand(() => parent._navigationService.Navigate(viewModelUrl));
 }
 private void InitializeCommands()
 {
     _navigateToRideDetailsCommand            = new MvxCommand <int>(NavigateToRideDetails);
     _navigateToRideDetailsAlternativeCommand = new MvxCommand <Ride>(ride =>
                                                                      this.NavigateToRideDetails(ride.RideId));
 }
Example #19
0
 public HomeViewModel()
 {
     ScanAsTaskCommand    = new MvxCommand(DoScanAsTask);
     ScanAsMessageCommand = new MvxCommand(DoScanAsMessage);
     WriteTextCommand     = new MvxCommand(DoWriteText);
 }
Example #20
0
        public RootViewModel(IMvxLogProvider logProvider, IMvxNavigationService navigationService, IMvxViewModelLoader mvxViewModelLoader) : base(logProvider, navigationService)
        {
            _mvxViewModelLoader = mvxViewModelLoader;
            try
            {
                var messenger = Mvx.IoCProvider.Resolve <IMvxMessenger>();
                var str       = messenger.ToString();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }

            ShowChildCommand = new MvxAsyncCommand(async() =>
            {
                var result = await NavigationService.Navigate <ChildViewModel, SampleModel, SampleModel>(new SampleModel
                {
                    Message = "Hey",
                    Value   = 1.23m
                });
                var testIfReturn = result;
            });

            ShowModalCommand = new MvxAsyncCommand(Navigate);

            ShowModalNavCommand =
                new MvxAsyncCommand(async() => await NavigationService.Navigate <ModalNavViewModel>());

            ShowTabsCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <TabsRootViewModel>());

            ShowPagesCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <PagesRootViewModel>());

            ShowSplitCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <SplitRootViewModel>());

            ShowNativeCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <NativeViewModel>());

            ShowOverrideAttributeCommand = new MvxAsyncCommand(async() =>
                                                               await NavigationService.Navigate <OverrideAttributeViewModel>());

            ShowSheetCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <SheetViewModel>());

            ShowWindowCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <WindowViewModel>());

            ShowMixedNavigationCommand =
                new MvxAsyncCommand(async() => await NavigationService.Navigate <MixedNavFirstViewModel>());

            ShowDictionaryBindingCommand = new MvxAsyncCommand(async() =>
                                                               await NavigationService.Navigate <DictionaryBindingViewModel>());

            ShowCollectionViewCommand =
                new MvxAsyncCommand(async() => await NavigationService.Navigate <CollectionViewModel>());

            ShowSharedElementsCommand = new MvxAsyncCommand(async() =>
                                                            await NavigationService.Navigate <SharedElementRootChildViewModel>());

            ShowCustomBindingCommand =
                new MvxAsyncCommand(async() => await NavigationService.Navigate <CustomBindingViewModel>());

            ShowFluentBindingCommand =
                new MvxAsyncCommand(async() => await NavigationService.Navigate <FluentBindingViewModel>());

            RegisterAndResolveWithReflectionCommand   = new MvxAsyncCommand(RegisterAndResolveWithReflection);
            RegisterAndResolveWithNoReflectionCommand = new MvxAsyncCommand(RegisterAndResolveWithNoReflection);

            _counter = 3;

            TriggerVisibilityCommand           =
                new MvxCommand(() => IsVisible = !IsVisible);

            FragmentCloseCommand = new MvxAsyncCommand(() => NavigationService.Navigate <FragmentCloseViewModel>());

            ShowLocationCommand = new MvxAsyncCommand(() => NavigationService.Navigate <LocationViewModel>());
        }
Example #21
0
 public MyElementViewModel(MySource source)
 {
     Source   = source;
     BCommand = new MvxCommand(ExecuteBCommand);
 }
Example #22
0
 public AccentColorMenuData()
 {
     ChangeAccentCommand = new MvxCommand <object>(DoChangeTheme);
 }
Example #23
0
 public PayHistoryPdfViewModel(IFileManager downloadManager)
 {
     this.downloadManager    = downloadManager;
     backToPayHistoryCommand = new MvxCommand(() => { ShowViewModel <PayHistoryViewModel>(); });
     fileOpenInCommand       = new MvxCommand(() => { downloadManager.OpenIn(PdfUrl, PdfName); });
 }
Example #24
0
 private void CreateCommands()
 {
     ShowVideosCommand = new MvxCommand(ShowVideosCommandExecute);
 }
Example #25
0
 public MenuItem(string title, MainMenuViewModel parent, Type viewModelType)
 {
     Title         = title;
     ViewModelType = viewModelType;
     ShowCommand   = new MvxCommand(() => parent.ShowViewModel(ViewModelType));
 }
        public NotificationViewModel(IReqDB dbss, IDialogService dialog, ICalendar calendar, IToast toast, INetwork net)
        {
            dbs           = dbss;
            this.dialog   = dialog;
            this.calendar = calendar;

            ReloadCommand.Execute(null);
            SelectMessage = new MvxCommand <Req>(async selectedItem =>
            {
                string ifloc = "Not Needed";
                string ifcal = "Not Needed";

                if (selectedItem.ReqLoc == true)
                {
                    ifloc = "Needed";
                }

                if (selectedItem.ReqCal == true)
                {
                    ifcal = "Needed";
                }

                string mes = selectedItem.ReqFrom + "\n" + "Calendar: " + ifcal + "\n" + "Location: " + ifloc + "\n" + "Other Info:" + selectedItem.ReqExtra;

                List <string> Answer = await dialog.Show(mes, "Status Request", "Send", "Dismiss");
                if (Answer[0] == "true")
                {
                    Message.Remove(selectedItem);
                    await DeleteReq(selectedItem.Id);
                    toast.Show("Status Response Sent");
                    string calend = ""; // Calander Events for Today
                    string wifi   = ""; // Wifi Access point of person

                    // Don't send location or Calendar
                    if ((MyGlobals.SelPer.PLocCheck == false || ifloc == "Not Needed") && (MyGlobals.SelPer.PCalCheck == false || ifcal == "Not Needed"))
                    {
                        calend = "";
                        wifi   = "";
                    }
                    // Don't send Calendar
                    else if (MyGlobals.SelPer.PCalCheck == false || ifcal == "Not Needed")
                    {
                        calend = "";
                        wifi   = net.SSID();
                    }
                    // Don't send Location
                    else if (MyGlobals.SelPer.PLocCheck == false || ifloc == "Not Needed")
                    {
                        calend = calendar.returnEvents();
                        wifi   = "";
                    }
                    // Send both.
                    else
                    {
                        calend = calendar.returnEvents();
                        wifi   = net.SSID();
                    }


                    MyGlobals.answer = new Answ
                    {
                        AnsFrom  = selectedItem.ReqTo,
                        AnsTo    = selectedItem.ReqFrom,
                        AnsLoc   = wifi,
                        AnsCal   = calend,
                        AnsExtra = Answer[1]
                    };
                    ShowViewModel <RedirectViewModel>();
                }

                else if (Answer[0] == "false")
                {
                    Message.Remove(selectedItem);
                    await DeleteReq(selectedItem.Id);
                    toast.Show("Status Request Deleted");
                }
            });
        }
 public MenuViewModel()
 {
     ShowProfileCommand = new MvxCommand(ShowProfile);
 }
Example #28
0
 public LoginViewModel()
 {
     LoginCommand     = new MvxAsyncCommand(LoginAsync);
     RegisterCommand  = new MvxCommand(() => ShowViewModel <RegisterViewModel>());
     OpenModalCommand = new MvxCommand(() => ShowViewModel <ModalViewModel>());
 }
Example #29
0
        public override void Prepare()
        {
            base.Prepare();

            DataEmptyActionButtonClickCommand = new MvxCommand(OnDataEmptyActionButtonClicked);
        }
 public StartupViewModel()
 {
     GoToNextPageCommand = new MvxCommand(GoToNextPage);
 }
 public FirstViewModel()
 {
     //SetTime= new MvxCommand(()=>{SetTimeString();});
     SetTime= new MvxCommand(()=>{GotoList();});
 }