The SetResourceReference method allows a Button control to reference a resource defined in XAML. Resources can be defined in the Resources section of the XAML file or in a separate resource dictionary. The SetResourceReference method takes two parameters: the first is the property to set and the second is a resource key that identifies the resource to reference.
Code Examples:
Example 1: Set the Content property of a button to a resource defined in XAML.
Example 2: Set the Background property of a button to a resource defined in a separate resource dictionary.
Package Library:
The SetResourceReference method is part of the System.Windows.Controls namespace, which is part of the .NET Framework class library.
C# (CSharp) System.Windows.Controls Button.SetResourceReference - 34 examples found. These are the top rated real world C# (CSharp) examples of System.Windows.Controls.Button.SetResourceReference extracted from open source projects. You can rate examples to help us improve the quality of examples.