From b3ad5ff1dd65300edb00a1a66d7efc7c6b020a85 Mon Sep 17 00:00:00 2001 From: brianlagunas_cp Date: Mon, 27 Jun 2011 18:06:23 +0000 Subject: [PATCH] minor changes to CheckListBox --- .../Implementation/CheckListBoxItem.cs | 14 ++++++++++++++ .../CheckListBox/Themes/Generic.xaml | 14 ++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CheckListBox/Implementation/CheckListBoxItem.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CheckListBox/Implementation/CheckListBoxItem.cs index 17649cee..af1b723c 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CheckListBox/Implementation/CheckListBoxItem.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CheckListBox/Implementation/CheckListBoxItem.cs @@ -22,6 +22,11 @@ namespace Microsoft.Windows.Controls DefaultStyleKeyProperty.OverrideMetadata(typeof(CheckListBoxItem), new FrameworkPropertyMetadata(typeof(CheckListBoxItem))); } + public CheckListBoxItem() + { + AddHandler(Mouse.MouseDownEvent, new MouseButtonEventHandler(CheckListBoxItem_MouseDown)); + } + #region Properties public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register("IsSelected", typeof(bool), typeof(CheckListBoxItem), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsSelectedChanged)); @@ -55,6 +60,15 @@ namespace Microsoft.Windows.Controls #endregion + #region Event Hanlders + + void CheckListBoxItem_MouseDown(object sender, MouseButtonEventArgs e) + { + IsSelected = !IsSelected; + } + + #endregion //Event Hanlders + #region Methods private void RaiseSelectionChangedEvent(RoutedEventArgs e) diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CheckListBox/Themes/Generic.xaml b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CheckListBox/Themes/Generic.xaml index 4714eca7..ed0f08c6 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CheckListBox/Themes/Generic.xaml +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CheckListBox/Themes/Generic.xaml @@ -5,6 +5,8 @@ xmlns:coreConverters="clr-namespace:Microsoft.Windows.Controls.Core.Converters"> -