private void ButtonClick_UnFreezeAll(object sender, RoutedEventArgs e)
        {
            FrameworkElement        fe = sender as FrameworkElement;
            dtSampleWindowViewModel se = fe.DataContext as dtSampleWindowViewModel;

            se.UnFreezeAll(se);
        }
Exemple #2
0
        public void Loaded(ViewLoadedParams p)
        {
            biltMenuItem = new MenuItem {
                Header = "BILT EUR 2018"
            };
            var VM = p.DynamoWindow.DataContext as DynamoViewModel;

            extensionMenuItem = new MenuItem {
                Header = "designtech Sample Extension"
            };
            extensionMenuItem.Click += (sender, args) =>
            {
                var viewModel = new dtSampleWindowViewModel(p);
                var window    = new dtSampleWindow
                {
                    // 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
                };
                window.Left = window.Owner.Left + 400;
                window.Top  = window.Owner.Top + 200;
                window.Show();
            };
            biltMenuItem.Items.Add(extensionMenuItem);
            p.dynamoMenu.Items.Add(biltMenuItem);
        }
        public void UnFreezeAll(dtSampleWindowViewModel se)
        {
            ReadyParams rp  = se.ReadyParamType;
            var         vlp = rp as ViewLoadedParams;
            var         wm  = rp.CurrentWorkspaceModel;

            foreach (NodeModel node in wm.Nodes)
            {
                node.IsFrozen = false;
            }
        }
        public void FreezeSelected(dtSampleWindowViewModel se)
        {
            ReadyParams rp  = se.ReadyParamType;
            var         vlp = rp as ViewLoadedParams;
            var         wm  = rp.CurrentWorkspaceModel;

            foreach (NodeModel node in wm.Nodes)
            {
                if (node.IsSelected)
                {
                    node.IsFrozen = true;
                }
            }
        }