Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Use a prototype TextBlock to resolve theme resources on Windows #703
Description of Change
On the Windows platforms, the device styles were being retrieved and copied into the Forms resource dictionary by walking up the style tree and retrieving the Setter values. However, this fails when the walk up the style tree encounters a Setter whose value is a binding expression (e.g., to ThemeResource). Because of this, most of the built-in device styles do not render at all on the Windows platforms.
Rather than walk the tree, this change creates a TextBlock, applies the style to it, and retrieves the resolved values for use in the Forms resource dictionary. This allows it to retrieve values which come from ThemeResource bindings. The rendered device styles now match more closely with the values in WinRT apps created in Blend:
This also applies to UWP, but I got tired of taking screenshots.