Interaction MahappDialog Confirm Delete #3321
Allgauer77
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello forum,
I am working with WPF .NET6 and I am trying to create a MahApp dialog for a delete confirmation using ReactiveUI / ReactiveCommand/ Interaction.
I have Kent's book and want to include example 1 with chapter09.
When I delete, the following message is generated in the class.
System.InvalidCastException: "Unable to cast object of type 'System.Windows.Navigation.NavigationWindow' to type 'MahApps.Metro.Controls.MetroWindow'."
Please for help.
Thanks
public static class UserControlExtensions
{
public static IObservable ShowMessage(
this UserControl @this,
string title,
string message,
MessageDialogStyle style = MessageDialogStyle.Affirmative,
MetroDialogSettings settings = null)
{
var window = (MetroWindow)Window.GetWindow(@this);
return window
.ShowMessageAsync(title, message, style, settings)
.ToObservable();
}
}
<rxui:ReactiveUserControl
public partial class ArticleView : ReactiveUserControl
{
}
public class ArticleMainViewModel : ReactiveObject, IDisposable
{
Beta Was this translation helpful? Give feedback.
All reactions