private void Address() { var navigationParameters = new NavigationParameters(); var data = employeeService.GetAll(); navigationParameters.Add("DataToDisplay", data.GetHashCode().ToString()); AppParameters.Save(data.GetHashCode(), data); navigationParameters.Add("ReportPath", @"Reports\EmployeeAddressBook.rdlc"); //navigationParameters.Add("Parameters",); navigationParameters.Add("ReportDataSourceName", "EmployeeAddressBook"); this.regionManager.RequestNavigate(RegionNames.WorkingArea, new Uri("ReportWindowView" + navigationParameters.ToString(), UriKind.Relative)); }
private void Navigate() { var navParams = new NavigationParameters(); navParams.Add("timestamp", DateTime.Now); _navigationService.Navigate("ViewB", navParams); }
private void SaveCustomerDetails() { if (_currentCustomer != null) { NavigationParameters navigationParameters = new NavigationParameters(); if (_currentCustomer.Id == default(int)) { //_currentCustomer.CustomerTypeId = _currentCustomerType.Id; _clientLayer.AddCustomer(_currentCustomer); navigationParameters.Add("StatusCustomer", "NewCustomer"); } else { _clientLayer.UpdateCustomer(_currentCustomer); navigationParameters.Add("StatusCustomer", "UpdateCustomer"); } RaiseNotification(); _regionManager.RequestNavigate(RegionNames.MainRegion, ViewNames.CustomerListView, navigationParameters); navigationParameters.Add("CurrentCustomer", _currentCustomer); _regionManager.RequestNavigate(RegionNames.DetailRegion, ViewNames.CustomerDetailsView, navigationParameters); //_regionManager.RequestNavigate(RegionNames.MainRegion, new Uri(ViewNames.CustomerListView, UriKind.Relative), navigationParameters); } else { } }
public void ParametersParsedFromNavigationParametersInAbsoluteUri() { var navParameters = new NavigationParameters(); navParameters.Add("id", 3); navParameters.Add("name", "brian"); var parameters = UriParsingHelper.GetSegmentParameters("http://www.brianlagunas.com/MainPage" + navParameters.ToString()); Assert.NotEmpty(parameters); Assert.Contains("id", parameters.Keys); Assert.Contains("name", parameters.Keys); Assert.Equal("3", parameters["id"]); Assert.Equal("brian", parameters["name"]); }
void Navigate() { NavigationParameters parameters = new NavigationParameters(); parameters.Add("message", "Message from MainPage"); _navigationService.Navigate("ViewA", parameters); }
public void WhenGivenDuplicateParametersThrowsArgumentException() { Assert.Throws<ArgumentException>(() => { var parameters = new NavigationParameters(_uri); parameters.Add("id", 3); }); }
public void AddCustomerHandler() { var q = new NavigationParameters(); q.Add("id",-1); regionManager.RequestNavigate(RegionNames.MainRegion, "CustomerAddUpdateView" + q.ToString()); }
public void ParametersParsedFromNavigationParametersInAbsoluteUri() { var navParameters = new NavigationParameters(); navParameters.Add("id", 3); navParameters.Add("name", "brian"); var uri = new Uri("http://www.google.com/MainPage" + navParameters.ToString(), UriKind.Absolute); var parameters = UriParsingHelper.ParseQuery(uri); Assert.NotEmpty(parameters); Assert.Contains("id", parameters.Keys); Assert.Contains("name", parameters.Keys); Assert.Equal("3", parameters["id"]); Assert.Equal("brian", parameters["name"]); }
private void Click() { var parameters = new NavigationParameters(); parameters.Add("Message", "A message from ViewA"); //uses the overload to navigate using a class as the key //when navigating within a NavigationPage, set useModalNavigation = false NavigationService.Navigate<ViewCViewModel>(parameters); }
/// <summary> /// Called when a feed item is selected. /// </summary> /// <param name="selectedFeedItem">The selected feed item.</param> protected override void OnSelectedFeedItem(FeedItemViewModel selectedFeedItem) { var navigationParameters = new NavigationParameters(); navigationParameters.Add("SelectedFeedItem", selectedFeedItem); var regionManager = ServiceLocator.Current.GetInstance<IRegionManager>(); regionManager.RequestNavigate( RegionNames.RSSFeedReader, new Uri(typeof(LabsFeedReaderView).Name, UriKind.Relative), navigationParameters); }
void Navigate() { NavigationParameters parameters = new NavigationParameters(); parameters.Add("message", "Message from MainPage"); _navigationService.Navigate("ViewA", parameters); //other ways of navigating depending on how you registered your views for navigation //_navigationService.Navigate("A", parameters); //_navigationService.Navigate<ViewAViewModel>(parameters); }
public void Edit() { if (SelectedCustomer != null ) { var q = new NavigationParameters(); q.Add("id", SelectedCustomer.CustomerID.ToString()); regionManager.RequestNavigate(RegionNames.MainRegion, "CustomerAddUpdateView" + q.ToString()); //regionManager.RegisterViewWithRegion(RegionNames.MainRegion, typeof(CustomerAddUpdateView)); } }
private void GoToBillableHoursEmp(object sender, RoutedEventArgs e) { var navigationParameters = new NavigationParameters(); Mapper.CreateMap<WorkHour, BasicWorkHourVM>(); Mapper.CreateMap<Employee, BasicEmployeeVM>(); Mapper.CreateMap<WorkCode, BasicWorkCodeVM>(); var data = workHourService.GetReport().Where(a => a.WorkCode.Billable == true).ToList(); var bworkhours = new List<BasicWorkHourVM>(); foreach (WorkHour wh in data) { bworkhours.Add(Mapper.Map<WorkHour, BasicWorkHourVM>(wh)); } navigationParameters.Add("DataToDisplay", bworkhours.GetHashCode().ToString()); AppParameters.Save(bworkhours.GetHashCode(), bworkhours); navigationParameters.Add("ReportPath", @"Reports\HoursByEmployee.rdlc"); //navigationParameters.Add("Parameters",); navigationParameters.Add("ReportDataSourceName", "HoursByEmployee"); this.regionManager.RequestNavigate(RegionNames.WorkingArea, new Uri("ReportWindowView" + navigationParameters.ToString(), UriKind.Relative)); }
/// <summary> /// Navigates the specified region manager to the main view of a specified Prism module. /// </summary> /// <param name="regionManager">The region manager that this extension method effects.</param> /// <param name="regionName">The name of the region to call Navigate on.</param> /// <param name="moduleName">The name of the module to display.</param> /// <param name="parameters">The navigation parameters.</param> public static void RequestNavigateToModuleSpecificView(this IRegionManager regionManager, string regionName, string moduleName, Dictionary<string, string> parameters) { if (String.IsNullOrWhiteSpace(moduleName)) throw new ArgumentException(StevenVolckaert.Properties.Resources.ValueNullEmptyOrWhiteSpace, "moduleName"); var navigationParameters = new NavigationParameters(); if (parameters != null && parameters.Count > 0) foreach (KeyValuePair<string, string> parameter in parameters) navigationParameters.Add(parameter.Key, parameter.Value); var uri = new Uri("/" + moduleName.Replace("Module", "View") + navigationParameters, UriKind.Relative); regionManager.RequestNavigate(regionName, uri); }
private void OpenMeetingEmail(Meeting meeting) { // todo: 12 - Opening an email // // This view initiates navigation using the RegionManager. // The RegionManager will find the region and delegate the // navigation request to the region specified. // // This navigation request also includes additional navigation context, an 'EmailId', to // allow the Email view to orient to the right item. var parameters = new NavigationParameters(); parameters.Add(EmailIdName, meeting.EmailId.ToString(GuidNumericFormatSpecifier)); this.regionManager.RequestNavigate(RegionNames.MainContentRegion, new Uri(EmailViewName + parameters, UriKind.Relative)); }
/// <summary> /// Called when a channel is selected. /// </summary> /// <param name="selectedChannelName">The name of the selected channel.</param> protected override void OnSelectedChannel(string selectedChannelName) { if (selectedChannelName != ChannelNames.QANews) { this.IsChecked = false; return; } var regionManager = ServiceLocator.Current.GetInstance<IRegionManager>(); var navigationParameters = new NavigationParameters(); navigationParameters.Add("Feed", this.Feed); regionManager.RequestNavigate( RegionNames.RSSFeeds, new Uri(typeof(QANewsFeedsView).Name, UriKind.Relative), navigationParameters); }
/// <summary> /// Creates meetings and stores in a collection. /// </summary> public async void VisualizeAppointments(string appointmentNotes) { Appointment appointment = (await appointmentRepository.GetAllAsync()).FirstOrDefault(x => x.Id == appointmentNotes); switch (appointment.ConsultationType) { case Appointment._INDIVIDUAL: case Appointment._ORIENTACAO: break; case Appointment._GRUPO: var navParameters = new NavigationParameters(); navParameters.Add("patients", null); await navigationService.NavigateAsync("InternAttendancePageViewModel", navParameters); break; } }
protected virtual async void ValidParticipant() { this.IsBusy = true; if (this.SelectedUser != null) { this.IsBusy = true; var parameters = new NavigationParameters(); parameters.Add(AppNavigationParameters.AddParticipant, this.SelectedUser); await this.NavigationService.GoBackAsync(parameters); } else { this.IsBusy = false; await this.DialogService.DisplayAlertAsync(DefaultStrings.RenseignerInformationTitle, DefaultStrings.RenseignerInformation, DefaultStrings.OkButton); } }
private async void SaveExecute() { if (!Validate()) { return; } var constant = new Constant { Id = currentId, Name = Name.Value, Value = decimal.Parse(Value.Value, CultureInfo.CurrentCulture), Note = Note }; await _repositoryService.SaveAsync(constant); var parameters = new NavigationParameters(); parameters.Add("const", constant); await _navigationService.GoBackAsync(parameters); }
private async void OnSearch() { Debug.WriteLine($"**** {this.GetType().Name}.{nameof(OnSearch)}"); CitySearch = new City(); CitySearch.CityName = Search; if (Search.Contains(',')) { CitySearch.CityName = Search; NavigationParameters navParam = new NavigationParameters(); navParam.Add(Helpers.NavParameterKeys.cityNameSt, CitySearch); await _navigationService.NavigateAsync("TravelAppContainerPage", navParam); } else { OnShowAlert(); return; } }
public async void GoBack() { //var navigationParams = new NavigationParameters(); //navigationParams.Add("FromResetPassword", true); //NavigationService.GoBackAsync(navigationParams); //if (Device.RuntimePlatform == Device.Android) //{ // await NavigationService.GoBackAsync(); //} if (Device.RuntimePlatform == Device.iOS || Device.RuntimePlatform == Device.Android) { var navigationParams = new NavigationParameters(); navigationParams.Add("Email", Email); await NavigationService.NavigateAsync("ForgotPasswordPage", navigationParams); } }
private async void OnTranferScrumFrameworkDetail(object obj) { if (IsBusyBindProp) { return; } IsBusyBindProp = true; if (obj is ItemTapCommandContext objTap && objTap.Item is ScrumFramework scrumFramework) { var param = new NavigationParameters(); param.Add(Helper.KEY_SCRUMFRAMEWORK_OBJECT, scrumFramework); await NavigationService.NavigateAsync(nameof(VBS_ScrumFrameworkDetailPage), param); } IsBusyBindProp = false; }
private void OpenVideoExecute() { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = Files.GetOpenFile(); if (openFileDialog.ShowDialog() == true) { //TODO:校验文件格式,并显示 // MessageBox.Show(openFileDialog.FileName); var parameters = new NavigationParameters(); parameters.Add("ImageFilePath", openFileDialog.FileName); _regionManager.RequestNavigate("ImageTabs", "ImageTab", parameters); } }
public MenuPageViewModel(INavigationService navigationService, IPageDialogService dialogService, IApiComicsVine apiComicsVine) : base(navigationService, dialogService, apiComicsVine) { ChangePageCommand = new DelegateCommand(async() => { marvelOrDc = marvelOrDc == ETypeApplication.Marvel? ETypeApplication.DC : ETypeApplication.Marvel; var param = new NavigationParameters(); param.Add($"{ConfigPageUri.NextPage}", marvelOrDc); await navigationService.NavigateAsync($"{ConfigPageUri.MenuPage}{ConfigPageUri.SharedTransitionNavigationPage}{ConfigPageUri.HomePage}", param); }); ItemPages = new List <ItemPage>() { new ItemPage("marvelhome", "Home", $"/HomePage"), new ItemPage("ic_action_live_tv.png", "Series", ConfigPageUri.SeriePage), new ItemPage("comic", "Volumes", ConfigPageUri.VolumePage), new ItemPage("MarvelCharacter", "Characters", ConfigPageUri.CharacterPage), new ItemPage("sword", "Vs", ConfigPageUri.VsPage) }; }
async void ExecuteVerEtapasMiCamino(string id) { Console.WriteLine("DEBUG - MisCaminosVM - ExecuteVerEtapasMiCamino id:{0}", id); var navigationParams = new NavigationParameters(); TablaMisCaminos tmc = await App.Database.GetMisCaminosAsync(int.Parse(id)); if (tmc == null) { Console.WriteLine("DEBUG3 - MisCaminosVM - ExecuteVerEtapasMiCamino NO HAY REGISTROS. retornamos"); Global.nombreFicheroDeMiCamino = null; return; } navigationParams.Add("tmc", tmc); await _navigationService.NavigateAsync("VerEtapas", navigationParams); }
private void NavigateToSelectedControl() { if (SelectedControl != null) { var navigationParams = new NavigationParameters(); navigationParams.Add( ControlPageViewModel.ControlInformationParameterName, SelectedControl); NavigationService.RequestNavigate( typeof(ControlPage), navigationParams); // Reset the selection, since we navigated away. // This is required, because the ListView couldn't be "Clicked" otherwise. SelectedControl = null; } }
public void Navigate(string Path, Dictionary <string, object> parms) { var Index = _navigationState.Navigate(parms); var prms = new NavigationParameters(); prms.Add(Index.ToString(), parms); var callback = new Action <NavigationResult>(nav => { var vws = nav.Context.NavigationService.Region.Views; var view = (FrameworkElement)vws.ElementAt(nav.Context.NavigationService.Region.Views.Count() - 1); if (view.DataContext is INavigationView) { ((INavigationView)view.DataContext).NavigationIndex = Index; } }); _regionManager.RequestNavigate("Main", Path, callback); }
public void Navigate_ToContentPage_PageHasIConfirmNavigation_False() { var navigationService = new PageNavigationServiceMock(_container); var rootPage = new ContentPageMock(); ((IPageAware)navigationService).Page = rootPage; Assert.False(rootPage.OnConfirmNavigationCalled); var navParams = new NavigationParameters(); navParams.Add("canNavigate", false); navigationService.Navigate("ContentPage", navParams); Assert.True(rootPage.OnConfirmNavigationCalled); Assert.True(rootPage.Navigation.ModalStack.Count == 0); }
/// <summary> /// Save pin in local DB /// </summary> private async void AddPin() { var newMapPin = new MapPin { Address = Address, Name = Name, Description = Description, Raiting = SelectedRaiting }; _realm.Write(() => _realm.Add(newMapPin)); NavigationParameters parameters = new NavigationParameters(); parameters.Add("AddedMapPin", newMapPin); await _navigationService.GoBackAsync(parameters); }
public ScanPageViewModel(INavigationService navigationService) { _navigationService = navigationService; ScanResultCommand = new DelegateCommand(async() => { Device.BeginInvokeOnMainThread(async() => { IsAnalyzing = false; IsScanning = false; var fooPara = new NavigationParameters(); fooPara.Add("Result", ScanResult); // 回到上頁,並且把掃描結果帶回去 await _navigationService.GoBackAsync(fooPara); }); }); }
async Task LoginUser() { if (string.IsNullOrEmpty(User.Username) || string.IsNullOrEmpty(User.Password)) { if (string.IsNullOrEmpty(User.Username) || string.IsNullOrEmpty(User.Password)) { await PageDialogService.DisplayAlertAsync("Error", "You must complete all required fields, to continue", "Ok"); } return; } NavigationParameters navParams = new NavigationParameters(); navParams.Add("UserInformation", User); await NavigationService.NavigateAsync("Test2Page", navParams); //await NavigationService.NavigateAsync(new Uri($"Test2Page?UserInformation={User}", UriKind.Relative)); }
private void ViewNavigate() { ClearViews(); if (Calc1Checked == true) { RM.RequestNavigate("General", "General"); } else if (Calc2Checked == true) { NavigationParameters param = new NavigationParameters(); param.Add("result", "000"); RM.RequestNavigate("General", "General"); RM.RequestNavigate("Scientific", "Scientific"); } }
public async Task OnVideoSelected(object val) { VideoItem item; if (val is VideoItem) { item = (VideoItem)val; } else { item = videoLibrary.SearchVideoItems(val as string).FirstOrDefault(); } var parameter = new NavigationParameters(); parameter.Add(NavigationParameterNames.Directory, item.FolderPath); await navigationService.NavigateAsync(PageNames.Videos, parameter, false); }
private void openVRFProject(int projectId) { Project importProj = CommonBLL.OpenVRFProject(projectId); Project currentProject = JCHVRF.Model.Project.GetProjectInstance; //if (currentProject != null && importProj.BrandCode != currentProject.BrandCode) //{ // JCHMessageBox.Show(Langauge.Current.GetMessage("ERROR_IMPORT_PROJECT_DIFFERENT_BRAND")); // return; //} //Project = importProj; JCHVRF.Model.Project.CurrentProject = importProj; NavigationParameters param = new NavigationParameters(); param.Add("Project", importProj); regionManager.RequestNavigate(RegionNames.ContentRegion, ViewKeys.Splash, param); }
private void ViewNavigate() { RM.Regions["General"].RemoveAll(); RM.Regions["Scientific"].RemoveAll(); if (Calc1Checked == true) { RM.RequestNavigate("General", "General"); } else if (Calc2Checked == true) { NavigationParameters parameters = new NavigationParameters(); parameters.Add("result", "0"); RM.RequestNavigate("General", "General"); RM.RequestNavigate("Scientific", "Scientific", parameters); } }
protected override async void OnInitialized() { InitializeComponent(); string usuario_logado = Preferences.Get("dentistaserializado", ""); App.usuariologado = JsonConvert.DeserializeObject <Models.Dentista>(usuario_logado); if (App.usuariologado == null) { await this.NavigationService.NavigateAsync("LoginPage"); } else { if (usuariologado.ImagePath.Equals("")) { usuariologado.ImagePath = "perfil"; } // var status = await ChecapermisaoService.checa_permissao( new Permissions.StorageWrite()); // var testa2 = await ChecapermisaoService.checa_permissao(new Permissions.LocationWhenInUse()); if (usuariologado.Id == 999999999) { usuariologado.tipo = "Administrador"; // $"{nameof(NavigationPage)}/{nameof(MainPage)}" var mainPage = $"{nameof(NavigationPage)}/{nameof(MainPage2)}"; await NavigationService.NavigateAsync(mainPage); // await this.NavigationService.NavigateAsync("/MasterPage/NavigationPage/DentistaPage"); } else { App.usuariologado.tipo = "Dentista"; var navigationParams = new NavigationParameters(); navigationParams.Add("paciente", App.usuariologado); var mainPage = $"{nameof(NavigationPage)}/{nameof(MainPage2)}"; await NavigationService.NavigateAsync(mainPage); } } // var mainPage = $"{nameof(NavigationPage)}/{nameof(MainPage2)}"; // await NavigationService.NavigateAsync(mainPage); }
public DetailPageViewModel(INavigationService navigationService) { _navigationService = navigationService; SaveCommand = new DelegateCommand(async() => { if (Action == "Add") { var child = MainHelper.FirebaseClient.Child("Invoices"); await child.PostAsync <Invoice>(new Invoice() { InvoiceNo = InvoiceSelected.InvoiceNo, Amount = InvoiceSelected.Amount, Date = InvoiceSelected.Date, Memo = InvoiceSelected.Memo, Title = InvoiceSelected.Title, }); } else { var child = MainHelper.FirebaseClient.Child("Invoices"); await child.Child(InvoiceSelected.Key).PutAsync(new Invoice() { InvoiceNo = InvoiceSelected.InvoiceNo, Amount = InvoiceSelected.Amount, Date = InvoiceSelected.Date, Memo = InvoiceSelected.Memo, Title = InvoiceSelected.Title, }); } var fooPara = new NavigationParameters(); fooPara.Add("NeedRefresh", ""); await _navigationService.GoBackAsync(fooPara); }); DeleteCommand = new DelegateCommand(async() => { var child = MainHelper.FirebaseClient.Child("Invoices"); await child.Child(InvoiceSelected.Key).DeleteAsync(); var fooPara = new NavigationParameters(); fooPara.Add("NeedRefresh", ""); await _navigationService.GoBackAsync(fooPara); }); }
private async void OnNavToMainPage() { bool flag = false; await Task.Run(async() => { try { string Querey = $"SELECT PASSWORD FROM USERS WHERE USERNAME = '******'"; Debug.WriteLine($"**** {Querey}"); List <string> Result = DependencyService.Get <IDbDataFetcher>().GetData(Querey); if (Result.Count() == 0) { ResultText = "Username Not Found"; } else if (Result[0] == userPass) { ResultText = "LOGIN SUCCESFULL"; flag = true; } else { ResultText = "INCORRECT PASSWORD"; } } catch (System.OperationCanceledException ex) { Debug.WriteLine($"Text load cancelled: {ex.Message}"); } catch (Exception ex) { Debug.WriteLine(ex.Message); } }); if (flag == true) { NavigationParameters navParams = new NavigationParameters(); navParams.Add(Constants.Constants.USER_KEY, userC); await _navigationService.NavigateAsync("MainPage", navParams); } }
public void CargarSolicitudPrincipalPage() { var navigationParams = new NavigationParameters(); navigationParams.Add("_nombreCliente", NombreCliente); navigationParams.Add("_ccCliente", CcCliente); navigationParams.Add("_estado", Estado); navigationParams.Add("_nombreAsesor", NombreAsesor); navigationParams.Add("_cupoCredito", CupoCredito); navigationParams.Add("_montoDisponible", MontoDisponible); _navigationService.NavigateAsync("SolicitudesPrincipal", navigationParams); PopupNavigation.PopAsync(); }
private async void EditClick(ProfileModel model) { var parametеrs = new NavigationParameters(); parametеrs.Add(nameof(model.ProfileImage), model.ProfileImage); parametеrs.Add(nameof(model.NickNameLabel), model.NickNameLabel); parametеrs.Add(nameof(model.NameLabel), model.NameLabel); parametеrs.Add(nameof(model.Description), model.Description); parametеrs.Add(nameof(model.Id), model.Id); parametеrs.Add(nameof(model.DateLabel), model.DateLabel); await NavigationService.NavigateAsync("AddEditProfilePage", parametеrs); }
private async void NavigateToOrderPage(string obj) { IsPageEnabled = true; if (obj.Equals(AppResources.ResourceManager.GetString("btnupdateContent", AppResources.Culture))) { await UpdatePatientInfo(); } else { IsPageEnabled = true; if (!Library.KEY_PATIENT_IS_VEG.ToLower().Equals(SelectedPatient.isveg.ToLower()) || !Library.KEY_PATIENT_IS_HALAL.ToLower().Equals(SelectedPatient.ishalal.ToLower())) { var response = await PageDialog.DisplayAlertAsync("Meal Prefrence Changed!", "Do you want to Change the (Veg/Nonveg)/(Halal/Non-Halal) Status.", "Yes", "No"); if (response) { Library.KEY_PATIENT_IS_VEG = SelectedPatient.isveg; Library.KEY_PATIENT_IS_HALAL = SelectedPatient.ishalal; } else { IsPageEnabled = false; return; } } var navParam = new NavigationParameters(); //navParam.Add("Patient", SelectedPatient); Library.patient = SelectedPatient; Library.others = OthersRadio.Where(x => x.IsChecked).FirstOrDefault(); navParam.Add("Cuisineslist", Cuisines); navParam.Add("Allergies", Allergies.Where(x => x.IsChecked).ToList()); navParam.Add("Ingredients", Ingredients.Where(x => x.IsChecked).ToList()); navParam.Add("Therapeutics", Therapeutics.Where(x => x.IsChecked).ToList()); navParam.Add("Cuisines", Cuisines.Where(x => x.IsChecked).ToList()); navParam.Add("Other", OthersRadio.Where(x => x.IsChecked).FirstOrDefault()); navParam.Add("Othercheckbox", OthersChecBox.Where(x => x.IsChecked).ToList()); await NavigationService.NavigateAsync("MealOrderPage", navParam); IsPageEnabled = false; } }
private async Task UpdateExpenseControl() { bool confirm = await ShowDialog("Atualizar", "Confirmar edição?"); if (confirm) { var parameter = new NavigationParameters(); if (UpdateExpenseControl(_selectedDate, _value)) { parameter.Add("message", "Controle de gasto atualizado com sucesso!"); await GoBack(parameter); } else { Toast("Falha durante a atualização do controle de gasto!"); } } }
private async Task RegisterNewExpenseControl() { bool confirm = await ShowDialog("Salvar", "Confirmar cadastro?"); if (confirm) { var parameter = new NavigationParameters(); if (AddExpenseControl(_selectedDate, _value)) { parameter.Add("message", "Novo controle de gasto cadastrado com sucesso!"); await GoBack(parameter); } else { Toast("Falha durante o cadastro do controle de gasto!"); } } }
public override FrameworkElement CreateActivityDialog(FrameworkElement container, XamScheduleDataManager dataManager, ActivityBase activity, bool allowModifications, bool allowRemove) { string view = "AppointmentView"; if (activity.DataItem != null) { if (activity.Metadata["IsMeetingRequest"] != null && (bool)activity.Metadata["IsMeetingRequest"] == true) { view = "MeetingView"; } } else { if (IsAppointmentMeetingRequest) { activity.Metadata["IsMeetingRequest"] = true; view = "MeetingView"; } } IsAppointmentMeetingRequest = false; NavigationParameters parameters = new NavigationParameters(); parameters.Add(Parameters.ActivityIdKey, activity.Id ?? "1"); switch (activity.ActivityType) { case ActivityType.Appointment: { var evn = EventAggragator.GetEvent <ActivityChangedEvent>(); DialogService.ShowDialog(view, parameters); evn.Publish(activity); return(DialogService.GetDialogInstance()); } default: { return(null); } } }
public Page2PageViewModel(INavigationService navigationService) : base(navigationService) { TitlePage = "Page2"; SendCommandClick = new DelegateCommand(async delegate { //Set parameters to Send var navParameters = new NavigationParameters(); navParameters.Add("name", Name); //Navigate back to Page1Page var result = await NavigationService.GoBackAsync(navParameters); }, delegate { return(ButtonIsEnable == true ? true : false); }).ObservesProperty(() => ButtonIsEnable); }
public LoginPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService) : base(navigationService, pageDialogService) { ApiService = new ApiService(); LoginCommand = new DelegateCommand(async() => { IsBusy = true; CurrentConnection = Connectivity.NetworkAccess; if (CurrentConnection.Equals(NetworkAccess.Internet)) { if (String.IsNullOrEmpty(Username) || String.IsNullOrEmpty(Password)) { await DialogService.DisplayAlertAsync("Fields can not be empty! Try again!", null, "Ok"); } else { if (Username.Equals(MyUserCredential) && Password.Equals(MyPasswordCredential)) { Contacts = await ApiService.GetRandomContacts(); //Contacts = new Contact(); var ContactsParameters = new NavigationParameters(); ContactsParameters.Add("AllContacts", Contacts); await DialogService.DisplayAlertAsync($"Welcome '{Username.ToUpper()}' to \nYourContacts App!", null, "Ok"); await NavigationService.NavigateAsync(new Uri($"/{Constants.Navigation}/{Constants.TabbedPage}?selectedTab={Constants.Contact}", UriKind.Absolute), ContactsParameters); } else { await DialogService.DisplayAlertAsync("Invalid Login Credentials! Try again!", null, "Ok"); } } } else { await DialogService.DisplayAlertAsync("Check your internet Connection and Try Again!", null, "Ok"); } IsBusy = false; }); }
public void WhenCreatingANewContextForAUriWithAQueryAndNavigationParameters_NoDuplicateParametersAreCreated() { var uri = new Uri("test?name=value", UriKind.Relative); var navParameters = new NavigationParameters(); navParameters.Add("name", "value"); var navigationJournalMock = new Mock<IRegionNavigationJournal>(); var navigationServiceMock = new Mock<IRegionNavigationService>(); IRegion region = new Region(); navigationServiceMock.SetupGet(n => n.Region).Returns(region); navigationServiceMock.SetupGet(x => x.Journal).Returns(navigationJournalMock.Object); var context = new NavigationContext(navigationServiceMock.Object, uri, navParameters); Assert.AreEqual(uri, context.Uri); Assert.AreEqual(1, context.Parameters.Count()); Assert.AreEqual("value", context.Parameters["name"]); }
public void Navigate_ToContentPage_PageHasIConfirmNavigation_False() { var navigationService = new PageNavigationServiceMock(_container); var rootPage = new ContentPageMock(); ((IPageAware)navigationService).Page = rootPage; Assert.False(rootPage.OnConfirmNavigationCalled); var navParams = new NavigationParameters(); navParams.Add("canNavigate", false); navigationService.Navigate("ContentPage", navParams); Assert.True(rootPage.OnConfirmNavigationCalled); Assert.True(rootPage.Navigation.ModalStack.Count == 0); }
public void Navigate_ToContentPage_ByName_WithNavigationParameters() { var navigationService = new PageNavigationServiceMock(_container); var rootPage = new Xamarin.Forms.Page(); ((IPageAware)navigationService).Page = rootPage; var navParameters = new NavigationParameters(); navParameters.Add("id", 3); navigationService.Navigate("ContentPage", navParameters); Assert.True(rootPage.Navigation.ModalStack.Count == 1); Assert.IsType(typeof(ContentPageMock), rootPage.Navigation.ModalStack[0]); var viewModel = rootPage.Navigation.ModalStack[0].BindingContext as ContentPageMockViewModel; Assert.NotNull(viewModel); Assert.NotNull(viewModel.NavigatedToParameters); Assert.True(viewModel.NavigatedToParameters.Count > 0); Assert.Equal(3, viewModel.NavigatedToParameters["id"]); }
public void Navigate_ToContentPage_ViewModelHasIConfirmNavigation_False() { var navigationService = new PageNavigationServiceMock(_container); var rootPage = new Page() { BindingContext = new ContentPageMockViewModel() }; ((IPageAware)navigationService).Page = rootPage; var viewModel = rootPage.BindingContext as ContentPageMockViewModel; Assert.False(viewModel.OnConfirmNavigationCalled); var navParams = new NavigationParameters(); navParams.Add("canNavigate", false); navigationService.Navigate("ContentPage", navParams); Assert.True(viewModel.OnConfirmNavigationCalled); Assert.True(rootPage.Navigation.ModalStack.Count == 0); }
private void ShowCustomersDetails(bool isNew) { NavigationParameters navigationParameters = new NavigationParameters(); if (isNew == true) navigationParameters.Add("StatusCustomer", "NewCustomer"); else { if (_currentCustomer != null) navigationParameters.Add("CurrentCustomer", _currentCustomer); navigationParameters.Add("StatusCustomer", "EditCustomer"); } //_regionManager.RequestNavigate(RegionNames.MainRegion, ViewNames.CustomerDetailsView, navigationParameters); _regionManager.RequestNavigate(RegionNames.MainRegion, ViewNames.CustomerCardView, navigationParameters); //_regionManager.RequestNavigate(RegionNames.MainRegion,new Uri(ViewNames.CustomerDetailsView, UriKind.Relative), navigationParameters); }
private void EditDish() { var dishes = GetCurrentViewModel() as DishesViewModel; if (dishes?.SelectedDish != null) { Uri viewNav = new Uri(AddDish, UriKind.Relative); var parameters = new NavigationParameters(); parameters.Add("Id", dishes.SelectedDish.Id); RegionManager.RequestNavigate(RegionNames.WorkspaceRegion, viewNav, result => { }, parameters); UpdateVisibilities(AddDish); } }
private void NavigateToCommits(IRepoModel repo) { var parameters = new NavigationParameters(); parameters.Add("repo", repo); parameters.Add("user", User); _navigationService.Navigate<CommitsPageViewModel>(parameters); }
public static NavigationParameters MakeNavigationParamWithTargetFiles(string[] paths) { var param = new NavigationParameters(); param.Add("targetfiles", paths); return param; }
/// <summary> /// インスタントアクションが記録されたファイルを元にインスタントアクションページのナビゲーションパラメータを作成します。 /// </summary> /// <param name="paths"></param> /// <returns></returns> public static NavigationParameters MakeNavigationParamWithFilePath(string filePath) { var param = new NavigationParameters(); param.Add("filepath", filePath); return param; }
private void NavigateModal() { NavigationParameters parameters = new NavigationParameters(); parameters.Add("key1", "value1"); _navigationService.Navigate("PrismContentPage1", parameters, true); }
private void Pop() { NavigationParameters parameters = new NavigationParameters(); parameters.Add("key2", "value2"); _navigationService.GoBack(parameters, true); }
private void OnItemChosen(int id, ChosenItemType itemType) { var navPath = Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(itemType.ToString().ToLower()) + "View"; var navParameters = new NavigationParameters(); navParameters.Add("id", id); navParameters.Add("itemType", itemType); regionManager.RequestNavigate(RegionNames.ContentTabsRegion, navPath, navParameters); }
public static NavigationParameters CreateOpenReactionParameter(Guid reactionGuid) { var parameters = new NavigationParameters(); parameters.Add("guid", reactionGuid); return parameters; }
public static NavigationParameters CreateOpenReactionParameter(string filePath) { var parameters = new NavigationParameters(); parameters.Add("filepath", filePath); return parameters; }