当前位置: 首页>>代码示例>>C#>>正文


C# INavigation.PopAsync方法代码示例

本文整理汇总了C#中INavigation.PopAsync方法的典型用法代码示例。如果您正苦于以下问题:C# INavigation.PopAsync方法的具体用法?C# INavigation.PopAsync怎么用?C# INavigation.PopAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在INavigation的用法示例。


在下文中一共展示了INavigation.PopAsync方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FundsTransferViewModel

		public FundsTransferViewModel (INavigation navigation, Page currentPage)
		{
			Navigation = navigation;
			CancelCommand = new Command(async () => await Navigation.PopAsync());
			TransferCommand = new Command(async () => await currentPage.DisplayAlert("Transfer", "Success", "Ok"));

		}
开发者ID:nishanil,项目名称:MobileBanking-Forms,代码行数:7,代码来源:FundsTransferViewModel.cs

示例2: NewUserViewModel

 public NewUserViewModel(INavigation nav)
 {
     SendEmail = new Command (async () => {
         if(String.IsNullOrEmpty(Email)) return;
         //send email
         await nav.PopAsync();
     });
 }
开发者ID:BlackhoefStudios,项目名称:DropIt,代码行数:8,代码来源:NewUserViewModel.cs

示例3: ContentPageXaml

        public ContentPageXaml(Document selecteDocument, string parentName,INavigation navigation)
        {
            InitializeComponent();
            try
            {
                if (Device.OS == TargetPlatform.iOS)
                {
                    // move layout under the status bar
				   this.pageButton.HeightRequest = 30;
				   this.pageButton.BackgroundColor = Color.Gray;
                   this.Padding = new Thickness(0, Device.OnPlatform(20,0,0), 0, 0);
                }

                (Application.Current.MainPage as MasterDetailPage).IsGestureEnabled = false;
                
                _navigation = navigation;
                NavigationPage.SetHasNavigationBar(this,false);
                BindingContext = new ViewModels.TransformImageViewModel(selecteDocument);

                this.backButton.Clicked += async(sender, e) =>
                {
                    (Application.Current.MainPage as MasterDetailPage).IsGestureEnabled = true;
                    _navigation.PopAsync();
                };

				this.pageButton.Clicked+= async(sender, e) =>
				{
				    var str = new List<string>();
					for (int i = 1; i <= ViewModel.TotalPage; i++)
				    {
						str.Add("Page " + i.ToString());
				    }

					var action = await DisplayActionSheet ("Go To Page", "Cancel", null, str.ToArray());
					
					if(action != null)
					{
						if(action.ToUpper().Contains("PAGE"))
						{
							int page = Convert.ToInt32(action.ToUpper().Replace("PAGE ",""));
							if(ViewModel.CurrentPage != page)
							{
								ViewModel.CurrentPage = page;
								ViewModel.CurrentPickerPage = ViewModel.CurrentPage.ToString();
							    ViewModel.ImageSource = null;
								Task.Run(() => ViewModel.RefreshImage(page, ViewModel.FolderName, "", false));
							}
						}
					}
				};

            }
            catch (Exception ex)
            {
               DisplayAlert("Error", "An exception occurred.", "OK");
            }
        }
开发者ID:Aranjedeath,项目名称:SpecimenCode,代码行数:57,代码来源:ContentPageXaml.xaml.cs

示例4: NavigateToSample

		public async Task NavigateToSample(INavigation navigation){
			SampleCoordinator.RaiseSampleSelected (this);

			if (_justNotifyNavigateIntent) {
				return;
			}
				
			if (_customNavigation != null) {
				_customNavigation (navigation);
				return;
			}

			int popCount = 0;
			int firstPageToPopIndex = 0;

			for (int i = navigation.NavigationStack.Count - 1; i >= 0; i--) {
				if (navigation.NavigationStack [i].GetType () == _pageType) {
					firstPageToPopIndex = i + 1;
					popCount = navigation.NavigationStack.Count - 1 - i;
					break;
				}
			}

			if (popCount > 0) {
				for (int i = 1; i < popCount; i++) {
					navigation.RemovePage(navigation.NavigationStack[firstPageToPopIndex]);
				}
					
				await navigation.PopAsync ();

				return;
			}

			var page = CreateContentPage ();

			if (_modal) {
				await navigation.PushModalAsync (new NavigationPage(page));
			} else {
				await navigation.PushAsync (page);
			}
		}
开发者ID:ahdproduction,项目名称:ConnectPeople,代码行数:41,代码来源:Sample.cs

示例5: AddMonkeyPageViewModel

        public AddMonkeyPageViewModel(INavigation navigation)
        {
            Photo = DefaultPhoto;
            var dataManager = App.MonkeyDataManager;

            PickPhotoCommand = new Command(async () => {
                image = await Plugin.Media.CrossMedia.Current.PickPhotoAsync();
                if(image!=null)
                Photo = ImageSource.FromFile(image.Path);
            });

            UploadPhotoCommand = new Command(async ()=> {

                if (!string.IsNullOrEmpty(Status) && image != null)
                {
                    var monkey = new Models.Monkey { Status = this.Status, UserName= App.UserName };
                    await dataManager.SaveMonkeyAsync(monkey);
                    await dataManager.AddImage(monkey, image.Path);
                    if (navigation != null)
                       await navigation.PopAsync();
                }
                
            });
        }
开发者ID:phaufe,项目名称:AzureFileSync,代码行数:24,代码来源:AddMonkeyPageViewModel.cs

示例6: DoPop

 protected static Task<Page> DoPop(INavigation navigation, bool useModalNavigation, bool animated)
 {
     if (useModalNavigation)
         return navigation.PopModalAsync(animated);
     else
         return navigation.PopAsync(animated);
 }
开发者ID:ethedy,项目名称:Prism,代码行数:7,代码来源:PageNavigationService.cs


注:本文中的INavigation.PopAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。