public override void Loaded(ViewLoadedParams viewLoadedParams) { DependencyView = new WorkspaceDependencyView(this, viewLoadedParams); // when a package is loaded update the DependencyView // as we may have installed a missing package. pmExtension.PackageLoader.PackgeLoaded += (package) => { DependencyView.DependencyRegen(viewLoadedParams.CurrentWorkspaceModel as WorkspaceModel); }; // Adding a button in view menu to refresh and show manually workspaceReferencesMenuItem = new MenuItem { Header = Resources.MenuItemString, IsCheckable = true, IsChecked = false }; workspaceReferencesMenuItem.Click += (sender, args) => { if (workspaceReferencesMenuItem.IsChecked) { // Refresh dependency data DependencyView.DependencyRegen(viewLoadedParams.CurrentWorkspaceModel as WorkspaceModel); viewLoadedParams.AddToExtensionsSideBar(this, DependencyView); workspaceReferencesMenuItem.IsChecked = true; } else { viewLoadedParams.CloseExtensioninInSideBar(this); workspaceReferencesMenuItem.IsChecked = false; } }; viewLoadedParams.AddExtensionMenuItem(workspaceReferencesMenuItem); }
public void Loaded(ViewLoadedParams p) { p.CurrentWorkspaceChanged += (ws) => { Counter++; }; var window = new Window(); window.Content = new TextBlock() { Text = "Dummy" }; window.Closed += (sender, args) => { WindowClosed = true; }; if (SetOwner) { window.Owner = p.DynamoWindow; } Content = window; p.AddToExtensionsSideBar(this, window); }
public void Loaded(ViewLoadedParams p) { ViewModel = new NodePropertyPaletteWindowViewModel(p); NodePropertyPaletteView = new NodePropertyPaletteWindow(p, ViewModel) { // Set the data context for the main grid in the window. NodesTable = { DataContext = ViewModel }, MainGrid = { DataContext = ViewModel }, Owner = p.DynamoWindow }; NodePropertyPaletteMenuItem = new MenuItem { Header = "Show NodePropertyPalette", IsCheckable = true, IsChecked = false }; NodePropertyPaletteMenuItem.Click += (sender, args) => { if (NodePropertyPaletteMenuItem.IsChecked) { p.AddToExtensionsSideBar(this, NodePropertyPaletteView); } else { p.CloseExtensioninInSideBar(this); } }; p.AddMenuItem(MenuBarType.View, NodePropertyPaletteMenuItem); }
public void Loaded(ViewLoadedParams p) { ViewModel = new TuneUpWindowViewModel(p); TuneUpView = new TuneUpWindow(p, UniqueId) { // Set the data context for the main grid in the window. NodeAnalysisTable = { DataContext = ViewModel }, MainGrid = { DataContext = ViewModel } }; TuneUpMenuItem = new MenuItem { Header = "Show TuneUp", IsCheckable = true, IsChecked = false }; TuneUpMenuItem.Click += (sender, args) => { if (TuneUpMenuItem.IsChecked) { p.AddToExtensionsSideBar(this, TuneUpView); ViewModel.EnableProfiling(); } else { p.CloseExtensioninInSideBar(this); } }; p.AddMenuItem(MenuBarType.View, TuneUpMenuItem); }
public void Loaded(ViewLoadedParams viewLoadedParams) { DependencyView = new PackageDependencyView(viewLoadedParams); viewLoadedParams.AddToExtensionsSideBar(this, DependencyView); // Adding a button in view menu to refresh and show manually packageDependencyMenuItem = new MenuItem { Header = Resources.MenuItemString }; packageDependencyMenuItem.Click += (sender, args) => { // Refresh dependency data DependencyView.DependencyRegen(viewLoadedParams.CurrentWorkspaceModel as WorkspaceModel); viewLoadedParams.AddToExtensionsSideBar(this, DependencyView); }; viewLoadedParams.AddMenuItem(MenuBarType.View, packageDependencyMenuItem); }
public void Loaded(ViewLoadedParams p) { p.CurrentWorkspaceChanged += (ws) => { Counter++; }; var window = new Window { // Set the owner of the window to tuIDhe Dynamo window. Owner = p.DynamoWindow }; p.AddToExtensionsSideBar(this, window); }
public void Loaded(ViewLoadedParams p) { p.CurrentWorkspaceChanged += (ws) => { Counter++; }; var window = new Window { Owner = p.DynamoWindow }; // Adding the extensiomn to the extensions side bar. p.AddToExtensionsSideBar(this, window); }
public override void Loaded(ViewLoadedParams p) { // Use dynamic object type of ViewLoadedParams to dynamically call its methods. dynamic dp = (dynamic)p; ViewModel = new TuneUpWindowViewModel(p); TuneUpView = new TuneUpWindow(p, UniqueId) { // Set the data context for the main grid in the window. NodeAnalysisTable = { DataContext = ViewModel }, MainGrid = { DataContext = ViewModel }, Owner = p.DynamoWindow }; TuneUpMenuItem = new MenuItem { Header = "Show TuneUp", IsCheckable = true, IsChecked = false }; TuneUpMenuItem.Click += (sender, args) => { if (TuneUpMenuItem.IsChecked) { p.AddToExtensionsSideBar(this, TuneUpView); ViewModel.EnableProfiling(); } else { p.CloseExtensioninInSideBar(this); } }; // Add this view extension's menu item to the Extensions tab or View tab accordingly. var dynamoMenuItems = p.dynamoMenu.Items.OfType <MenuItem>(); var extensionsMenuItem = dynamoMenuItems.Where(item => item.Header.ToString() == "_Extensions"); if (extensionsMenuItem.Count() > 0) { dp.AddExtensionMenuItem(TuneUpMenuItem); } else { dp.AddMenuItem(MenuBarType.View, TuneUpMenuItem); } }
/// <summary> /// Creates and add the library view to the WPF visual tree /// </summary> /// <returns>LibraryView control</returns> internal ViewportView AddViewportToExtensionsPanel(IViewExtension ext, ViewLoadedParams p) { var model = new ViewportWindowViewModel(this.viewLoadedParams, this.address); var view = new ViewportView(model); var browser = view.Browser; this.browser = browser; p.AddToExtensionsSideBar(ext, view); browser.RegisterAsyncJsObject("controller", this); view.Loaded += OnViewportViewLoaded; browser.SizeChanged += Browser_SizeChanged; browser.LoadError += Browser_LoadError; return(view); }
public void Loaded(ViewLoadedParams p) { ViewModel = new TuneUpWindowViewModel(p); TuneUpView = new TuneUpWindow(p, UniqueId) { // Set the data context for the main grid in the window. NodeAnalysisTable = { DataContext = ViewModel }, MainGrid = { DataContext = ViewModel } }; TuneUpMenuItem = new MenuItem { Header = "Open Tune Up" }; TuneUpMenuItem.Click += (sender, args) => { p.AddToExtensionsSideBar(this, TuneUpView); ViewModel.EnableProfiling(); }; p.AddMenuItem(MenuBarType.View, TuneUpMenuItem); }
public void Loaded(ViewLoadedParams viewLoadedParams) { DependencyView = new WorkspaceDependencyView(this, viewLoadedParams); // when a package is loaded update the DependencyView // as we may have installed a missing package. pmExtension.PackageLoader.PackgeLoaded += (package) => { DependencyView.DependencyRegen(viewLoadedParams.CurrentWorkspaceModel as WorkspaceModel); }; // Adding a button in view menu to refresh and show manually packageDependencyMenuItem = new MenuItem { Header = Resources.MenuItemString }; packageDependencyMenuItem.Click += (sender, args) => { // Refresh dependency data DependencyView.DependencyRegen(viewLoadedParams.CurrentWorkspaceModel as WorkspaceModel); viewLoadedParams.AddToExtensionsSideBar(this, DependencyView); }; viewLoadedParams.AddMenuItem(MenuBarType.View, packageDependencyMenuItem); }
public override void Loaded(ViewLoadedParams p) { // Save a reference to your loaded parameters. // You'll need these later when you want to use // the supplied workspaces var viewModel = new SampleWindowViewModel(p); var window = new SampleWindow { // Set the data context for the main grid in the window. MainGrid = { DataContext = viewModel }, // Set the owner of the window to the Dynamo window. Owner = p.DynamoWindow }; sampleMenuItem = new MenuItem { Header = "Show View Extension Sample Window", IsCheckable = true }; sampleMenuItem.Checked += (sender, args) => p.AddToExtensionsSideBar(this, window); sampleMenuItem.Unchecked += (sender, args) => p.CloseExtensioninInSideBar(this); p.AddMenuItem(MenuBarType.View, sampleMenuItem); }