Inheritance: System.Windows.Controls.UserControl
Exemple #1
0
            /// <summary>
            ///     At run-time, this method is called during the node
            ///     creation. Here you can create custom UI elements and
            ///     add them to the node view, but we recommend designing
            ///     your UI declaratively using xaml, and binding it to
            ///     properties on this node as the DataContext.
            /// </summary>
            /// <param name="model">The NodeModel representing the node's core logic.</param>
            /// <param name="nodeView">The NodeView representing the node in the graph.</param>
            public void CustomizeView(HydraShare model, NodeView nodeView)
            {
                var hydraControl = new HydraShareControl();

                nodeView.inputGrid.Children.Add(hydraControl);
                hydraControl.DataContext = model;
                model.RequestSave       += () => exportToHydra(model, nodeView);
            }
            public void CustomizeView(HydraNodeModel model, NodeView nodeView)
            {
                HydraShareControl hydraControl = new HydraShareControl();

                nodeView.inputGrid.Children.Add(hydraControl);

                // TODO - VERIFY THIS IS SAFE
                // Store a reference to the DynamoViewModel
                model.DynamoModel = nodeView.ViewModel.DynamoViewModel;

                // Set the data context for our control to be the node model.
                // Properties in this class which are data bound will raise
                // property change notifications which will update the UI.
                hydraControl.DataContext = model;
            }