File size: 2,888 Bytes
8c763fb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#region StyleCop Suppression - generated code
using System;
using System.ComponentModel;
using System.Windows;
namespace Microsoft.Management.UI.Internal
{
/// <summary>
/// A toggle button which controls is a popup is open or not.
/// </summary>
[Localizability(LocalizationCategory.None)]
partial class PopupControlButton
{
//
// IsPopupOpen dependency property
//
/// <summary>
/// Identifies the IsPopupOpen dependency property.
/// </summary>
public static readonly DependencyProperty IsPopupOpenProperty = DependencyProperty.Register( "IsPopupOpen", typeof(bool), typeof(PopupControlButton), new FrameworkPropertyMetadata( BooleanBoxes.FalseBox, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, IsPopupOpenProperty_PropertyChanged) );
/// <summary>
/// Gets or sets a value indicating whether the popup is open or not.
/// </summary>
/// <remarks>
/// The Popup.IsOpen property should be two-way bound to this property.
/// </remarks>
[Bindable(true)]
[Category("Common Properties")]
[Description("Gets or sets a value indicating whether the popup is open or not.")]
[Localizability(LocalizationCategory.None)]
public bool IsPopupOpen
{
get
{
return (bool) GetValue(IsPopupOpenProperty);
}
set
{
SetValue(IsPopupOpenProperty,BooleanBoxes.Box(value));
}
}
static private void IsPopupOpenProperty_PropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
PopupControlButton obj = (PopupControlButton) o;
obj.OnIsPopupOpenChanged( new PropertyChangedEventArgs<bool>((bool)e.OldValue, (bool)e.NewValue) );
}
/// <summary>
/// Occurs when IsPopupOpen property changes.
/// </summary>
public event EventHandler<PropertyChangedEventArgs<bool>> IsPopupOpenChanged;
/// <summary>
/// Called when IsPopupOpen property changes.
/// </summary>
protected virtual void OnIsPopupOpenChanged(PropertyChangedEventArgs<bool> e)
{
OnIsPopupOpenChangedImplementation(e);
RaisePropertyChangedEvent(IsPopupOpenChanged, e);
}
partial void OnIsPopupOpenChangedImplementation(PropertyChangedEventArgs<bool> e);
/// <summary>
/// Called when a property changes.
/// </summary>
private void RaisePropertyChangedEvent<T>(EventHandler<PropertyChangedEventArgs<T>> eh, PropertyChangedEventArgs<T> e)
{
if (eh != null)
{
eh(this,e);
}
}
}
}
#endregion
|