// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code using System; using System.ComponentModel; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Input; namespace Microsoft.Management.UI.Internal { /// /// This control provides basic functionality for Picker-like controls. /// /// /// /// /// If a custom template is provided for this control, then the template MUST provide the following template parts: /// /// PART_DropDown - A required template part which must be of type DismissiblePopup. The dropdown which hosts the picker. /// PART_DropDownButton - A required template part which must be of type ToggleButton. The ToggleButton which controls whether the dropdown is open. /// /// [TemplatePart(Name="PART_DropDown", Type=typeof(DismissiblePopup))] [TemplatePart(Name="PART_DropDownButton", Type=typeof(ToggleButton))] [Localizability(LocalizationCategory.None)] partial class PickerBase { // // Fields // private DismissiblePopup dropDown; private ToggleButton dropDownButton; // // CloseDropDown routed command // /// /// Informs the PickerBase that it should close the dropdown. /// public static readonly RoutedCommand CloseDropDownCommand = new RoutedCommand("CloseDropDown",typeof(PickerBase)); static private void CloseDropDownCommand_CommandExecuted(object sender, ExecutedRoutedEventArgs e) { PickerBase obj = (PickerBase) sender; obj.OnCloseDropDownExecuted( e ); } /// /// Called when CloseDropDown executes. /// /// /// Informs the PickerBase that it should close the dropdown. /// protected virtual void OnCloseDropDownExecuted(ExecutedRoutedEventArgs e) { OnCloseDropDownExecutedImplementation(e); } partial void OnCloseDropDownExecutedImplementation(ExecutedRoutedEventArgs e); // // DropDownButtonTemplate dependency property // /// /// Identifies the DropDownButtonTemplate dependency property. /// public static readonly DependencyProperty DropDownButtonTemplateProperty = DependencyProperty.Register( "DropDownButtonTemplate", typeof(ControlTemplate), typeof(PickerBase), new PropertyMetadata( null, DropDownButtonTemplateProperty_PropertyChanged) ); /// /// Gets or sets a value that controls the visual tree of the DropDown button. /// [Bindable(true)] [Category("Common Properties")] [Description("Gets or sets a value that controls the visual tree of the DropDown button.")] [Localizability(LocalizationCategory.None)] public ControlTemplate DropDownButtonTemplate { get { return (ControlTemplate) GetValue(DropDownButtonTemplateProperty); } set { SetValue(DropDownButtonTemplateProperty,value); } } static private void DropDownButtonTemplateProperty_PropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { PickerBase obj = (PickerBase) o; obj.OnDropDownButtonTemplateChanged( new PropertyChangedEventArgs((ControlTemplate)e.OldValue, (ControlTemplate)e.NewValue) ); } /// /// Occurs when DropDownButtonTemplate property changes. /// public event EventHandler> DropDownButtonTemplateChanged; /// /// Called when DropDownButtonTemplate property changes. /// protected virtual void OnDropDownButtonTemplateChanged(PropertyChangedEventArgs e) { OnDropDownButtonTemplateChangedImplementation(e); RaisePropertyChangedEvent(DropDownButtonTemplateChanged, e); } partial void OnDropDownButtonTemplateChangedImplementation(PropertyChangedEventArgs e); // // DropDownStyle dependency property // /// /// Identifies the DropDownStyle dependency property. /// public static readonly DependencyProperty DropDownStyleProperty = DependencyProperty.Register( "DropDownStyle", typeof(Style), typeof(PickerBase), new PropertyMetadata( null, DropDownStyleProperty_PropertyChanged) ); /// /// Gets or sets the style of the drop-down. /// [Bindable(true)] [Category("Common Properties")] [Description("Gets or sets the style of the drop-down.")] [Localizability(LocalizationCategory.None)] public Style DropDownStyle { get { return (Style) GetValue(DropDownStyleProperty); } set { SetValue(DropDownStyleProperty,value); } } static private void DropDownStyleProperty_PropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { PickerBase obj = (PickerBase) o; obj.OnDropDownStyleChanged( new PropertyChangedEventArgs