Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Conversation

@shana
Copy link
Contributor

@shana shana commented Feb 23, 2016

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.cs resource dictionary implementation.

To see things at design time, switch to the XamlDesigner build configuration in VS and build the solution (it should only build GitHub.VisualStudio if 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 the XamlDesigner configuration 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.xaml file in GitHub.VisualStudio defines hardcoded values for the VS colors that we use and loads the dark theme - this xaml file is switched at runtime with the ThemeXXX.xaml file that corresponds to what VS is running. If you prefer designing in another theme, change the theme file that ThemeDesignTime.xaml is loading and change the vs colors to the appropriate theme.

@haacked
Copy link
Contributor

haacked commented Feb 23, 2016

Works like a dream. ☁️ ✨

haacked added a commit that referenced this pull request Feb 23, 2016
@haacked haacked merged commit d2c6069 into master Feb 23, 2016
@haacked haacked deleted the shana/theme-colors branch February 23, 2016 21:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants