This is a migrated thread and some comments may be shown as answers.

Multiple Popups per Page

1 Answer 448 Views
Popup
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 2
Veteran
Chris asked on 08 Apr 2021, 06:11 AM

Is it possible to have more than one RadPopup on a page? When I try to add a second popup I get an "The property 'Popup' is set more than once." error when trying to build.

 

telerikPrimitives:RadPopup.Popup

 

<!-- Loading Overlay -->
<telerikPrimitives:RadPopup.Popup>
    <telerikPrimitives:RadPopup x:Name="loadingPopup" IsOpen="{Binding IsBusy}" IsModal="True" OutsideBackgroundColor="#6FFFFFFF" Placement="Center">
        <StackLayout HorizontalOptions="Center" VerticalOptions="Center">
            <ActivityIndicator IsRunning="true" />
        </StackLayout>
    </telerikPrimitives:RadPopup>
</telerikPrimitives:RadPopup.Popup>
 
<!-- New Log Entry Overlay -->
<telerikPrimitives:RadPopup.Popup>
    <telerikPrimitives:RadPopup x:Name="newLogEntryPopup" IsOpen="{Binding ShowNewLogEntryPopup}" IsModal="True" OutsideBackgroundColor="#6FFFFFFF" Placement="Center">
        <StackLayout HorizontalOptions="Center" VerticalOptions="Center">
            <Frame BackgroundColor="White" HasShadow="True">
                <Label TextColor="{StaticResource NavigationPrimary}" FontSize="20" Margin="0,0,0,15" >Enter New Reading</Label>
            </Frame>
        </StackLayout>
    </telerikPrimitives:RadPopup>
</telerikPrimitives:RadPopup.Popup>

1 Answer, 1 is accepted

Sort by
0
Alex
Telerik team
answered on 12 Apr 2021, 02:51 PM

Hello Chris,

The Xamarin.Forms framework does not allow to set properties twice. This is the reason why the error message is displayed.

If the scenario is first to display a popup with a loading indicator and when it loads to display another popup with some different content in it, I can suggest two possibilities:

1.  Use BusyIndicator control and when the IsBusy property is set to false -> display the Popup. More information about BusyIndicator can be found in this help article.

2. Have a logic in your code behind or ViewModel which will change the Content property of your popup between two views. One for the loading screen of the popup and another for its desired content after the loading finishes.

Next steps:

If this isn't the case and you want to accomplish something different, may I ask you to give us more information about the scenario you want to achieve?

Regards,
Alex
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.

Tags
Popup
Asked by
Chris
Top achievements
Rank 2
Veteran
Answers by
Alex
Telerik team
Share this question
or