private MenuItem GenerateMenuItem() { var item = new MenuItem(); item.Header = Resources.DynamoViewMenuItemPublishTitle; var isEnabled = loadedParams.CurrentWorkspaceModel is HomeWorkspaceModel && startupParams.AuthProvider != null; item.IsEnabled = isEnabled; item.Click += (sender, args) => { var model = new PublishModel(startupParams.AuthProvider, startupParams.CustomNodeManager); model.MessageLogged += this.OnMessageLogged; var viewModel = new PublishViewModel(model) { CurrentWorkspaceModel = loadedParams.CurrentWorkspaceModel, Cameras = ConvertCameraData(loadedParams.BackgroundPreviewViewModel.GetCameraInformation()) }; var window = new PublishView(viewModel) { Owner = loadedParams.DynamoWindow, WindowStartupLocation = WindowStartupLocation.CenterOwner }; window.ShowDialog(); model.MessageLogged -= this.OnMessageLogged; }; return(item); }
private MenuItem GenerateMenuItem() { MenuItem item = new MenuItem(); item.Header = Resources.DynamoViewMenuItemPublishTitle; var isEnabled = publishViewModel.CurrentWorkspaceModel is HomeWorkspaceModel && publishModel.HasAuthProvider; item.IsEnabled = isEnabled; item.Click += (sender, args) => { PublishView publishWindow = new PublishView(publishViewModel); publishWindow.ShowDialog(); }; return(item); }
internal void Show() { View = new PublishView(); View.Presenter = this; View.ShowDialog(); }