From 1615cffe0029c5dc0fd023a1eb8a109f8b41c4ff Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 7 Aug 2015 01:21:27 +0200 Subject: [PATCH] Correctly color items depending on focus. --- Perspex.Themes.Default/ListBoxItemStyle.cs | 7 +++++++ Perspex.Themes.Default/TreeViewItemStyle.cs | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/Perspex.Themes.Default/ListBoxItemStyle.cs b/Perspex.Themes.Default/ListBoxItemStyle.cs index f54f1c1210..bdb6212cfc 100644 --- a/Perspex.Themes.Default/ListBoxItemStyle.cs +++ b/Perspex.Themes.Default/ListBoxItemStyle.cs @@ -27,6 +27,13 @@ namespace Perspex.Themes.Default }, }, new Style(x => x.OfType().Class("selected").Template().Name("border")) + { + Setters = new[] + { + new Setter(ListBoxItem.BackgroundProperty, new SolidColorBrush(0xfff0f0f0)), + }, + }, + new Style(x => x.OfType().Class("selected").Class(":focus").Template().Name("border")) { Setters = new[] { diff --git a/Perspex.Themes.Default/TreeViewItemStyle.cs b/Perspex.Themes.Default/TreeViewItemStyle.cs index bf82301591..73c43452fd 100644 --- a/Perspex.Themes.Default/TreeViewItemStyle.cs +++ b/Perspex.Themes.Default/TreeViewItemStyle.cs @@ -38,6 +38,13 @@ namespace Perspex.Themes.Default }, }, new Style(x => x.OfType().Class("selected").Template().Name("header")) + { + Setters = new[] + { + new Setter(TreeViewItem.BackgroundProperty, new SolidColorBrush(0xfff0f0f0)), + }, + }, + new Style(x => x.OfType().Class("selected").Class(":focus").Template().Name("header")) { Setters = new[] {