Specifics of the ModelProperty.SetValue method from Microsoft.Windows.Design.Interaction.dll
Дмитрий Большаков
1
Reputation point
0
Are there any peculiarities of the method SetValue from Microsoft.Windows.Design.Model.ModelProperty class (Assembly Microsoft.Windows.Design.Interaction.dll)
When I assign a value using this method, it appears in the XAML file but is not assigned to the actual property.
private void TestMenuAction_Execute(object sender, MenuActionEventArgs e)
{
ModelItem selectedDataGrid = e.Selection.PrimarySelection;
ModelItem colModelItem = selectedDataGrid.Properties["StaticColumns"].Collection[0];
using (ModelEditingScope scope = selectedDataGrid.BeginEdit("Set Column Width"))
{
colModelItem.Properties["Width"].SetValue(99);
scope.Complete();
//scope.Update();
}
}
The value is transferred to the property only after I click any key in the XAML editor. For example Space.