Example #1
0
        /// <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;
            }
        }
Example #2
0
        /// <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;
            }
        }
Example #3
0
        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);
        }