/// <summary> /// Initializes a new instance of the <see cref="CustomViewModelDialogBase{TViewModel}"/> class. /// </summary> private void Initialize() { ViewModel = CustomDialogDependencyResolver?.Resolve <TViewModel>(); if (ViewModel != null) { ViewModel.Dialog = this; CustomDialogConfig = ViewModel.CustomDialogConfig; } }
/// <summary> /// Initializes a new instance of the <see cref="CustomViewModelDialogBase{TViewModel}"/> class. /// </summary> protected CustomViewModelDialogBase() { ViewModel = CustomDialogDependencyResolver?.Resolve <TViewModel>(); if (ViewModel != null) { ViewModel.Dialog = this; CustomDialogConfig = ViewModel.CustomDialogConfig; } }
protected TViewModel ResolveViewModel <TViewModel>() where TViewModel : CustomDialogViewModelBase { var vm = CustomDialogDependencyResolver?.Resolve <TViewModel>(); if (vm != null) { vm.Dialog = this; DataContext = vm; CustomDialogConfig = vm.CustomDialogConfig; } return(vm); }