Specifics of the ModelProperty.SetValue method from Microsoft.Windows.Design.Interaction.dll

2021-06-30T03:20:12.34+00:00

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();  
  }  
}  

110473-image.png

The value is transferred to the property only after I click any key in the XAML editor. For example Space.

XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
789 questions
{count} votes