I have a SolidColorBrush defined in a Resource Dictionary as follows:
<Color x:Key="ColorGray100">#F5F6F7</Color>
<SolidColorBrush x:Key="BrushGray100" Color="{DynamicResource ColorGray100}" />
I have a Dependency Property defined in the code behind for a user control as follows:
/// <summary>
/// get/set the brush for the pattern ring.
/// The pattern ring is a full circle which the progress ring is drawn over.
/// This Brush value is defaulted to Brushes.LightGray
/// </summary>
public Brush PatternRingBrush
{
get => (Brush)GetValue(PatternRingBrushProperty);
set => SetValue(PatternRingBrushProperty, value);
}
public static readonly DependencyProperty PatternRingBrushProperty =
DependencyProperty.Register("PatternRingBrush", typeof(Brush), typeof(UXProgressRing),
new UIPropertyMetadata(Brushes.LightGray));
How can I assign the "BrushGray100" SolidColorBrush as the default UIPropertyMetadata value instead of Brushes.LightGray?