Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,34 @@ CannotChangeAttribute : Attribute 'System.ComponentModel.DesignerSerializationVi
CannotChangeAttribute : Attribute 'System.Windows.LocalizabilityAttribute' on 'System.Windows.Style.TargetType' changed from '[LocalizabilityAttribute(17)]' in the contract to '[LocalizabilityAttribute(LocalizationCategory.NeverLocalize)]' in the implementation.
CannotChangeAttribute : Attribute 'System.ComponentModel.DesignerSerializationVisibilityAttribute' on 'System.Windows.Style.Triggers' changed from '[DesignerSerializationVisibilityAttribute(2)]' in the contract to '[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content)]' in the implementation.
CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Windows.StyleTypedPropertyAttribute' changed from '[AttributeUsageAttribute(4, AllowMultiple=true)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple=true)]' in the implementation.
MembersMustExist : Member 'public System.Windows.Media.Color System.Windows.SystemColors.AccentColor.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.Media.SolidColorBrush System.Windows.SystemColors.AccentColorBrush.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorBrushKey.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.Media.Color System.Windows.SystemColors.AccentColorDark1.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.Media.SolidColorBrush System.Windows.SystemColors.AccentColorDark1Brush.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorDark1BrushKey.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorDark1Key.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.Media.Color System.Windows.SystemColors.AccentColorDark2.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.Media.SolidColorBrush System.Windows.SystemColors.AccentColorDark2Brush.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorDark2BrushKey.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorDark2Key.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.Media.Color System.Windows.SystemColors.AccentColorDark3.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.Media.SolidColorBrush System.Windows.SystemColors.AccentColorDark3Brush.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorDark3BrushKey.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorDark3Key.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorKey.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.Media.Color System.Windows.SystemColors.AccentColorLight1.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.Media.SolidColorBrush System.Windows.SystemColors.AccentColorLight1Brush.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorLight1BrushKey.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorLight1Key.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.Media.Color System.Windows.SystemColors.AccentColorLight2.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.Media.SolidColorBrush System.Windows.SystemColors.AccentColorLight2Brush.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorLight2BrushKey.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorLight2Key.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.Media.Color System.Windows.SystemColors.AccentColorLight3.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.Media.SolidColorBrush System.Windows.SystemColors.AccentColorLight3Brush.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorLight3BrushKey.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorLight3Key.get()' does not exist in the implementation but it does exist in the contract.
CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Windows.TemplatePartAttribute' changed from '[AttributeUsageAttribute(4, AllowMultiple=true)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple=true)]' in the implementation.
CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Windows.TemplateVisualStateAttribute' changed from '[AttributeUsageAttribute(4, AllowMultiple=true)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple=true)]' in the implementation.
CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Windows.ThemeInfoAttribute' changed from '[AttributeUsageAttribute(1)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Assembly)]' in the implementation.
Expand Down Expand Up @@ -262,4 +290,4 @@ CannotChangeAttribute : Attribute 'System.ComponentModel.DesignerSerializationVi
CannotChangeAttribute : Attribute 'System.Windows.Markup.DesignerSerializationOptionsAttribute' on 'System.Windows.Markup.XmlAttributeProperties.GetXmlSpace(System.Windows.DependencyObject)' changed from '[DesignerSerializationOptionsAttribute(1)]' in the contract to '[DesignerSerializationOptionsAttribute(DesignerSerializationOptions.SerializeAsAttribute)]' in the implementation.
CannotChangeAttribute : Attribute 'System.ComponentModel.DesignerSerializationVisibilityAttribute' on 'System.Windows.Media.Animation.Storyboard.GetTarget(System.Windows.DependencyObject)' changed from '[DesignerSerializationVisibilityAttribute(0)]' in the contract to '[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]' in the implementation.
CannotChangeAttribute : Attribute 'System.Windows.LocalizabilityAttribute' on 'System.Windows.Shapes.Shape' changed from '[LocalizabilityAttribute(0, Readability=0)]' in the contract to '[LocalizabilityAttribute(LocalizationCategory.None, Readability=Readability.Unreadable)]' in the implementation.
Total Issues: 263
Total Issues: 291
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,7 @@
<Compile Include="System\Windows\Documents\XamlToRtfWriter.cs" />
<Compile Include="System\Windows\Documents\XPSS0ValidatingLoader.cs" />
<Compile Include="System\Windows\Documents\ZoomPercentageConverter.cs" />
<Compile Include="System\Windows\AccentColorHelper.cs" />
<Compile Include="System\Windows\DwmColorization.cs" />
<Compile Include="System\Windows\DynamicResourceExtension.cs" />
<Compile Include="System\Windows\DynamicResourceExtensionConverter.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using System;
using System.Windows.Media;
using System.Windows.Appearance;

using MS.Internal;
using Microsoft.Win32;
using System.Runtime.InteropServices;
using MS.Internal.WindowsRuntime.Windows.UI.ViewManagement;


namespace System.Windows;

internal static class AccentColorHelper
{

#region Internal Methods

internal static Color GetAccentColor(UISettingsRCW.UIColorType uiColorType = UISettingsRCW.UIColorType.Accent)
{
if (UISettings.TryGetColorValue(uiColorType, out Color color))
{
return color;
}

return _defaultAccentColor;
}

#endregion

#region Internal Properties

internal static Color SystemAccentColor
{
get
{
return GetAccentColor(UISettingsRCW.UIColorType.Accent);
}
}

private static UISettings UISettings
{
get
{
if (_uiSettings == null)
{
_uiSettings = new UISettings();
}

return _uiSettings;
}
}

#endregion

#region Private Fields

private static readonly Color _defaultAccentColor = Color.FromArgb(0xff, 0x00, 0x78, 0xd4);

private static UISettings _uiSettings = null;

#endregion
}
Loading