I am working on xamarin.forms. I am using Master detail page. In menupage of MasterDetailPage I have some menu items that are listed. At the bottom of the Menu list I placed a button on menu page. Now I need to open a popup on click of that button. I am trying with PopupLayout but not able to get any success.
Please tell me how I can open a custom popup box at the click of the button that is placed in menu page?
Regards,
Anand Dubey
Without going into separate, native projects for all platforms you are targeting (such as Android, iOS, UWP...), you cannot pop out custom UI content over existing pages in Xamarin.Forms out of the box. You would need to bring in additional references or get creative with the AbsoluteLayout control.
Here are a few options you have:
Simple popup with message and or option selection
If all you need is a simple popup message or a list of buttons, you should look into the native DisplayAlert and DisplayActionSheet methods. They are built into Xamarin.Forms and work really well for these simple cases.
More complex popup dialogs
For anything more complex than that, there is the excellent UserDialogs project: ACR UserDialogs github page
It will give you support for various loading dialogs, date, time pickers, action sheet, success/info/error toasts and more.
Fully custom UI markup with AbsoluteLayout
There is a technique where by you prepare the underlying page with a root absoltue layout, which enables you to dynamically add new UI on top of all other controls on your page. This is fiddly and can ruin your performance if you are not careful. This is also the approach that the PopupLayout control that you mentioned uses. If done properly, this can be a good solution, but I don't recommend it as it involves additional complexity on each page that hosts the popup content.
Fully custom UI popup on native projects
Your most flexible option, as always, is to fall back to the native projects. This would involve coding up the popup logic on each separate platform that you are targeting, then using DependencyService (or one of the other techniques) to call into it from the shared project. For this you should look at samples and tutorials for popups on separate native platforms as it gets pretty broad and goes way outside the topic of this question.
Is it possible for the Android WebView to be implemented in JavaFx rather than the native Webview window that is being currently used because the native window causes lightweight vs heavyweight issues. I have a MenuButton that does not display any of the MenuItems because they are all hidden behind the WebView.
The first image shows the menu being displayed normally on top of a regular node.
The second image shows the menu being hidden behind the android webview.
I have an ionic-side-menus directive for several pages, each with its own menu, can the content and menu page use the same controller in some way?
Yes you can, add the same controller in ui router to the views you want to share the same controller with (app.js)
Check out the following plnkr (standard side menu template from ionic)
#app.js
app state (menu.html) and app.playlists (playlists.html) shares the same controller (PlaylistCtrl)
#controllers.js
in PlaylistCtrl has two variables accessed by the side menu and the main page.
HTH
I'm developing an app that has a tab control and would like to know the pro's and con's of using a single activity for the entire app vs having 1 activity for each tab on the tab view. I'm planning on using multiple activities in this app.
Thanks.
I'm using the TabContainer/TabPanel components of the Ajax Control Toolkit.
I'd like to hide the tabs themselves and use a button elsewhere on the page to activate (bring to the front) one of the tabs without posting back to the server.
I can show and hide the tabs by grabbing their clientIDs and manually setting the visibility and display styles.
But is there a javascript function I can call to do this and perform whatever magic happens behind the scenes when I click an actual tab?
Example:
var tab = $find(“tabContainer’s ClientID”);
tab.set_activeTabIndex(1); // active the second tab panel
tab.getFirstTab().set_enabled(false); // disable the first panel