Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
150719 | Jan 17,2020 02:35 AM UTC | Mar 16,2020 01:38 PM UTC | Xamarin.Forms | 24 |
![]() |
Tags: SfPopup |
protected void ShowBusy(bool show) { DataTemplate contentTemplateView = new DataTemplate(() => { StackLayout stack = new StackLayout(); _busyIndicator = new SfBusyIndicator(); _busyIndicator.ViewBoxHeight = 100; _busyIndicator.ViewBoxWidth = 100; _busyIndicator.IsBusy = true; stack.Children.Add(_busyIndicator); return stack; }); _popupLayout.PopupView.HeaderTitle = string.Empty; _popupLayout.PopupView.ContentTemplate = contentTemplateView; _popupLayout.PopupView.ShowHeader = false; _popupLayout.PopupView.PopupStyle.BorderColor = Color.Transparent; _popupLayout.PopupView.ShowFooter = false; _popupLayout.PopupView.ShowCloseButton = false; _popupLayout.PopupView.AutoSizeMode = AutoSizeMode.Height; _popupLayout.PopupView.BackgroundColor = Color.Transparent; _popupLayout.IsOpen = show; }
//If you start here, and then click the Button to Page B this works await NavigationService.NavigateAsync("NavigationPage/MainPage"); //If you start here, you will see a failure //await NavigationService.NavigateAsync("NavigationPage/PageB");
….. protected async void ShowBusy(bool show) {
…..
await Task.Delay(200); _popupLayout.IsOpen = show; } … |
<controls:BusyIndicator xIsBusy="True" />
public BusyIndicator() { InitializeComponent(); ctrlPopupLayout.SetBinding(SfPopupLayout.IsOpenProperty, new Binding("xIsBusy", source: this)); // I cant access ctrlBusyIndicator here: ctrlBusyIndicator.SetBinding(SfBusyIndicator.IsBusyProperty, new Binding("xIsBusy", source: this)); }
|
|
private async void ShowDialog() { ShowBusy = true; await Task.Delay(2000); ShowBusy = false; _dialogService.ShowDialog("BusyDialog", new DialogParameters() { { "message", "from main view model" } }); }
private async void ShowDialog()
{
ShowBusy = true;
await Task.Delay(2000);
ShowBusy = false;
await Task.Delay(200);
_dialogService.ShowDialog("BusyDialog", new DialogParameters() { { "message", "from main view model" } });
}
|
<popuplayout:SfPopupLayout.PopupView>
<popuplayout:PopupView
BackgroundColor="Transparent"
ShowCloseButton="False"
ShowFooter="False"
ShowHeader="False"
AnimationDuration="0">
<popuplayout:PopupView.PopupStyle>
<popuplayout:PopupStyle BorderColor="Transparent"/>
</popuplayout:PopupView.PopupStyle>
<popuplayout:PopupView.ContentTemplate>
<DataTemplate>
<xForms:SfBusyIndicator
x:Name="ctrlBusyIndicator"
AnimationType="Ball"
IsBusy="True"
ViewBoxHeight="125"
ViewBoxWidth="125" />
</DataTemplate>
</popuplayout:PopupView.ContentTemplate>
</popuplayout:PopupView>
</popuplayout:SfPopupLayout.PopupView>
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.