This repository was archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Design time theme colors #224
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Quick stub of the VS file apis required for a potential "Get Link" feature - gets the current file name and line number to build a github url of it for sharing.
Tests are failing on the buildbot and it looks like it's because one test is clobbering data for another test. The only thing these tests share is the global ServiceProvider set, so put these test classes in the same collection so xunit doesn't parallelize them.
Just want to feel like I'm contributing something. 😛
Any xaml file that includes a SharedDictionaryManager resource dictionary with the uri "Theme.xaml" will get a themed dictionary included instead that tracks the VS theme and gets switched at runtime whenever the VS theme changes.
Contributor
Author
|
This is ready for review, but for some reason the PR view (at least for me) is not getting updated to reflect the commits that went into master as part of PR #191, which this branch is based upon. I've reported that bug, and in the meantime if the PR diff is still showing too much unrelated info, use master...shana/theme-colors to review. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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.