I have created sliders in settings.xaml.cs and added those to a solid brush color. I cannot access them from anywhere except code behind. Is there a way to call them from xaml?
public void sli_ValueChanged(object sender, System.Windows.RoutedPropertyChangedEventArgs<double> e)
{
SolidColorBrush FontBrush = (SolidColorBrush)this.Resources["FontBrush"];
//SolidColorBrush FontBrush = (SolidColorBrush)TryFindResource("FontBrush");
if ((sliR != null) && (sliG != null) && (sliB != null))
{
FontBrush.Color = Color.FromRgb((byte)sliR.Value, (byte)sliG.Value, (byte)sliB.Value);
}
settings.FontBrush = FontBrush;
}
}
This is where the new brush is created and it can be called in code behind but not in any XAML except settings.xaml.