How can I mark the default value of a custom dependency property to be false?
Submitted by: AdministratorHere is an example :
[C#]
public class MyStateControl : ButtonBase
{
public MyStateControl() : base() { }
public Boolean State
{
get { return (Boolean)this.GetValue(StateProperty); }
set { this.SetValue(StateProperty, value); }
}
public static readonly DependencyProperty StateProperty = DependencyProperty.Register(
"State", typeof(Boolean), typeof(MyStateControl),new PropertyMetadata(false));
}
Submitted by: Administrator
[C#]
public class MyStateControl : ButtonBase
{
public MyStateControl() : base() { }
public Boolean State
{
get { return (Boolean)this.GetValue(StateProperty); }
set { this.SetValue(StateProperty, value); }
}
public static readonly DependencyProperty StateProperty = DependencyProperty.Register(
"State", typeof(Boolean), typeof(MyStateControl),new PropertyMetadata(false));
}
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. |