'Prism 8 , IDialogWindow keynotfound Exception in WPF C#
I used Prism 8.1 and Unity in my WPF Project. I want to implement IDialogWindow but get exception error...
Prism.Ioc.ContainerResolutionException: 'An unexpected error occurred while resolving 'System.Object', with the service name 'MyDialogWindow'' InnerException KeyNotFoundException: No registered type Object with the key MyDialogWindow.
what is the problem ? i am not sure if this is a bug in prism or i am doing wrong because everything if fine with IDialogAware and ... but not ok with IDialogWindow
Regards
App.xaml.cs
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
    containerRegistry.RegisterDialogWindow<MyDialogWindow>(nameof(MyDialogWindow));
}
MainWindowViewModel.cs
private IRegionManager _regionManager;
private IDialogService _dialogService;
public MainWindowViewModel(IDialogService dialogService, IRegionManager regionManager)
{
    _dialogService = dialogService;
    _regionManager = regionManager;
    _dialogService.ShowDialog("MyDialogWindow");
}
MyDialogWindow.xaml.cs
public partial class MyDialogWindow : Window, IDialogWindow
{
    public MyDialogWindow()
    {
        InitializeComponent();
    }
    public IDialogResult Result { get; set; }
}
MyDialogWindowViewModel.cs
public class MyDialogWindowViewModel : IDialogWindow
{
    public MyDialogWindowViewModel()
    {
    }
    public object Content { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
    public Window Owner { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
    public object DataContext { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
    public IDialogResult Result { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
    public Style Style { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
    public event RoutedEventHandler Loaded;
    public event EventHandler Closed;
    public event CancelEventHandler Closing;
    public void Close()
    {
        throw new NotImplementedException();
    }
    public void Show()
    {
        throw new NotImplementedException();
    }
    public bool? ShowDialog()
    {
        throw new NotImplementedException();
    }
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source | 
|---|
