public ToolControlHostWindowView(UserControlHostWindowViewModel ucvm) : base(DataWindowMode.Custom) { InitializeComponent(); UserContentControl.Content = ucvm.ContentUserControl; }
private void OpenProjectButton_Click(object sender, RoutedEventArgs e) { Views.Wizards.FirstSetupWizardView rpv = new Views.Wizards.FirstSetupWizardView(); UserControlHostWindowViewModel zxc = new UserControlHostWindowViewModel(rpv); UserControlHostWindowView uchwv = new UserControlHostWindowView(zxc); uchwv.Show(); }
public UserControlHostWindowView(UserControlHostWindowViewModel ucvm) : base(DataWindowMode.Custom) { InitializeComponent(); UserContentControl.Content = ucvm.ContentUserControl; ucvm.ClosedAsync += (s, e) => { return(System.Threading.Tasks.Task.Run(() => Dispatcher.Invoke(() => Close()))); }; }
private void SideMenu_NewProjectItem_Selected(object sender, RoutedEventArgs e) { if (IsLoaded && IsVisible && IsInitialized) { Views.Wizards.ProjectWizardView rpv = new Views.Wizards.ProjectWizardView(); UserControlHostWindowViewModel zxc = new UserControlHostWindowViewModel(rpv); UserControlHostWindowView uchwv = new UserControlHostWindowView(zxc); uchwv.Show(); } }
protected override async void Execute(object parameter) { try { var vm = new UserControlHostWindowViewModel(new ProjectWizardView(), 600, 1200); var result = await _uIVisualizerService.ShowDialogAsync(vm); } catch (Exception ex) { _loggerService.LogString(ex.Message, Logtype.Error); _loggerService.LogString("Failed to create a new project!", Logtype.Error); } }
protected override async Task ExecuteAsync(object parameter) { try { var vm = new UserControlHostWindowViewModel(new PublishWizardView()); ServiceLocator.Default.RegisterInstance(vm); var result = await _uIVisualizerService.ShowDialogAsync(vm); ServiceLocator.Default.RemoveType(typeof(UserControlHostWindowViewModel)); } catch (Exception ex) { _loggerService.LogString(ex.Message, Logtype.Error); _loggerService.LogString("Failed to publish project!", Logtype.Error); } }
// Show the first time setup to the user. public static void ShowFirstTimeSetup(ISettingsManager settings, INotificationService growl) { var messages = settings.IsHealthy(); if (!messages.Any()) { return; } foreach (var message in messages) { //growl.Error(message); } try { // Try to show First time setup. Task.Run(() => Application.Current.Dispatcher.Invoke(() => { var rpv = new FirstSetupWizardView(); var zxc = new UserControlHostWindowViewModel(rpv, 400, 600); var uchwv = new UserControlHostWindowView(zxc); rpv.ViewModelChanged += (_s, _e) => { if (rpv.ViewModel == null) { return; } rpv.ViewModel.ClosedAsync += async(s, e) => await Task.Run(() => Application.Current.Dispatcher.Invoke(() => uchwv.Close())); }; uchwv.Show(); })); } catch (Exception e) { // Log error. StaticReferences.Logger.Error(e.Message); } }
public static void ShowFirstTimeSetup() { if (Functionality.Services.SettingsManager.FirstTimeSetupForUser) { Task.Run(() => //await Task.Delay(5000); Application.Current.Dispatcher.Invoke(() => { var rpv = new FirstSetupWizardView(); var zxc = new UserControlHostWindowViewModel(rpv); var uchwv = new UserControlHostWindowView(zxc); rpv.ViewModelChanged += (_s, _e) => { if (rpv.ViewModel == null) { return; } rpv.ViewModel.ClosedAsync += async(s, e) => await Task.Run(() => Application.Current.Dispatcher.Invoke(() => uchwv.Close())); }; uchwv.Show(); })); } }