1 write to ModelItem
System.Activities.Core.Presentation (1)
System\Activities\Core\Presentation\StateContainerEditor.xaml.cs (1)
206
this.
ModelItem
= parent.ModelItem;
82 references to ModelItem
System.Activities.Core.Presentation (82)
System\Activities\Core\Presentation\StateContainerEditor.CompositeView.cs (12)
267
if (this.
ModelItem
.ItemType == typeof(State))
308
using (EditingScope es = (EditingScope)this.
ModelItem
.BeginEdit(System.Activities.Presentation.SR.PropertyChangeEditingScopeDescription))
362
using (EditingScope es = (EditingScope)this.
ModelItem
.BeginEdit(
368
StoreShapeSizeWithUndoRecursively(this.
ModelItem
);
373
(this.
ModelItem
.ItemType == typeof(StateMachine)) ?
374
this.
ModelItem
.Properties[StateMachineDesigner.StatesPropertyName].Collection.Add(state) :
375
GetStateMachineModelItem(this.
ModelItem
).Properties[StateMachineDesigner.StatesPropertyName].Collection.Add(state);
385
Fx.Assert(this.
ModelItem
.ItemType == typeof(StateMachine), "Only StateMachine contain the StateContainerEditor.");
427
DragDropHelper.ValidateItemsAreOnView(selectedItems, this.
ModelItem
.Properties[StateMachineDesigner.StatesPropertyName].Collection);
438
DragDropHelper.ValidateItemsAreOnView(movedItems, this.
ModelItem
.Properties[StateMachineDesigner.StatesPropertyName].Collection);
541
if (this.
ModelItem
.ItemType == typeof(StateMachine))
547
ModelItem stateMachineModelItem = StateContainerEditor.GetStateMachineModelItem(this.
ModelItem
);
System\Activities\Core\Presentation\StateContainerEditor.ModelChangeReactions.cs (9)
111
Fx.Assert(this.
ModelItem
.ItemType == typeof(StateMachine), "Only StateMachine should have initial state");
221
Fx.Assert(this.
ModelItem
.ItemType == typeof(StateMachine), "Only StateMachine should have initial state");
230
ModelItem initialStateModelItem = this.
ModelItem
.Properties[StateMachineDesigner.InitialStatePropertyName].Value;
252
if (e.ParentModelItem == this.
ModelItem
)
256
double defaultWidth = ((this.
ModelItem
.ItemType == typeof(State)) ? DefaultWidthForState : DefaultWidthForStateMachine);
257
object widthViewState = this.ViewStateService.RetrieveViewState(this.
ModelItem
, StateContainerWidthViewStateKey);
262
double defaultHeight = ((this.
ModelItem
.ItemType == typeof(State)) ? DefaultHeightForState : DefaultHeightForStateMachine);
263
object heightViewState = this.ViewStateService.RetrieveViewState(this.
ModelItem
, StateContainerHeightViewStateKey);
268
if ((e.ParentModelItem.ItemType == typeof(State) || (e.ParentModelItem.ItemType == typeof(StateMachine) && e.ParentModelItem == this.
ModelItem
)) &&
System\Activities\Core\Presentation\StateContainerEditor.ModelChanges.cs (14)
54
using (EditingScope es = (EditingScope)this.
ModelItem
.BeginEdit(SR.ClearInitialState))
69
Fx.Assert(this.
ModelItem
.ItemType == typeof(StateMachine), "Should only delete states with StateMachine.");
71
this.
ModelItem
.Properties[StateMachineDesigner.StatesPropertyName].Collection.Remove(stateModelItem);
73
this.
ModelItem
.ItemType == typeof(StateMachine) &&
74
stateModelItem == this.
ModelItem
.Properties[StateMachineDesigner.InitialStatePropertyName].Value)
76
this.
ModelItem
.Properties[StateMachineDesigner.InitialStatePropertyName].SetValue(null);
77
this.ViewStateService.StoreViewStateWithUndo(this.
ModelItem
, ConnectorLocationViewStateKey, null);
164
using (EditingScope es = (EditingScope)this.
ModelItem
.BeginEdit(SR.CreateTransition))
188
using (EditingScope es = (EditingScope)this.
ModelItem
.BeginEdit(SR.SetInitialState))
245
storageModelItem = this.
ModelItem
;
293
Fx.Assert(this.
ModelItem
.ItemType == typeof(StateMachine), "Should only drop state with StateMachine.");
294
using (EditingScope es = (EditingScope)this.
ModelItem
.BeginEdit(System.Activities.Presentation.SR.CollectionAddEditingScopeDescription))
296
StoreShapeSizeWithUndoRecursively(this.
ModelItem
);
297
droppedModelItem = this.
ModelItem
.Properties[StateMachineDesigner.StatesPropertyName].Collection.Add(droppedObject);
System\Activities\Core\Presentation\StateContainerEditor.xaml.cs (42)
207
this.StateMachineModelItem = StateContainerEditor.GetStateMachineModelItem(this.
ModelItem
);
371
if (this.
ModelItem
.ItemType == typeof(StateMachine))
375
this.
ModelItem
.Properties[StateMachineDesigner.StatesPropertyName].Collection.CollectionChanged += new NotifyCollectionChangedEventHandler(OnStateCollectionChanged);
376
this.
ModelItem
.PropertyChanged += new PropertyChangedEventHandler(this.OnModelPropertyChanged);
380
foreach (ModelItem modelItem in this.
ModelItem
.Properties[StateMachineDesigner.StatesPropertyName].Collection)
395
object widthViewState = this.ViewStateService.RetrieveViewState(this.
ModelItem
, StateContainerWidthViewStateKey);
401
object heightViewState = this.ViewStateService.RetrieveViewState(this.
ModelItem
, StateContainerHeightViewStateKey);
411
if (this.
ModelItem
.ItemType == typeof(StateMachine))
414
this.AddStateVisuals(this.
ModelItem
.Properties[StateMachineDesigner.StatesPropertyName].Collection);
435
if (this.
ModelItem
.ItemType == typeof(StateMachine))
438
this.
ModelItem
.Properties[StateMachineDesigner.StatesPropertyName].Collection.CollectionChanged -= new NotifyCollectionChangedEventHandler(OnStateCollectionChanged);
439
this.
ModelItem
.PropertyChanged -= new PropertyChangedEventHandler(this.OnModelPropertyChanged);
443
foreach (ModelItem modelItem in this.
ModelItem
.Properties[StateMachineDesigner.StatesPropertyName].Collection)
458
if (this.
ModelItem
.ItemType == typeof(State) && this.stateMachineContainerEditor != null)
484
object locationOfShape = this.ViewStateService.RetrieveViewState(this.
ModelItem
, StateContainerEditor.ShapeLocationViewStateKey);
497
this.StoreShapeLocationViewState(this.
ModelItem
, startLocation);
505
Fx.Assert(this.
ModelItem
.ItemType == typeof(StateMachine), "Only StateMachine should have initial state.");
541
this.
ModelItem
,
1247
if (this.
ModelItem
.ItemType == typeof(State))
1576
using (EditingScope es = (EditingScope)this.
ModelItem
.BeginEdit(SR.MoveLink))
1668
this.
ModelItem
,
1675
this.
ModelItem
,
1866
ModelItemHelper.TryCreateImmediateEditingScopeAndExecute(this.
ModelItem
.GetEditingContext(), System.Activities.Presentation.SR.CollectionAddEditingScopeDescription, (es) =>
1921
if (droppedModelItem.ItemType == typeof(State) && this.
ModelItem
.ItemType == typeof(StateMachine))
2073
else if (modelItem.ItemType == typeof(State) && this.IsStateMachineContainer && StateContainerEditor.AreInSameStateMachine(modelItem, this.
ModelItem
))
2086
else if (this.
ModelItem
.ItemType == typeof(StateMachine) && DragDropHelper.AllowDrop(e.Data, this.Context, typeof(State), typeof(FinalState), typeof(StartNode)))
2099
using (EditingScope es = (EditingScope)this.
ModelItem
.BeginEdit(SR.ItemMove))
2163
foreach (ModelItem stateModelItem in this.
ModelItem
.Properties[StateMachineDesigner.StatesPropertyName].Collection)
2181
if (this.
ModelItem
.ItemType == typeof(StateMachine))
2187
Fx.Assert(this.
ModelItem
.ItemType == typeof(State), "ModelItem type should be State.");
2249
using (EditingScope es = (EditingScope)this.
ModelItem
.BeginEdit(SR.ItemMove))
2251
StoreShapeSizeWithUndoRecursively(this.
ModelItem
);
2328
bool immediatelyCommit = ModelItemHelper.CanCreateImmediateEditingScope(this.
ModelItem
);
2330
using (EditingScope scope = (EditingScope)this.
ModelItem
.BeginEdit(SR.AutoConnect, immediatelyCommit))
2348
using (EditingScope es = (EditingScope)this.
ModelItem
.BeginEdit(SR.AutoConnect, false))
2351
this.
ModelItem
, sourceModelItem, droppedModelItem, connectorModelItem, edgeLocation));
2398
this.
ModelItem
.Properties[StateMachineDesigner.InitialStatePropertyName].SetValue(droppedModelItem);
2399
return this.
ModelItem
;
2428
if (targetElement is StartSymbol && this.
ModelItem
.ItemType == typeof(StateMachine))
2430
if (this.
ModelItem
.Properties[StateMachineDesigner.InitialStatePropertyName].Value != null)
2614
bool immediatelyCommit = ModelItemHelper.CanCreateImmediateEditingScope(this.
ModelItem
);
2616
using (EditingScope scope = (EditingScope)this.
ModelItem
.BeginEdit(SR.AutoSplit, immediatelyCommit))
System\Activities\Core\Presentation\StateContainerResizeGrip.cs (5)
64
ModelItem stateContainerModelItem = this.ParentStateContainerEditor.
ModelItem
;
78
this.scope = (EditingScope)this.ParentStateContainerEditor.
ModelItem
.BeginEdit(undoItemName);
101
this.ParentStateContainerEditor.StoreShapeSizeWithUndoRecursively(this.ParentStateContainerEditor.
ModelItem
);
104
WorkflowViewElement designer = this.ParentStateContainerEditor.
ModelItem
.View as WorkflowViewElement;
146
ModelItem stateContainerModelItem = this.ParentStateContainerEditor.
ModelItem
;