public GraphStateVariablesViewModel(ObservableGraph graph) : base("State Variables")
        {
            Graph = graph ?? throw new ArgumentNullException(nameof(graph));

            StateVariables = ObservableStateVariable.MakeObservableCollection(Graph, true, ChildIsDirtyChanged);
            StateVariables.CollectionChanged += StateVariables_CollectionChanged;
        }
Exemple #2
0
 public ShowGraphPropertiesMessage(ObservableGraph graph, Action <GraphPropertiesViewModel> callback = null) : base(new GraphPropertiesViewModel(graph), callback)
 {
 }
        public static ObservableCollection <ObservableStateVariable> MakeObservableCollection(ObservableGraph graph, bool clone, IsDirtyChangedEventHandler onIsDirtyChanged = null)
        {
            if (graph is null)
            {
                throw new ArgumentNullException(nameof(graph));
            }

            return(MakeObservableCollection(graph.InternalObject.StateVariables, item => new ObservableStateVariable(item), clone, onIsDirtyChanged));
        }
 public GraphPropertiesViewModel(ObservableGraph graph) : base("Properties")
 {
     Graph        = graph ?? throw new ArgumentNullException(nameof(graph));
     _name        = Graph.Name;
     _description = Graph.Description;
 }