I have a brush as a Resource:
<Application.Resources>
<SolidColorBrush x:Key="AppBrush" Color="#FFFFFF"/>
</Application.Resources>
and I want to use it's Color
:
<... BackgroundColor="{StaticResource AppBrush.Color}"/>
But it isn't possible and I get a xaml corruption error. How can I do that?
or in other away how to use Brush's Color
in another Color
resource:
<Application.Resources>
<Color x:Key="AppColor">#FFFFFF { here how to use AppBrush.Color?}</Color>
<SolidColorBrush x:Key="AppBrush" Color="#FFFFFF"/>
</Application.Resources>
it's even easier:
BackgroundColor="{StaticResource AppBrush}"
or try this
<Application.Resources>
<Color x:Key="AppColor">#FFFFFF</Color>
<SolidColorBrush x:Key="AppBrush" Color="{StaticResource AppColor}"/
</Application.Resources>
Try this:
BackgroundColor="{Binding Color, Source={StaticResource AppBrush}}"
This will only work if AppBrush
is a SolidColorBrush
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With