本文整理汇总了C#中System.Platform.SetPage方法的典型用法代码示例。如果您正苦于以下问题:C# Platform.SetPage方法的具体用法?C# Platform.SetPage怎么用?C# Platform.SetPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Platform
的用法示例。
在下文中一共展示了Platform.SetPage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadApplication
protected void LoadApplication(Application application)
{
if (application == null)
throw new ArgumentNullException("application");
Application.Current = application;
Platform = CreatePlatform();
Platform.SetPage(Application.Current.MainPage);
application.PropertyChanged += OnApplicationPropertyChanged;
Application.Current.SendStart();
}
示例2: InternalSetPage
void InternalSetPage(Page page)
{
if (!Forms.IsInitialized)
throw new InvalidOperationException("Call Forms.Init (Activity, Bundle) before this");
if (_canvas != null)
{
_canvas.SetPage(page);
return;
}
var busyCount = 0;
MessagingCenter.Subscribe(this, Page.BusySetSignalName, (Page sender, bool enabled) =>
{
busyCount = Math.Max(0, enabled ? busyCount + 1 : busyCount - 1);
if (!Forms.SupportsProgress)
return;
SetProgressBarIndeterminate(true);
UpdateProgressBarVisibility(busyCount > 0);
});
UpdateProgressBarVisibility(busyCount > 0);
MessagingCenter.Subscribe(this, Page.AlertSignalName, (Page sender, AlertArguments arguments) =>
{
AlertDialog alert = new AlertDialog.Builder(this).Create();
alert.SetTitle(arguments.Title);
alert.SetMessage(arguments.Message);
if (arguments.Accept != null)
alert.SetButton((int)DialogButtonType.Positive, arguments.Accept, (o, args) => arguments.SetResult(true));
alert.SetButton((int)DialogButtonType.Negative, arguments.Cancel, (o, args) => arguments.SetResult(false));
alert.CancelEvent += (o, args) => { arguments.SetResult(false); };
alert.Show();
});
MessagingCenter.Subscribe(this, Page.ActionSheetSignalName, (Page sender, ActionSheetArguments arguments) =>
{
var builder = new AlertDialog.Builder(this);
builder.SetTitle(arguments.Title);
string[] items = arguments.Buttons.ToArray();
builder.SetItems(items, (sender2, args) => { arguments.Result.TrySetResult(items[args.Which]); });
if (arguments.Cancel != null)
builder.SetPositiveButton(arguments.Cancel, delegate { arguments.Result.TrySetResult(arguments.Cancel); });
if (arguments.Destruction != null)
builder.SetNegativeButton(arguments.Destruction, delegate { arguments.Result.TrySetResult(arguments.Destruction); });
AlertDialog dialog = builder.Create();
builder.Dispose();
//to match current functionality of renderer we set cancelable on outside
//and return null
dialog.SetCanceledOnTouchOutside(true);
dialog.CancelEvent += (sender3, e) => { arguments.SetResult(null); };
dialog.Show();
});
_canvas = new Platform(this);
if (_application != null)
_application.Platform = _canvas;
_canvas.SetPage(page);
_layout.AddView(_canvas.GetViewGroup());
}