How can I set an attached property in code?
Submitted by: AdministratorThe following example shows how you can set an attached property in code.
[C#]
DockPanel myDockPanel = new DockPanel();
CheckBox myCheckBox = new CheckBox();
myCheckBox.Content = "Hello";
myDockPanel.Children.Add(myCheckBox);
DockPanel.SetDock(myCheckBox, Dock.Top);
Submitted by: Administrator
[C#]
DockPanel myDockPanel = new DockPanel();
CheckBox myCheckBox = new CheckBox();
myCheckBox.Content = "Hello";
myDockPanel.Children.Add(myCheckBox);
DockPanel.SetDock(myCheckBox, Dock.Top);
Submitted by: Administrator
Read Online WPF Job Interview Questions And Answers
Top WPF Questions
☺ | What is WPF? |
☺ | How can I mark the default value of a custom dependency property to be false? |
☺ | How can I enumerate all the descendants of a visual object? |
☺ | What is XAML extensible markup language? |
☺ | How can I create Custom Read-Only Dependency Properties? |
Top Application Program Categories
☺ | AutoCAD Interview Questions. |
☺ | Microsoft Office Interview Questions. |
☺ | Microsoft Outlook Interview Questions. |
☺ | Microsoft Excel Interview Questions. |
☺ | MATLAB Interview Questions. |