how to create custom pop up in Xamarin forms - xamarin

I am newbie to Xamarin.Forms and stuck with a situation where I want to Create up a popup box with my control details.
How can I open and create custom dialog box / popup using Xamarin.Forms?
Any example code will be appreciated?
Thanks in advance!

What I have used is a StackLayout(or any layout) within a grid (or even an absolute layout ) this main grid will have 2 children. The IsVisible property of the popup layout will be set to false and when it is needed then the IsVisible property will be set to true and it will appear, something like this:
Grid mainGrid = new Grid{};
mainGrid.Children.Add(mainLayout,0,0);
mainGrid.Children.Add(popUpLayout,0,0);
Content = mainGrid;
if what you want is different then a custom renderer will be the way. Here are some helpful links:
http://blog.ostebaronen.dk/2013/02/using-dialogs-in-mono-for-android.html
https://forums.xamarin.com/discussion/30456/xamarin-forms-control-into-a-native-custom-dialog-android
There are different kind of things to achieve this, but I will say play with the layouts because it will work for all 3 platforms.
The Frame will be useful also:
https://developer.xamarin.com/api/type/Xamarin.Forms.Frame/

Related

Multiple controls on Xamarin button?

I would like complex button, which has several text elements and which should change their state and color depending on button state.
Unfortunately, I see that Xamarin button has only predefined image and text parameters.
How to have multiple controls inside a button in Xamarin?
Visual state manager(Only XF 3.0+) have three states: normal, disabled, focused which is named "CommonStates", or you can create custom states.Maybe it could help:
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/visual-state-manager
I think you must read more in content view, where you can add labels into stacklayout or grid with your own api bindable property, then use it wherever you want in your code:
https://learn.microsoft.com/en-us/dotnet/api/xamarin.forms.contentview

Xamarin.forms - How to display tabs on the middle of a layout

I would like to add tabs just below custom header(Grid), but I am not sure how to do that. So far I have grid and tabbedPage, but how to display both in one page? Thank you for help.
That's not possible with Xamarin.Forms - at least not out of the box, of course you can write custom renderers for something like a TabView.
Note that with X.F you are limited to very basic UIs.

Setting of Images in Blackberry

May I know how to set background images to a Button in Blackberry?
Try following links:
User Defined Buttons - Create a Custom Button From an Image
Tutorial: Creating a custom button
Blackberry Custom Button Field
You can get your customized button by extending ButtonField or Field. In case of ButtonField you have to override default paint(...), paintBackground(...), drawFocus(...), applyTheme(...) etc.
paint(...) - can draw image or other geometric figures instead of text
paintBackground(...) - define how should your button's background look
drawFocus(...) - define how the button looks when it got focus
applyTheme(...) - do nothing if you want to remove default styling
If you extend Field, you will get more option for customization.
Look at the article, ButtonField with Image as a BackGround. It will helps you.
Check out the code here which explains to create custom-image-buttonfield-in-blackberry

Customizing Scroll bar of List Box

I am working on a win 32 sample. In that I am using List Box to Display the List of user. I am using the setting the owner draw flag to draw the items. It is working fine.
But I want to customize the scrollbar of the list view. How to do it.
Please let me know how to customize the scrollbar.
Scrollbars are usually native, even for custom draw items. If you really want to customize them, take a look at this library & tutorial.

Hide controls in FlowDocumentReader

Is it possible to hide controls at the bottom like zoom slider, page navigation etc in FlowDocumentReader? It seems that only search can be hidden through the IsFindEnabled property.
Just use a FlowDocumentScrollViewer instead and set its IsToolBarVisible property to false.
To do this, you have to edit the default template - this is easy to do in Blend but I don't know how to do it in VS. I've done this before though, it is definitely possible.

Resources