FantasticFiasco / mvvm-dialogs

Library simplifying the concept of opening dialogs from a view model when using MVVM in WPF
Apache License 2.0
648 stars 76 forks source link

Crash on loading ModelView. #13

Closed Ahmad45123 closed 8 years ago

Ahmad45123 commented 8 years ago

I am trying to use this library with MvvmLight but I get this exception: http://prntscr.com/ciegxr

Whenever I remove the IDialogService parameter from the ModelView constructor, it works properly.

How to fix this ? Thanks in advanced.

FantasticFiasco commented 8 years ago

Have you registered IDialogService with the IoC container in MvvmLight? Many of my samples in the source use MvvmLight, and their App.xaml.cs looks loke this:

public partial class App
{
    protected override void OnStartup(StartupEventArgs e)
    {
        SimpleIoc.Default.Register<IDialogService>(() => new DialogService());
    }
}
Ahmad45123 commented 8 years ago

Nope, I didn't, That's most likely the issue then.

Thanks.