-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPEC] New IDialogService for Prism.Forms #1814
Comments
@dansiegel would it be helpful if xamarin/Xamarin.Forms#1778 (Xamarin.Forms Popups) was completed for this feature? I need to implement this for a project I am working on and I am planning to submit a PR back to Xamarin.Forms for it. If I am reading this Spec correctly it appears this implementation would be easier if it could leverage the IPopup spec documented in the Xamarin.Forms issue |
@ahoefling I actually already have it working... in the process though we discovered a bug in Xamarin.Forms that they were looking into |
Not to mention that popups API is awful |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
Native Dialogs are UGLY! Prism.Forms should follow the example of Prism.WPF and introduce a similar user experience in which we can register X.F. Views as a Dialog which can then be overlaid on top of the current page. This would allow developers to develop dialogs that have a precise look and feel that matches their existing app and provide the exact functionality that they require.
Proposed SPEC
So as to not confuse people we will be introducing some new API's and we'll be very selective about the existing API's we support.
Existing Supported API's
New API's
Using the Dialog
To start using dialogs you will need to register any Xamarin.Forms View using a new IContainerRegistry extension like so:
To use the Dialog you can inject the IDialogService into any ViewModel and call ShowDialog like so:
Additionally a new XAML Extension would be added to allow you to Show a Dialog.
In classic Prism.Forms style ShowDialog should accept querystrings so that you can display a dialog like:
Page Mask
The Dialog Service will put a mask between your existing content and the Dialog. The Dialog Service will look in the Application Resources for a Style that targets a BoxView with the Key
PrismDialogMaskStyle
. If it finds one it will use that style, otherwise it will use a default style.To close the dialog when the user taps outside of the dialog on the mask layer, you must add the key
closeOnBackgroundTapped
when calling ShowDialog. This could be done either with the querystring or DialogParameters.In the Dialog ViewModel
The Dialog must have a ViewModel and the ViewModel must implement
IDialogAware
. This would look something like:The text was updated successfully, but these errors were encountered: