c# - Update UI by code in WPF -
I am trying to update some user controls via code to wpf, no luck.
This is the Xaml:
& lt; UserControl x: class = "simulators.docs.UI.Diagram.PropertiesWindow" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" Xmlns: x = "http://schemas.microsoft Com / winfx / 2006 / xaml "xmlns: propertygrid =" clr-namespace: deepfernst. Pp. Control "& gt; & Lt; DockPanel & gt; & Lt; StackPanel X: Name = "StackPanel" width = "300" height = "600" horizontal alignment = "center" & gt; & Lt; Property Grid: Property Grid Control Height = "300" x: Name = "MyProperty Grid" /> & Lt; / StackPanel & gt; & Lt; / DockPanel & gt;
and that is the C # code:
public zero set instance (object obj) {MyPropertyGrid = New PropertyGridControl {instance = Obj, height = 300}; StackPanel.Children.Clear (); StackPanel.Children.Add (MyPropertyGrid); }
Finally, property apers continue to change, but I was unable to see changes in the UI.
What am I missing?
Thanks, I also tried to create a new object instead of using the existing MIPProperty Grid, not working, the stack panel without success ....
I do not have the property control specified but it seems that the UI does not get the update. Did you try "UpdateLayout ()" on that control and stack panel?
Comments
Post a Comment