本文整理汇总了C#中Xamarin.Forms.Page类的典型用法代码示例。如果您正苦于以下问题:C# Page类的具体用法?C# Page怎么用?C# Page使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Page类属于Xamarin.Forms命名空间,在下文中一共展示了Page类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupTabbedPage
void SetupTabbedPage()
{
_tabbedNavigationPage = new FreshTabbedNavigationContainer ();
_contactsPage = _tabbedNavigationPage.AddTab<ContactListPageModel> ("Contacts", "contacts.png");
_quotesPage = _tabbedNavigationPage.AddTab<QuoteListPageModel> ("Quotes", "document.png");
this.Detail = _tabbedNavigationPage;
}
示例2: NavigationEventArgs
public NavigationEventArgs(Page page)
{
if (page == null)
throw new ArgumentNullException("page");
Page = page;
}
示例3: CreateContainerPage
protected virtual Page CreateContainerPage (Page page)
{
if (page is NavigationPage || page is MasterDetailPage || page is TabbedPage)
return page;
return new NavigationPage (page);
}
示例4: Show
public void Show(Page page, PopupArguments args)
{
args.Popup.Parent = page;
var container = new PopupDialogContainer(args);
container.Show();
}
示例5: CustomerDetailViewModel
public CustomerDetailViewModel(Account account, Page currentPage)
{
if (account == null)
{
Account = new Account();
Account.Industry = Account.IndustryTypes[0];
Account.OpportunityStage = Account.OpportunityStages[0];
this.Title = "New Account";
}
else
{
Account = account;
this.Title = "Account";
}
_CurrentPage = currentPage;
this.Icon = "account.png";
_DataClient = DependencyService.Get<IDataService>();
_GeoCodingService = DependencyService.Get<IGeoCodingService>();
MessagingCenter.Subscribe<Account>(this, MessagingServiceConstants.ACCOUNT, (Account) =>
{
IsInitialized = false;
});
}
示例6: App
public App()
{
//var resolverContainer = new SimpleContainer();
//resolverContainer.Register<IMediaPicker>(new MediaPicker());
MainPage = homeView ?? (homeView = new LoginPageView());
}
示例7: parseFile
private async void parseFile(Page arg1, string bglPath)
{
await ParseTheBGL(bglPath);
}
示例8: _configureAlerts
void _configureAlerts(Page rootPage)
{
if (AlertHandler == null)
{
AlertHandler = new FormsAlertHandler(rootPage);
}
}
示例9: MailMainModel
public MailMainModel(Page page) : base(page)
{
Messages = new ObservableCollection<MailViewCellModel>();
var accountMan = new AccountManager.AccountManager();
var account = accountMan.LoadAccount().Result;
var json = LacunaExpanseAPIWrapper.Inbox.ViewInbox(account.SessionID);
var apiService = new ApiService(account.Server);
var service = new RefitApiService(apiService);
var result = service.InboxAsync(Priority.Background, json).Result;//.ConfigureAwait (false);
if (result != null)
{
foreach(var m in result.result.messages)
{
var model = new MailViewCellModel
{
BodyPreview = m.body_preview,
From = m.from,
MessageID = m.id,
Subject = m.subject
};
Messages.Add(model);
}
}
else
{
}
}
示例10: typeof
/*
private static readonly BindableProperty SetPopoverHiddenProperty = BindableProperty.Create("SetPopoverHidden", typeof(bool), typeof(PopoverPage), false);
private bool SetPopoverHidden
{
get { return (bool)GetValue(SetPopoverHiddenProperty); }
set { SetValue(SetPopoverHiddenProperty, value); }
}
*/
public void Show(Page parentPage, Point point)
{
ParentPage = parentPage;
ShowFromPoint = point;
this.SetPopoverVisible = !this.SetPopoverVisible;
}
示例11: ShowAsync
/// <summary>
///
/// Initial stack:
/// <EmptyPage>
///
/// Home page stack:
/// <HomePage>
///
/// Second page stack:
/// <HomePage> <--> <BackPage> <--> <SecondPage>
///
/// Third page stack:
/// <HomePage> <--> <BackPage> <--> <ThirdPage>
///
/// </summary>
/// <remarks>
/// HomePage is kept in stack, since exception is thrown (at least on WP8)
/// when trying to push that page again even after being removed from stack.
///
/// BackPage is inserted before every page navigated to in order to be able
/// to detect back navigation from software back button in Android and iOS.
/// </remarks>
/// <param name="nextPage">The page to navigate to.</param>
/// <returns>A task representing the asynchronous show operation.</returns>
internal async Task ShowAsync(Page nextPage)
{
var firstPage = Navigation.NavigationStack.First();
var secondPage = Navigation.NavigationStack.LastOrDefault();
// Here we handle initial navigation when EmptyPage is to be displayed.
if ((Navigation.NavigationStack.Count == 1) && (firstPage == s_emptyPage))
{
// HomePage instance is normally set, but might not on
// app resume when at the end of the navigation stack.
if (_navigationManager.NavigationStack.CurrentPage.PageName == SpecialPageNames.Home)
{
_homePage = nextPage;
}
await Navigation.PushAsync(nextPage);
// Make sure BackPage is inserted before last page if we should be able
// to navigate back, in order for software back button to be displayed.
if (_navigationManager.NavigationStack.CanGoBack && (firstPage != s_backPage))
{
Navigation.InsertPageBefore(s_backPage, CurrentPage);
}
// Remove first dummy page (EmpptyPage).
Navigation.RemovePage(firstPage);
return;
}
if ((nextPage == _homePage) && !_navigationManager.NavigationStack.CanGoBack)
{
await Navigation.PopAsync();
return;
}
else
{
await Navigation.PushAsync(nextPage);
}
// Make sure BackPage is inserted before last page if we should be able
// to navigate back, in order for software back button to be displayed.
if (_navigationManager.NavigationStack.CanGoBack && (!Navigation.NavigationStack.Contains(s_backPage)))
{
Navigation.InsertPageBefore(s_backPage, CurrentPage);
}
// HomePage is kept in stack, since exception is thrown (at least on WP8) when trying
// to push that page again (upon back navigation) even after being removed from stack.
if ((secondPage != null) && (secondPage != s_backPage) && (secondPage != _homePage))
{
Navigation.RemovePage(secondPage);
}
// If navigation stack is empty, remove first page if it is a back
// page, in order for next back navigation to exit application.
if (!_navigationManager.NavigationStack.CanGoBack && (firstPage == s_backPage))
{
Navigation.RemovePage(s_backPage);
}
}
示例12: PushView
public void PushView(BasePageModel viewModelToPush, Page pageToPush, bool model)
{
if (model)
this.CurrentPage.Navigation.PushModalAsync (pageToPush);
else
this.CurrentPage.Navigation.PushAsync (pageToPush);
}
示例13: OnElementChanged
protected override void OnElementChanged(ElementChangedEventArgs<Image> e)
{
base.OnElementChanged(e);
if (e.OldElement == null)
{
if (GetContainingViewCell(e.NewElement) != null)
{
page = GetContainingPage(e.NewElement);
if (page.Parent is TabbedPage)
{
page.Disappearing += PageContainedInTabbedPageDisapearing;
return;
}
navigPage = GetContainingNavigationPage(page);
if (navigPage != null)
{
navigPage.Popped += OnPagePopped;
if (page is BaseContentPage)
(page as BaseContentPage).Disposing += OnPageDisposed;
}
}
else if ((page = GetContainingTabbedPage(e.NewElement)) != null)
{
page.Disappearing += PageContainedInTabbedPageDisapearing;
}
}
}
示例14: OrderDetailViewModel
public OrderDetailViewModel(Page page)
: base(page)
{
Title = title;
OrderDetail = new ObservableCollection<OrderDetails>();
}
示例15: IniciarSesion
private async void IniciarSesion()
{
var page = new Page();
try
{
IsBusy = true;
var us = await _servicio.ValidarUsuario(_login);
if (us != null)
{
await _navigator.PopToRootAsync();
await _navigator.PushAsync<ContactosViewModel>(viewModel =>
{
Titulo = "Inicio de sesión";
});
}
else
{
var xx = ""; //para comprobar que se haga bien.
}
//TODO: aquí navegaríamos a la pantalla principal o daríamos error
await page.DisplayAlert(Strings.Error, Strings.UserDoesNotExist, Strings.Ok);
}
catch (Exception e)
{
await page.DisplayAlert(Strings.Error, e.Message, Strings.Ok);
}
finally
{
IsBusy = false;
}
}