Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Application Program Interviews:AutoCADBEA WeblogicBioinformaticsBizTalk ServerBug Tracking ToolsBugzillaClarify CRMCoding StandardsComputer Aided Design (CAD) DesignerCVSGIMPJMXLINQLoadRunnerMagentoMATLABMicrosoft AccessMicrosoft ExcelMicrosoft OfficeMicrosoft OutlookMicrosoft WordModel View Controller (MVC)OLAPOOADQuickbookRational RobotRDFSchemaSiebelSilkTestSVGTest PlanTesting ToolsUnity 3D DeveloperVRMLWCF SDKWPFXML DOMXPointer
Copyright © 2018. All Rights Reserved
WPF Interview Question:
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
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.