Is there TOP VIEW(or window) on xamarin forms? - xamarin

I'm making app with using Xamarin.forms.
I wanted to know if there is top window or view for Xamarin.forms.
I want to put something like a alert or indicator so that it remain on top depth all the time until it's gone. (even if new page is pushed.)
I can't find any view or window on XF.
Should I use each native window?
Thanks.

You can try to use Application.Current.MainPage.DisplayAlert method to display alert from the MainPage (which ordinary always exists in app).

Related

Difference between Prism Dialogs vs Popup

I am implementing Prism in a new Xamarin Forms App. I have been using Rg.Plugins.Popup in the app before converting to Prism.
What are the limitation on the Prism Dialogs vs Prism.Plugin.Popups?
What are some examples when you would use one over the other?
Thank you!
Rg.Plugins.Popup is a popular plugin for Xamarin.Forms which accesses the native functionality to provide a "Modal Popup" which traditionally has not been achievable with Xamarin.Forms.
Dialogs in Prism 7.2
If you're using Prism 7.2 you'll find that the DialogService locates the currently displayed page and then "reparent's the content". Or in other words it takes the content of the active Content Page and places it as the root child of an AbsoluteLayout, placing a mask layer and finally your dialog on top. As a result of this approach you'll notice that any navigation bars for instance on the NavigationPage or TabbedPage, or a MasterDetailPage's menu will remain accessible to the user.
While in some regard both the PopupPage and Dialog may look very similar as you can probably tell there is some significant divergence there.
Dialogs in Prism 8
If you're using Prism 8.0 you'll see that we have updated to the latest Xamarin.Forms and as a result we are able to take advantage of a new feature in Xamarin.Forms which allows you to present a Modal Page with a Transparent background. This in effect allows you to replicate the effect of a PopupPage with either some benefits or drawbacks depending on how you look at it.
With Rg.Plugins.Popups you have the ability to push a PopupPage on top of whatever page is currently displayed from anywhere in the app
With Xamarin.Forms page's that have been pushed Modally they are part of your active Navigation Stack
Using the a traditional page with a transparent background and Modal Navigation you in effect have replicated the appearance of what you get with a PopupPage
Limitations
Prism.Plugin.Popups has the benefit of being integrated into the Navigation Service. As such you can inject the Navigation Service into the ViewModel of a PopupPage, and the PopupPage will be dismissed when you navigate away from it to another non PopupPage.
Dialogs are not part of the Navigation Stack tracked by Prism's Navigation Service. Navigation in Xamarin.Forms is dependent on navigating FROM a specific page. Since Prism's NavigationService doesn't know about the Dialog you will need to dismiss the dialog before navigating.
Other Key Differences
Besides what I've mentioned so far the only real difference is that Rg.Plugins.Popup gives you some added animations which honestly I've seen very few people using.

Is it possible to change a View in MvvMCross without opening a new window?

I'm currently trying to build a simple macos & WPF application with the help of the MvvMCross framework. I'm having some trouble with navigating from one Viewmodel to another. I've got my WPF client currently working as desired, but I can't seem to achieve the same behaviour for my macos client.
Clicking on any navigation button opens a separate window. What I'd like to see is that the content in the current window changes to the content of the view that was navigated towards.
You can find the code over here

Bottom Tabbed Bar With Customised Tab Menu

I am trying to get a Circular Icon of my Application Logo right in middle of tabbed bar menu's, I have 5 Tab Menu's where the third one i want it to look like this
trying to get this on Android & Ios
i have tried custom rendering by removing the padding but still not able to get the desired result, i found one solution updating icon using SetTabIcons Method but this method does not get trigger when we are working with bottom tabbed bar in Android, please suggest me something which can help me to get this for both android & Ios
I understand your problem here, i am not sure how to get that big button overflowing the tabbar but however have a look at this
https://devlinduldulao.pro/how-to-create-bottom-navigation-bar-in-xamarin-forms/
That's an open source project and the source code is linked at the bottom of page, you can tweak the animation (which i like very much) and use a customrenderer to render the center icon over a circle.
Have a look if that helps you in any way! :)

Apple Watch app scroll the view to top programmatically after launching app

I need to scroll to top the main Interface Controller of an Apple Watch app programmatically after each launch specially if users has left the app after scrolling it down.
EDIT:
This is now possible in watchOS 4. Just use the scrollToObject:atScrollPosition:animated: method.
Unfortunately, this isn't currently possible. WatchKit only provides a method to scroll to the top of a WKInterfaceTable, not an entire interface controller.
The only workaround I've found is to hide every element in the interface controller. This doesn't just hide the element, it completely removes it from the controller. Then when you unhide everything, you'll be back at the top of your content.

Custom Navigation with Xamarin.Forms

I’m working on an application for Android and iOS, which requires a certain flexibility for one or two views. That’s why we created & implemented a service that translated a basic list of objects into a user interface for both iOS & Android. But now that Xamarin.Forms is released, we decided to replace our service by the one Xamarin provides. I did succeed in creating the views with Xamarin.Forms, resulting in better looking & smoother running pages. But my problem lies in the navigation of it. Here is a little drawing on what I would like to achieve:
I would like my app to start an activity that starts with a custom fragment. After clicking a button on this fragment, I would like the page I created with the Xamarin.Forms api to be added to my current navigation stack! Once the user is finished with the Xamarin.Forms page, it navigates to a second custom fragment, all that without breaking the navigation cycle. Does anybody have an idea on how I can achieve this?
For the iOS developpers: replace Activity with NavigationController & Fragment with ViewController
Take a look at CarouselPage for Xamarin.Forms' own approach. It doesn't look like that's what you need but you can also look at its source code and maybe make a custom renderer yourself.
You may also want to take a look at MVVM
As for the easier/hackier way you'd want to make a button on each page and when the button is tapped execute Navigation.PushModalAsync(nextPage) - there won't be a "< Back" button any more, you may need to implement that yourself if you need it.
If by your meaning of 'current navigation stack' is for using the native Navigation of each platform, then remember that you don't have to use Xamarin.Forms' Navigation Model and functions such like PushAsync.
If you prefer to do Navigation with code specific to each platform then you can do this the same as normal. Just create your stub pages in each platform specific project and set the Xamarin.Forms content for each page from the shared project.
From each platform specific stub page (Activity / UIView / PhoneApplicationPage) you could then execute an Action<> call setting on the shared Xamarin.Forms page to help with the navigation, or alternatively, hook into a custom-event that is raised from the Xamarin.Forms** page back to the platform specific stub page to allow you to do navigation from there.
Like Sten mentioned there won't be any 'Back' button so you will most likely have to do that yourself.

Resources