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?
|
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(); } ..... } |
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?
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!
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.