I have some styles that change at runtime, so naturally I am using XAML like this:
<Style x:Key="ThemedFrame" TargetType="Frame"> <Setter Property="BackgroundColor" Value="{DynamicResource ThemeColorSurfacedp1}" /> <Setter Property="BorderColor" Value="{DynamicResource ThemeColorSurfacedp24}" /> </Style>
This approach, however, requires I create a variety of resources for all possible combinations of Color elevations (and other things such as opacity).
I'd prefer to do something like this:
<Style x:Key="ThemedFrame" TargetType="Frame"> <Setter Property="BackgroundColor" Value="{DynamicResource ThemeColorSurface, Elevation=1}" /> <Setter Property="BorderColor" Value="{DynamicResource ThemeColorSurface, Elevation=24" /> </Style>
I've been trying to work out if it is possible to create a custom markup extension that either works the same way as DynamicResource with additional properties (as per my example), or somehow combine a DynamicResource with a Converter.
Does anyone know if this is even remotely possible?