public FirstViewModel(RottenTomatoRestService rottenTomatoRestService) { _rottenTomatoRestService = rottenTomatoRestService; SearchCommand = new MvxCommand(SearchCommandExecute, SearchCommandCanExecute); ShowDetailCommand = new MvxCommand<Movie>(movie => ShowViewModel<DetailViewModel>(new { movieId = movie.id })); }
public CadastroOcorrenciaViewModel() { carregarImage = new MvxCommand(ExecutarCarregamentoImagem); var locationWatcher = Mvx.Resolve<IMvxLocationWatcher>(); var options = new MvxLocationOptions { MovementThresholdInM = 50, TimeBetweenUpdates = TimeSpan.FromSeconds(5) }; locationWatcher.Start(options, (location) => { //locationWatcher.Stop(); //Debug.WriteLine(location.Coordinates.Latitude + " : " + location.Coordinates.Longitude); Debug.WriteLine(location.Coordinates.Latitude + " : " + location.Coordinates.Longitude); ReverseGeoLoc reverse = new ReverseGeoLoc(); ReverseGeoLoc.Address_Components reverse1 = new ReverseGeoLoc.Address_Components(); var request = WebRequest.Create("http://maps.google.com/maps/api/geocode/json?latlng=" + location.Coordinates.Latitude + "," + location.Coordinates.Longitude + "&sensor=false") as HttpWebRequest; reverse1 = reverse.DeserializeReverse(request.ToString()); Hello = reverse1.short_name; }, (error) => { Debug.WriteLine(error.Code); }); //locationWatcher.CurrentLocation.Timestamp.DateTime - DateTime.Now; }
public LoggerViewerViewModel(LoggerService logger) { Logger = logger; CopyCommand = new MvxCommand(ExecuteCopyCommand); ClearCommand = new MvxCommand(ExecuteClearCommand); }
public UserGoalEditViewModel() { //this.DefaultViewModel["Lebensmittel"] = ds.CurrentLebensmittel; //this.DefaultViewModel["Items"] = ds.LebensmittelConsumed; //this.DefaultViewModel["SelectedConsumed"] = ds.SelectedConsumed; //this.DefaultViewModel["Search"] = ds.LebensmittelResult; //this.DefaultViewModel["CurrentLebensmittel"] = ds.CurrentLebensmittel; //this.DefaultViewModel["SummaryConsumedDay"] = ds.SummaryConsumedDay; //this.DefaultViewModel["SummaryConsumedDaytime"] = ds.SummaryConsumedDaytime; //ds.FillDailyData(); //SelectedConsumed = null; WorkoutMinutes = new ObservableCollection<int>() { 20,40, 60 }; WorkoutDays= new ObservableCollection<int>() { 1, 3, 5}; SaveGoalCommand = new MvxCommand(SaveGoal, canSaveGoal); _goal_Endurance = SelectedUserGoal.Goal_Endurance; _goal_FatLoss = SelectedUserGoal.Goal_FatLoss; _goal_Muscle = SelectedUserGoal.Goal_Muscle; OnPropertyChanged("Goal_Muscle"); OnPropertyChanged("Goal_Endurance"); OnPropertyChanged("Goal_FatLoss"); ; }
public GoalEditViewModel() { //this.DefaultViewModel["Lebensmittel"] = ds.CurrentLebensmittel; //this.DefaultViewModel["Items"] = ds.LebensmittelConsumed; //this.DefaultViewModel["SelectedConsumed"] = ds.SelectedConsumed; //this.DefaultViewModel["Search"] = ds.LebensmittelResult; //this.DefaultViewModel["CurrentLebensmittel"] = ds.CurrentLebensmittel; //this.DefaultViewModel["SummaryConsumedDay"] = ds.SummaryConsumedDay; //this.DefaultViewModel["SummaryConsumedDaytime"] = ds.SummaryConsumedDaytime; //SelectedConsumed = null; _messenger = Mvx.Resolve<IMvxMessenger>(); //_logintoken = _messenger.Subscribe<LoggedInEvent>(a => LoginChanged(a.LoggedIn)); _synctoken = _messenger.Subscribe<SyncEvent>(a => RaisePropertyChanged("Sync")); SaveDailyCommand = new MvxCommand(SaveDaily, canSaveDaily); NewRecord = false; WorkoutMinutes = new ObservableCollection<int>() { 20, 40, 60 }; WorkoutDays = new ObservableCollection<int>() { 1, 3, 5 }; _goal_Endurance = CurrentGoal.Goal_Endurance; _goal_FatLoss = CurrentGoal.Goal_FatLoss; _goal_Muscle = CurrentGoal.Goal_Muscle; OnPropertyChanged("Goal_Muscle"); OnPropertyChanged("Goal_Endurance"); OnPropertyChanged("Goal_FatLoss"); ; }
public HomeViewModel(IStorageService storageService, IMvxMessenger messenger, IPopupHelper helper, IMessageService messageService) : base(messenger, helper) { _storageService = storageService; _messageService = messageService; SelectContactCommand = new MvxCommand<ContactListItem>(SelectContactCommandAction); }
public MenuViewModel() { DefinirGastoMax = new MvxCommand(ExecuteDefinirGastoMax); AdicionarGasto = new MvxCommand(ExecuteAdicionarGasto); PesquisarDespesa = new MvxCommand(ExecutePesquisarDespesa); Dinheiro = Mvx.GetSingleton<Dinheiro>(); Dinheiro.Atualizar(); }
public MainViewModel() { //var contacts = Mvx.Resolve<IContacts>(); //var contactsList = contacts.GetContacts(); //Contacts = new ObservableCollection<GenericContact>(contactsList); VamosBeberCommand = new MvxCommand(ExecuteVamosBeberCommand); }
public MainViewModel(LoggerService logger) { this.logger = logger; GoToPage1Command = new MvxCommand(ExecuteGoToPage1Command); GoToPage2Command = new MvxCommand(ExecuteGoToPage2Command); ForceGarbageCollectionCommand = new MvxCommand(ExecuteForceGarbageCollectionCommand); }
public AddContactViewModel(IQrService qrService, IMessageService messageService, IMvxMessenger messenger, IPopupHelper helper) : base(messenger, helper) { _qrService = qrService; _messageService = messageService; CodeDetectedCommand = new MvxCommand<string>(CodeDetectedCommandAction); AddContactCommand = new MvxCommand(AddContactCommandAction, AddContactCanExecute); }
public SimpleExampleViewModel() { GotoScrollView = new MvxCommand<string> (param => { ShowViewModel<ScrollExampleViewModel> (); }); GotoListView = new MvxCommand<string> (param => { ShowViewModel<ListExampleViewModel> (); }); }
public NutritionPlanOverviewViewModel() { _ds = BettrFitDataSource.Instance; _messenger = Mvx.Resolve<IMvxMessenger>(); _synctoken = _messenger.Subscribe<SyncEvent>(a => RaisePropertyChanged("Sync")); CurrentDate = DateTime.Now; NutritionPlanCreateCommand = new MvxCommand(OnCreateNutritionPlan); }
public FavouritesViewModel(PropertyFinderPersistentState state) { Properties = new ObservableCollection<PropertyViewModel>(); foreach (var property in state.Favourites) { Properties.Add(new PropertyViewModel(state,property)); } FavouritesSelectedCommand = new MvxCommand<PropertyViewModel>(DoFavouritesSelected); }
public SettingsViewModel(IUserService userService, IStorageService storageService, IQrService qrService, IMvxMessenger messenger, IPopupHelper helper) : base(messenger, helper) { _userService = userService; _storageService = storageService; _qrService = qrService; GenerateCodeCommand = new MvxCommand(GenerateCodeAction, () => !string.IsNullOrWhiteSpace(ContactName)); ClearCommand = new MvxCommand(ClearCommandAction); }
public SearchResultsViewModel(PropertyFinderPersistentState stateFactory, PropertyDataSource dataSource) { _stateFactory = stateFactory; _dataSource = dataSource; Properties= new ObservableCollection<PropertyViewModel>(); PropertiesSelectedCommand = new MvxCommand<PropertyViewModel>(DoPropertiesSelected); LoadMoreCommand = new MvxCommand(DoLoadMore); Title = "Loading..."; }
public LoginViewModel(IStorageService storageService, IUserService userService, IPhoneService phoneService, IMessageService messageService, IEncryptionService encryptionService, IMvxMessenger messenger, IPopupHelper helper) : base(messenger, helper) { _storageService = storageService; _userService = userService; _phoneService = phoneService; _messageService = messageService; _encryptionService = encryptionService; ProceedCommand = new MvxCommand(ProceedCommandAction, ValidatePassword); }
public MainViewModel() { _clients = new List<Client> { new Client { Id=1, Name = "Client 1", City="London" }, new Client { Id=2, Name = "Client 2", City="Mumbai" }, new Client { Id=3, Name = "Client 3", City="New York" }, new Client { Id=4, Name = "Client 4", City="London" }, new Client { Id=5, Name = "Client 5", City="London" }, }; ShowClientDetailsCommand = new MvxCommand<int>(ShowClientDetails); }
public FeedbackViewModel() { _ds = BettrFitDataSource.Instance; SendCommand = new MvxCommand(OnSend); _messenger = Mvx.Resolve<IMvxMessenger>(); _synctoken = _messenger.Subscribe<SyncEvent>(a => RaisePropertyChanged("Sync")); //var client = WebService.Instance.WS; RaisePropertyChanged("Sync"); }
public AppointmentsViewModel(IMyHealthClient client, IMvxMessenger messenger) : base(messenger) { _myHealthClient = client; _messenger = messenger; Appointments = new ObservableCollection<ClinicAppointment>(); ShowDetailsCommand = new MvxCommand<Appointment>(OnShowDetails); RefreshCommand = new MvxCommand(async () => await ReloadDataAsync()); _newAppointmentViewModel = new Lazy<NewAppointmentViewModel>(() => Mvx.IocConstruct<NewAppointmentViewModel>()); }
public MenuViewModel(MenuMode mode) { if(mode != MenuMode.AtHome) { var messenger = Mvx.Resolve<IMvxMessenger>(); _token = messenger.Subscribe<ContentReceivedMessage>(message => { HasReceivedNotifications = true; RaisePropertyChanged(() => HasReceivedNotifications); }); } HomeCommand = new MvxCommand(HomeCommandAction, () => mode != MenuMode.AtHome); SettingsCommand = new MvxCommand(SettingsCommandAction, () => mode != MenuMode.AtSettings); AddContactCommand = new MvxCommand(AddContactCommandAction, () => mode != MenuMode.AtAddContact); }
public LoginViewModel() { LoginCommand = new MvxCommand(OnLogin, CanLogin); BackCommand = new MvxCommand(() => { this.Close(this); }); #if DEBUG Username= "******"; Pwd = "sil2con3"; #endif _messenger = Mvx.Resolve<IMvxMessenger>(); _synctoken = _messenger.Subscribe<SyncEvent>(a => RaisePropertyChanged("Sync")); }
/// <summary> /// Creates an AboutViewModel Object /// </summary> /// <param name="appInformation">Instance of a <see cref="IAppInformation" /> implementation.</param> /// <param name="composeEmailTask">Instance of a <see cref="IMvxComposeEmailTask" /> implementation.</param> /// <param name="webBrowserTask">Instance of a <see cref="IMvxWebBrowserTask" /> implementation.</param> /// <param name="storeFeatures">Instance of a <see cref="IStoreFeatures" /> implementation.</param> public AboutViewModel(IAppInformation appInformation, IMvxComposeEmailTask composeEmailTask, IMvxWebBrowserTask webBrowserTask, IStoreFeatures storeFeatures) { this.appInformation = appInformation; this.composeEmailTask = composeEmailTask; this.webBrowserTask = webBrowserTask; this.storeFeatures = storeFeatures; GoToWebsiteCommand = new MvxCommand(GoToWebsite); SendMailCommand = new MvxCommand(SendMail); RateAppCommand = new MvxCommand(RateApp); GoToRepositoryCommand = new MvxCommand(GoToRepository); }
public PropertyFinderViewModel(PropertyFinderPersistentState stateFactory, PropertyDataSource dataSource, IGeoLocationService geolocationService) { _state = stateFactory; _dataSource = dataSource; _geolocationService = geolocationService; SearchCommand = new MvxCommand(DoSearch); UseLocationCommand = new MvxCommand(DoUseLocation); ShowFavouritesCommand = new MvxCommand(DoShowFavourites); RecentSearchSelectedCommand = new MvxCommand<RecentSearch>(DoRecentSearchSelected); LocationSelectedCommand = new MvxCommand<Location>(DoLocationSelected); SuggestedLocations = new ObservableCollection<Location>(); RecentSearches = new ObservableCollection<RecentSearch>(); LoadRecentSearches(); }
public ListExampleViewModel () { ReloadCommand = new MvxCommand (RefreshDataForTable); SelectedCommand = new MvxCommand<int> (rowId => { int x = rowId; // TODO: navigate to detail of this row. }); RemoveCommand = new MvxCommand<int> (rowId => { int x = rowId; }); RefreshDataForTable (); }
public ConversationViewModel(IStorageService storageService, IMessageService messageService, IMvxMessenger messenger, IPopupHelper helper) : base(messenger, helper) { _storageService = storageService; _messageService = messageService; _token = _messenger.Subscribe<ContentReceivedMessage>(OnNotificationReceived, MvxReference.Strong); SendMessageCommand = new MvxCommand(SendMessageCommandAction, () => !string.IsNullOrWhiteSpace(MessageBody)); CleaningUp += () => { if (_token == null) return; _token.Dispose(); _token = null; }; }
public UserGoalOverviewViewModel() { //this.DefaultViewModel["Lebensmittel"] = ds.CurrentLebensmittel; //this.DefaultViewModel["Items"] = ds.LebensmittelConsumed; //this.DefaultViewModel["SelectedConsumed"] = ds.SelectedConsumed; //this.DefaultViewModel["Search"] = ds.LebensmittelResult; //this.DefaultViewModel["CurrentLebensmittel"] = ds.CurrentLebensmittel; //this.DefaultViewModel["SummaryConsumedDay"] = ds.SummaryConsumedDay; //this.DefaultViewModel["SummaryConsumedDaytime"] = ds.SummaryConsumedDaytime; ds.FillUserGoals(); //SelectedConsumed = null; AddGoalCommand = new MvxCommand(AddGoal, canAddGoal); DeleteGoalCommand = new MvxCommand(DeleteGoal, canDeleteGoal); EditGoalCommand = new MvxCommand(EditGoal, canEditGoal); }
public MenuViewModel(ICurrentUserService usvc, IMvxMessenger messenger) : base(messenger) { _userSvc = usvc; _subscriptionToken = _messenger.Subscribe<LoggedUserInfoChangedMessage>(UpdateLoggedUserInfo); MenuItems = new ObservableCollection<MenuItem>(); ItemSelectedCommand = new MvxCommand<MenuItem>(OnSelectItem); MenuItems.Add(new MenuItem { Title = "Home", ViewModelType = typeof(HomeViewModel), Option = MenuOption.Home, IsSelected = true }); MenuItems.Add(new MenuItem { Title = "Appointments", ViewModelType = typeof(AppointmentsViewModel), Option = MenuOption.Appointment }); MenuItems.Add(new MenuItem { Title = "Treatments", ViewModelType = typeof(TreatmentViewModel), Option = MenuOption.Treatment }); MenuItems.Add(new MenuItem { Title = "User", ViewModelType = typeof(UserViewModel), Option = MenuOption.User }); MenuItems.Add(new MenuItem { Title = "Settings", ViewModelType = typeof(SettingsViewModel), Option = MenuOption.Settings }); }
public SheduleWizardViewModel(IApiFacade apiFacade,IFavoriteTrainRepository favoriteTrainRepository,IStationRepository stationRepository) :base("Расписание") { _apiFacade = apiFacade; _favoriteTrainRepository = favoriteTrainRepository; _stationRepository = stationRepository; FindCommand=new MvxCommand(async ()=> await Find()); AddToFavoritesCommand=new MvxCommand(async ()=> await AddToFavorites()); _insertStationCancelationToken=new CancellationTokenSource(); HideUnusedCommand =new MvxCommand(() => { _isAll = !_isAll; ShowAndHideUnused(); SetHideUnusedText(); }); _selectDate=new DateTimeOffset(DateTime.Now); SetHideUnusedText(); }
public DailyDataEditViewModel() { //this.DefaultViewModel["Lebensmittel"] = ds.CurrentLebensmittel; //this.DefaultViewModel["Items"] = ds.LebensmittelConsumed; //this.DefaultViewModel["SelectedConsumed"] = ds.SelectedConsumed; //this.DefaultViewModel["Search"] = ds.LebensmittelResult; //this.DefaultViewModel["CurrentLebensmittel"] = ds.CurrentLebensmittel; //this.DefaultViewModel["SummaryConsumedDay"] = ds.SummaryConsumedDay; //this.DefaultViewModel["SummaryConsumedDaytime"] = ds.SummaryConsumedDaytime; //SelectedConsumed = null; _messenger = Mvx.Resolve<IMvxMessenger>(); //_logintoken = _messenger.Subscribe<LoggedInEvent>(a => LoginChanged(a.LoggedIn)); _synctoken = _messenger.Subscribe<SyncEvent>(a => RaisePropertyChanged("Sync")); SaveDailyCommand = new MvxCommand(SaveDaily, canSaveDaily); NewRecord = false; }
public PowerupViewModel() { // instantiate/retrieve Bluetooth manager _btManager = MvxSimpleIoCContainer.Instance.Resolve<IBluetoothManager>(); _devices = new List<DeviceInfo>(); _devices.Add(SelectedDevice); // refresh command Refresh = new MvxCommand(async () => { try { // disconnect the Bluetooth mnager from any existing connections _btManager.Disconnect(); ErrorMessage = string.Empty; // get the paired devices and select the first one Devices = await _btManager.GetPairedDevices(); } catch (Exception ex) { ErrorMessage = ex.Message; } if (Devices.Count > 0) { SelectedDevice = Devices[0]; } // Notify the listeners of the affected properties RaisePropertyChanged(() => CanConnect); RaisePropertyChanged(() => IsConnected); }); // Connect command Connect = new MvxCommand(async () => await ConnectToBT(), () => CanConnect); // there is no command for OnOff as WindowsPhone does not support it for toggleSwitch // instead IsOn property is used. // if you wish to use plug-in and a command to launch web browser, this may be helpful // http://stackoverflow.com/questions/16616774/mvvmcross-how-to-navigate-to-something-besides-a-viewmodel }