sfPopup from Xamarin Shell Tabbed application Tabbar

I have a Xamarin Forms Shell app as a tab bar app. I want one of the tabs to display a popup. Is there any example or guidance on how to do that? 



5 Replies

KK Karthikraja Kalaimani Syncfusion Team August 13, 2021 12:04 PM UTC

Hi Tim, 

Thank you for contacting Syncfusion support. 

We have prepared sample for your requirement. In that sample we display the popupview whenever the cats page appear. For more details, please refer to the below code snippets and attached sample. 

Code snippets : 
 
  
public partial class CatsPage : ContentPage 
    { 
        SfPopupLayout popupLayout; 
        public CatsPage() 
        { 
            InitializeComponent(); 
  
            popupLayout = new SfPopupLayout(); 
        } 
  
        protected async override void OnAppearing() 
        { 
  
            
            base.OnAppearing(); 
            await Task.Delay(100); 
            popupLayout.Show(); 
          } 
        ..... 
    } 





TB Tim Belvin August 13, 2021 03:41 PM UTC

Thanks. See the example code attached. I want to have a TabBar menu item that launches the popup. I thought it would work to create a new page with a Transparent background and call the popup.Show method in the onappearing. That doesn't work - if you click on the mypage menu item, I don't have the previous page image as the background.

Thoughts?


Attachment: MyDemo_d2ecb42.zip


TB Tim Belvin August 13, 2021 06:17 PM UTC

I did a little more research and discovered how I might implement the Shell TabBar functionality part. I found a Nuget package called ExtendedShellTabBar. Attached is a quick and dirty sample of how it works.

In this example, I am simply displaying an alert. But it has the functionality I need - regardless of what page is open, I can display a popup and still have the previous page appear greyed out in the background. 

The popup functionality I need will not have header or footer - it will have five round image button's on it. 4 of the 5 buttons will cause the app to navigate to a different section of the app - and 1 of the button's will have the affect of a "Cancel" button.

I can easily create a ContentView (custom control) that performs this. How do I set the datatemplate for sfPopup in code to be a custom control? 

Thanks! 


Attachment: ExtendedItem_f97b68.zip


TB Tim Belvin August 15, 2021 07:04 PM UTC

I think we can close this issue. I ended up making my own control to perform the popup menu functionality I was looking for. See attached for my solution.


Attachment: ExtendedItem_f38bdd8b.zip


KK Karthikraja Kalaimani Syncfusion Team August 16, 2021 06:19 AM UTC

Hi Tim,

Thanks for the update. 

We glad to know that your requirement has been achieved at your end. Please let us know if you need further assistance from us. 

Regards,
Karthik Raja


Loader.
Up arrow icon