systemcolors

ComponentResourceKey as DynamicResource problem

别来无恙 提交于 2019-12-24 00:23:58
问题 I'm seeing some unexpected behavior using ComponentResourceKey. The problem came up because I was using names used in the SystemColors class. Consider the following code: First I expose a ComponentResourceKey in a as a static property: public enum ColorKeys { ControlColor } public class MyColors { public static ComponentResourceKey ControlColorKey { get { return new ComponentResourceKey(typeof(MyColors), ColorKeys.ControlColor); } } } Using the key in markup to assign a resource to that key

Overriding SystemColors in local Resources dictionary

半世苍凉 提交于 2019-12-22 01:36:19
问题 I'm trying to hide the visual hints that indicate selection in a WPF ListBox . This answer suggests this should work by overriding the SystemColors for that ListBox . I created a new WPF project and edited the MainWindow.xaml like this: <Window x:Class="WpfListboxWithoutSelection.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http:/

Setting the Inactive Highlight Colour of a WPF ListBox to the Active Highlight Colour

浪尽此生 提交于 2019-12-13 14:26:53
问题 I'm trying to make a ListBox where highlighted items look the same regardless of if the ListBox has focus or not. Essentially I want to set the SystemColors.ControlBrushKey color property to be the same as the SystemColors.HighlightBrushKey color. I thought I could use the following: <ListBox> <ListBox.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/> </ListBox.Resources> </ListBox> But this

Matching windows system colors: light on dark

别等时光非礼了梦想. 提交于 2019-12-13 00:30:01
问题 I'm trying to make my app a good Windows citizen, so I use matching system colors (see "When selecting system colors, match but don't mix") as much as possible. However, sometimes light text on a dark background (something like COLOR_APPWORKSPACE/clAppWorkSpace) seems most appropriate, but the system doesn't provide this. Do you have any recommendations regarding this? 回答1: You could swap two colors. For example, if you can read InfoText colored text on a InfoBackground colored background,

Cannot add system color in styles in Silverlight?

血红的双手。 提交于 2019-12-12 15:25:49
问题 I defined resource in XAML for SystemColors. It is working great if I set Foregroung property directly to the TextBlock. However, I am getting an error shown below if I assign foreground property in style. I am not sure what is the issue and how to solve it. Any ideas are highly appreciated! Code when I set foreground directly in the texblock. It is working perfectly <TextBlock Text="WindowTextColor" Foreground="{Binding WindowTextColor, Source={StaticResource SystemColors}, Converter=

Why don't WPF themes use SystemColors?

时光怂恿深爱的人放手 提交于 2019-12-01 09:29:36
Looking at the various open source themes available for WPF, I'm a bit surprised to see that colours aren't mapped to system colours. So if you change your overall system configuration, these themes won't change to suit. Are there any themes that properly use the system colours, and if so, how do I write a button style that will leverage those colours? To give an example, here's the style of a button: <Style x:Key="specialButton" TargetType="Button"> <Setter Property="SnapsToDevicePixels" Value="True"/> <Setter Property="OverridesDefaultStyle" Value="True"/> <Setter Property="FocusVisualStyle"

Why don't WPF themes use SystemColors?

99封情书 提交于 2019-12-01 05:53:25
问题 Looking at the various open source themes available for WPF, I'm a bit surprised to see that colours aren't mapped to system colours. So if you change your overall system configuration, these themes won't change to suit. Are there any themes that properly use the system colours, and if so, how do I write a button style that will leverage those colours? To give an example, here's the style of a button: <Style x:Key="specialButton" TargetType="Button"> <Setter Property="SnapsToDevicePixels"

Is there a Visual guide to System.Windows.SystemColors? [closed]

流过昼夜 提交于 2019-11-30 14:00:08
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . All throughout the Windows UX Guide it is suggested to use the appropriate SystemColors within an application to ensure that an application's default theme is consistent with the rest of the system. I totally agree; the only problem is that there seems to be no guide for how named values within the SystemColors

Is there a Visual guide to System.Windows.SystemColors? [closed]

∥☆過路亽.° 提交于 2019-11-30 09:22:23
All throughout the Windows UX Guide it is suggested to use the appropriate SystemColors within an application to ensure that an application's default theme is consistent with the rest of the system. I totally agree; the only problem is that there seems to be no guide for how named values within the SystemColors type map to actual common parts of a typical user interface. Instead we are given names like Caption and expected to understand what controls that will apply to. Is there anywhere that a developer can find a decent set of Visual Guidelines for how the values in SystemColors maps to a