Sonntag, 5. September 2010

Um in diesem Forum zu schreiben, bitte registrieren oder anmelden (siehe Link oben rechts auf dieser Seite). Das Registrieren ist kostenlos und wird sofort wirksam.

Forum
 
  Forum  PCPANEL.NET  Questions, Requ...  Changing Control State in WPF Control Behind
vorherige vorherige
 
Nächste Nächste
neuer Beitrag 10.02.2010 06:37
ungelöst
  Hussain Alrashed
1 Beiträge
keine Bewertung


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

 
neuer Beitrag 12.02.2010 07:03
  christian
16 Beiträge
keine Bewertung


Re: Changing Control State in WPF Control Behind 
bearbeitet durch christian  am 12.02.2010 11:17:30)

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

 
vorherige vorherige
 
Nächste Nächste
  Forum  PCPANEL.NET  Questions, Requ...  Changing Control State in WPF Control Behind
Datenschutzerklärung  |  Nutzungsbedingungen
Copyright 2009 by AIT Software GmbH