void OnBusySetRequest(Page sender, bool enabled) { // Verify that the page making the request is child of this platform if (!_platform.PageIsChildOfPlatform(sender)) { return; } if (null == _pageBusyDialog) { _pageBusyDialog = new Native.Dialog(System.Maui.Maui.NativeParent) { Orientation = PopupOrientation.Center, BackgroundColor = EColor.Transparent }; if (Device.Idiom == TargetIdiom.Phone) { _pageBusyDialog.SetPartColor("bg_title", EColor.Transparent); _pageBusyDialog.SetPartColor("bg_content", EColor.Transparent); } else if (Device.Idiom == TargetIdiom.Watch) { _pageBusyDialog.Style = "circle"; } var activity = new EProgressBar(_pageBusyDialog) { Style = "process_large", IsPulseMode = true, }; activity.PlayPulse(); activity.Show(); _pageBusyDialog.Content = activity; } _pageBusyCount = Math.Max(0, enabled ? _pageBusyCount + 1 : _pageBusyCount - 1); if (_pageBusyCount > 0) { _pageBusyDialog.Show(); } else { _pageBusyDialog.Dismiss(); _pageBusyDialog = null; } }
void OnBusySetRequest(Page sender, bool enabled) { // Verify that the page making the request is child of this platform if (!_platform.PageIsChildOfPlatform(sender)) { return; } if (null == _pageBusyDialog) { _pageBusyDialog = new Native.Dialog(Forms.NativeParent) { Orientation = PopupOrientation.Center, BackgroundColor = EColor.Transparent }; if (DeviceInfo.Idiom == DeviceIdiom.Phone) { _pageBusyDialog.SetTitleBackgroundColor(EColor.Transparent); _pageBusyDialog.SetContentBackgroundColor(EColor.Transparent); } else if (DeviceInfo.Idiom == DeviceIdiom.Watch) { _pageBusyDialog.SetWatchCircleStyle(); } var activity = new EProgressBar(_pageBusyDialog) { IsPulseMode = true }.SetLargeStyle(); activity.PlayPulse(); activity.Show(); _pageBusyDialog.Content = activity; } _pageBusyCount = Math.Max(0, enabled ? _pageBusyCount + 1 : _pageBusyCount - 1); if (_pageBusyCount > 0) { _pageBusyDialog.Show(); } else { _pageBusyDialog.Dismiss(); _pageBusyDialog = null; } }