Replies: 2 comments 1 reply
-
There is a ResourceSvgConverter, which be used or integrated into your development cycles. If you have CSS with the variables, you can set the values in CssVariables properties of the |
Beta Was this translation helpful? Give feedback.
-
In order achieve the behavior described by @ekalchev we are using ResourceSvgConverter and WpfResourceSettings.
This way the resulting xaml has the names of the brushes:
Is this the correct approach? @paulushub
|
Beta Was this translation helpful? Give feedback.
-
I am working on adding light and dark theme support to my WPF application. The plan is to use SVG resources that will be converted to XAML. To avoid managing two separate WPF resources for each theme, I would like to define colors in the SVG-to-XAML output using DynamicResource. This approach will allow me to switch colors dynamically based on the selected theme by defining the color resources in external resource dictionaries.
For example, instead of hardcoding HEX colors in the XAML, I want the SVG-to-XAML conversion to emit something like:
Brush="{DynamicResource MySolidColor}"
Here, MySolidColor will be defined in an external resource dictionary and can be easily switched when the theme changes.
Example:
and I hope to achieve something like that - Note this two lines
I guess this is probably not supported but I am looking for something that will help me to achieve similar solution. Please advice.
Beta Was this translation helpful? Give feedback.
All reactions