Issue
Is it possible in XAML to add a reference to resource? For example I have
<Color x:Key="LightRed">#e24c3f</Color>
and I need to have something like
<Color x:Key="ErrorColor">*LightRed*</Color>.
Solution
No, a Color resource cannot reference another Color resource if that's what you are asking.
As suggested by @Nawed Nabi Zada, you may define a brush that uses any color resource though:
<SolidColorBrush x:Key="ErrorBrush" Color="{StaticResource LightRed}"/>
You can easily change the colour of the brush in one place.
Answered By - mm8
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.