Sunday, September 05, 2010

Please register or login (see links at the top-right corner of this page) to post in this Forum. Registration is free and becomes valid immediately.

Forum
 
  Forum  PCPANEL.NET  Questions, Requ...  Changing Control State in WPF Control Behind
Previous Previous
 
Next Next
New Post 2/10/2010 6:37 AM
Unresolved
  Hussain Alrashed
1 posts
No Ranking


Changing Control State in WPF Control Behind 

Hello,

I’ve noticed that the states of your WPF controls is updated via a data source in XAML in your sample applications, I would like to do that in code behind,
Is that possible?
For example I defined for a pushbutton a certain controlscolors state, And the I would like to apply the defined state in code behind to get the control to blink or flash
Can that be done?

Thanks

 
New Post 2/12/2010 7:03 AM
  christian
16 posts
No Ranking


Re: Changing Control State in WPF Control Behind 
Modified By christian  on 2/12/2010 11:17:30 AM)

Hussain,

yes, that's absolutely possible. You can access the States property of the control in your code. However, the States property is defined as the base class StatesBase in our library and in your XAML (or using the WPF property editor) you usually choose one of the sub classes StatesStandard, StatesBool or StatesBitmask for the concrete instance. So in your code you need to cast to the class you chose like this:

StatesStandard states = (StatesStandard)this.pushButton1.States;
states.Critical = true;

Kind Regards
Echo

 
Previous Previous
 
Next Next
  Forum  PCPANEL.NET  Questions, Requ...  Changing Control State in WPF Control Behind
Privacy Statement  |  Terms Of Use
Copyright 2009 by AIT Software GmbH