Click here to Skip to main content
15,910,277 members
Home / Discussions / WPF
   

WPF

 
QuestionEditing multiple item types in the same control Pin
gantww21-Aug-09 16:43
gantww21-Aug-09 16:43 
AnswerRe: Editing multiple item types in the same control Pin
Mark Salsbery24-Aug-09 8:43
Mark Salsbery24-Aug-09 8:43 
QuestionFire EventTrigger on WPF Style Change? [SOLVED] Pin
AspDotNetDev21-Aug-09 11:20
protectorAspDotNetDev21-Aug-09 11:20 
AnswerRe: Fire EventTrigger on WPF Style Change? Pin
User 27100922-Aug-09 5:10
User 27100922-Aug-09 5:10 
GeneralRe: Fire EventTrigger on WPF Style Change? Pin
AspDotNetDev22-Aug-09 10:17
protectorAspDotNetDev22-Aug-09 10:17 
GeneralRe: Fire EventTrigger on WPF Style Change? Pin
User 27100922-Aug-09 12:22
User 27100922-Aug-09 12:22 
GeneralRe: Fire EventTrigger on WPF Style Change? Pin
AspDotNetDev22-Aug-09 17:23
protectorAspDotNetDev22-Aug-09 17:23 
GeneralRe: Fire EventTrigger on WPF Style Change? Pin
AspDotNetDev22-Aug-09 22:40
protectorAspDotNetDev22-Aug-09 22:40 
I may have figured out a solution, although it's a little sloppy. I'll post the code once I get it tested, but here's the idea:
  1. Create a custom control. Let's call this control "StyleChangedControl".
  2. StyleChangedControl will expose a custom event, StyleChanged.
  3. When a StyleChangedControl constructor is called, it will subscribe itself to the static event, StyleChangedControl.ApplicationStyleChanged. We'll call this new StyleChangedControl "NewStyleChangedControl".
  4. When I change the application style, I will call StyleChangedControl.NotifyOfStyleChange() (a static method).
  5. NotifyOfStyleChange() will fire the StyleChangedControl.ApplicationStyleChanged event (each NewStyleChangedControl will receive notification of that event).
  6. Once NewStyleChangedControl gets notification of the ApplicationStyleChanged event, it will itself raise its own StyleChanged event.
  7. In the resource dictionary that declares the style that contains the button, there will be an instance of StyleChangedControl.
  8. The button will have an event trigger that is subscribed to that NewStyleChangedControl's StyleChanged event.
  9. When that StyleChanged event gets fired, the event trigger will recognize it, and will then initiate an animation. This will accomplish the goal of firing an animation when the application style changes.


Effectively, I create a custom control that has a custom event that gets fired by the custom control class. There is a static method on that custom control class that allows another class to force the event to fire. Every single instance of the custom control will then receive that event. That event will be recieved by the event trigger in the style and will initiate the animation.

Anyway, that's all very confusing and it seems there must be an easier way. I'm not even sure it will work. I'll get back to you when I have some code to present. In the meantime, feel free to poke holes in the above process Smile | :)

Visual Studio is an excellent GUIIDE.

GeneralRe: Fire EventTrigger on WPF Style Change? Pin
User 27100923-Aug-09 4:43
User 27100923-Aug-09 4:43 
AnswerRe: Fire EventTrigger on WPF Style Change? [SOLUTION] Pin
AspDotNetDev23-Aug-09 15:09
protectorAspDotNetDev23-Aug-09 15:09 
Questionservice Cross-domain issue. Pin
thrakazog21-Aug-09 8:33
thrakazog21-Aug-09 8:33 
AnswerResolved. Pin
thrakazog21-Aug-09 9:52
thrakazog21-Aug-09 9:52 
QuestionSheet music Pin
Tony Pottier21-Aug-09 5:58
Tony Pottier21-Aug-09 5:58 
AnswerRe: Sheet music Pin
#realJSOP21-Aug-09 7:12
professional#realJSOP21-Aug-09 7:12 
GeneralRe: Sheet music Pin
Tony Pottier21-Aug-09 10:59
Tony Pottier21-Aug-09 10:59 
GeneralRe: Sheet music Pin
Richard MacCutchan31-Aug-09 5:19
mveRichard MacCutchan31-Aug-09 5:19 
QuestionHow to handle Different Modules in MVP ?? Pin
Krishna Aditya20-Aug-09 22:50
Krishna Aditya20-Aug-09 22:50 
AnswerRe: How to handle Different Modules in MVP ?? Pin
Richard MacCutchan31-Aug-09 5:32
mveRichard MacCutchan31-Aug-09 5:32 
QuestionHow to stretch the image of (1* 66 ) pixel Pin
Krishna Aditya20-Aug-09 5:15
Krishna Aditya20-Aug-09 5:15 
AnswerRe: How to stretch the image of (1* 66 ) pixel Pin
Krishna Aditya20-Aug-09 5:53
Krishna Aditya20-Aug-09 5:53 
QuestionNavigation framework in tabs Pin
tcook81520-Aug-09 2:50
tcook81520-Aug-09 2:50 
AnswerRe: Navigation framework in tabs Pin
Michael Sync29-Aug-09 18:56
Michael Sync29-Aug-09 18:56 
QuestionHow to create a collapsible panel in WPF Pin
Krishna Aditya19-Aug-09 23:45
Krishna Aditya19-Aug-09 23:45 
AnswerRe: How to create a collapsible panel in WPF Pin
Pete O'Hanlon20-Aug-09 0:08
mvePete O'Hanlon20-Aug-09 0:08 
GeneralRe: How to create a collapsible panel in WPF Pin
abetterword29-Dec-10 9:20
abetterword29-Dec-10 9:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.