Interviewer And Interviewee Guide

WPF Interview Question:

How can I set an attached property in code?

Submitted by: Administrator
The 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

Read Online WPF Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.