| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Input;
- namespace CustomUI
- {
- public class CheckComboBoxItem : ListBoxItem
- {
- #region private fields
- private CheckComboBox ParentCheckComboBox
- {
- get
- {
- return ItemsControl.ItemsControlFromItemContainer(this) as CheckComboBox;
- }
- }
- #endregion
- #region DependencyProperty
- #endregion
- #region Constructors
- static CheckComboBoxItem()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(CheckComboBoxItem), new FrameworkPropertyMetadata(typeof(CheckComboBoxItem)));
- }
- #endregion
- #region Override
- public override void OnApplyTemplate()
- {
- base.OnApplyTemplate();
- }
- protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
- {
- if(this.ParentCheckComboBox != null)
- {
- this.ParentCheckComboBox.NotifyCheckComboBoxItemClicked(this);
- }
- base.OnMouseLeftButtonDown(e);
- }
- #endregion
- #region private function
- #endregion
- #region Event Implement Function
- #endregion
- }
- }
|