Skip to content

jeromerg/WpfResourceChangeEvent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ResourceChangeEvent

(C# WPF) Subscribe event handlers to resource change event

Description

Introduces a Behavior, that triggers an event on each change of a specific WPF resource.

Usage

Add following behavior to your XAML file:

  <i:Interaction.Behaviors>
    <resourceChangeEvent:ResourceChangeEventBehavior 
      Resource="{DynamicResource VariableFontSize}" 
      ResourceChanged="OnResourceChanged_VariableFontSize"/>
  </i:Interaction.Behaviors>

Where

  • VariableFontSize is the name of the resource that you want to monitor
  • OnResourceChanged_VariableFontSize is the event-handler in your code behind, that handle the event

For more details, see the example Project.

Installation

you have the choice:

  • Add the project 'ResourceChangeEvent' to your solution
  • Copy the files of the project 'ResourceChangeEvent' to your Util project
  • Compile the solution 'ResourceChangeEvent' and copy the dll ResourceChangeEvent.dll

About

(C# WPF) Subscribe event handlers to resource change event

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages