public void OpenNewDialogPage <T>(ViewModelBase currentViewModel, T viewModel = null) where T : ViewModelBase { var newWindow = CreateDialogWindow(); viewModel = MyCreator.ViewModelCreator(viewModel); SetDialogWindowProperties(newWindow, viewModel); newWindow.ShowDialog(); }
public void OpenNewPageDialogWithConstructor <T, Tparameter>(ViewModelBase currentViewModel, Tparameter parameter, T viewModel = null) where T : ViewModelBase <Tparameter> { var newWindow = CreateDialogWindow(); viewModel = MyCreator.ViewModelCreator(viewModel); MyCreator.PassParemeterToViewModel(viewModel, parameter); SetDialogWindowProperties(newWindow, viewModel); newWindow.ShowDialog(); }
static void Main() { Creator creator = new MyCreator(); Product product = creator.Create(ProductType.THEIRS); }