Replies: 3 comments
-
Inject the service (e.g., ISnackbarService) into your viewmodel or page, and then call the relevant method (e.g., Show). |
Beta Was this translation helpful? Give feedback.
-
I actually dont know how to use these, but there is a way to use it easily in your application.var messageBox = new Wpf.Ui.Controls.MessageBox(); |
Beta Was this translation helpful? Give feedback.
-
This is what I use for MessageBoxes so they are reusable. The first one is if you want to return a result, such as if the user clicks yes or no.
The Second is more just informational so all they can really do is hit ok to close it.
Refer to this page for info on Dialogs: Dialog Info Assuming you have your snackbar set up, you can "trigger" it like so:
I am not currently using injection in my projects, so here is how you can set up snackbars and dialogs without it: In your Window that you want to display said snackbar or dialog, you want to put these:
Wherever you are keeping your properties (be it the window or a Viewmodel) create the service properties. You will set the presenters that you placed in your window XAML from the Window Constructor. The example below is not using a ViewModel:
|
Beta Was this translation helpful? Give feedback.
-
How can i use MessageBox, Snackbar and Dialog ??
And is it possible to enter input textbox in Dialog ??
Beta Was this translation helpful? Give feedback.
All reactions