This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Design time theme colors #225
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I had to create a new PR, the previous one refused to refresh with master (sigh).
Depends on
This PR fixes theme colors so that it's possible to use the xaml designer in VS to see how things look.
Seems like the xaml designer completely borks if a ResourceDictionary implements the Source property (which is kind of mandatory for caching resource dictionaries and doing the runtime theme swapping thing), so I've added a separate build configuration with a define that ifdefs the Source property in our
SharedDictionaryManager.csresource dictionary implementation.To see things at design time, switch to the
XamlDesignerbuild configuration in VS and build the solution (it should only buildGitHub.VisualStudioif you're coming from a debug build, so it should be fast to switch). After that, xaml files should render properly and be designable in the VS xaml designer. Builds with theXamlDesignerconfiguration will always use the dark theme, so they won't reflect the current theme at runtime (use Debug or Release builds to see theming at runtime).The
Styles\ThemeDesignTime.xamlfile inGitHub.VisualStudiodefines hardcoded values for the VS colors that we use and loads the dark theme - this xaml file is switched at runtime with theThemeXXX.xamlfile that corresponds to what VS is running. If you prefer designing in another theme, change the theme file thatThemeDesignTime.xamlis loading and change the vs colors to the appropriate theme.