File size: 10,958 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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | // 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.Input;
namespace Microsoft.Management.UI.Internal
{
/// <summary>
/// A popup which child controls can signal to be dismissed.
/// </summary>
/// <remarks>
/// If a control wants to dismiss the popup then they should execute the DismissPopupCommand on a target in the popup window.
/// </remarks>
[Localizability(LocalizationCategory.None)]
partial class DismissiblePopup
{
//
// DismissPopup routed command
//
/// <summary>
/// A command which child controls can use to tell the popup to close.
/// </summary>
public static readonly RoutedCommand DismissPopupCommand = new RoutedCommand("DismissPopup",typeof(DismissiblePopup));
static private void DismissPopupCommand_CommandExecuted(object sender, ExecutedRoutedEventArgs e)
{
DismissiblePopup obj = (DismissiblePopup) sender;
obj.OnDismissPopupExecuted( e );
}
/// <summary>
/// Called when DismissPopup executes.
/// </summary>
/// <remarks>
/// A command which child controls can use to tell the popup to close.
/// </remarks>
protected virtual void OnDismissPopupExecuted(ExecutedRoutedEventArgs e)
{
OnDismissPopupExecutedImplementation(e);
}
partial void OnDismissPopupExecutedImplementation(ExecutedRoutedEventArgs e);
//
// CloseOnEscape dependency property
//
/// <summary>
/// Identifies the CloseOnEscape dependency property.
/// </summary>
public static readonly DependencyProperty CloseOnEscapeProperty = DependencyProperty.Register( "CloseOnEscape", typeof(bool), typeof(DismissiblePopup), new PropertyMetadata( BooleanBoxes.TrueBox, CloseOnEscapeProperty_PropertyChanged) );
/// <summary>
/// Gets or sets a value indicating whether the popup closes when ESC is pressed.
/// </summary>
[Bindable(true)]
[Category("Common Properties")]
[Description("Gets or sets a value indicating whether the popup closes when ESC is pressed.")]
[Localizability(LocalizationCategory.None)]
public bool CloseOnEscape
{
get
{
return (bool) GetValue(CloseOnEscapeProperty);
}
set
{
SetValue(CloseOnEscapeProperty,BooleanBoxes.Box(value));
}
}
static private void CloseOnEscapeProperty_PropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
DismissiblePopup obj = (DismissiblePopup) o;
obj.OnCloseOnEscapeChanged( new PropertyChangedEventArgs<bool>((bool)e.OldValue, (bool)e.NewValue) );
}
/// <summary>
/// Occurs when CloseOnEscape property changes.
/// </summary>
public event EventHandler<PropertyChangedEventArgs<bool>> CloseOnEscapeChanged;
/// <summary>
/// Called when CloseOnEscape property changes.
/// </summary>
protected virtual void OnCloseOnEscapeChanged(PropertyChangedEventArgs<bool> e)
{
OnCloseOnEscapeChangedImplementation(e);
RaisePropertyChangedEvent(CloseOnEscapeChanged, e);
}
partial void OnCloseOnEscapeChangedImplementation(PropertyChangedEventArgs<bool> e);
//
// FocusChildOnOpen dependency property
//
/// <summary>
/// Identifies the FocusChildOnOpen dependency property.
/// </summary>
public static readonly DependencyProperty FocusChildOnOpenProperty = DependencyProperty.Register( "FocusChildOnOpen", typeof(bool), typeof(DismissiblePopup), new PropertyMetadata( BooleanBoxes.TrueBox, FocusChildOnOpenProperty_PropertyChanged) );
/// <summary>
/// Gets or sets a value indicating whether focus should be set on the child when the popup opens.
/// </summary>
[Bindable(true)]
[Category("Common Properties")]
[Description("Gets or sets a value indicating whether focus should be set on the child when the popup opens.")]
[Localizability(LocalizationCategory.None)]
public bool FocusChildOnOpen
{
get
{
return (bool) GetValue(FocusChildOnOpenProperty);
}
set
{
SetValue(FocusChildOnOpenProperty,BooleanBoxes.Box(value));
}
}
static private void FocusChildOnOpenProperty_PropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
DismissiblePopup obj = (DismissiblePopup) o;
obj.OnFocusChildOnOpenChanged( new PropertyChangedEventArgs<bool>((bool)e.OldValue, (bool)e.NewValue) );
}
/// <summary>
/// Occurs when FocusChildOnOpen property changes.
/// </summary>
public event EventHandler<PropertyChangedEventArgs<bool>> FocusChildOnOpenChanged;
/// <summary>
/// Called when FocusChildOnOpen property changes.
/// </summary>
protected virtual void OnFocusChildOnOpenChanged(PropertyChangedEventArgs<bool> e)
{
OnFocusChildOnOpenChangedImplementation(e);
RaisePropertyChangedEvent(FocusChildOnOpenChanged, e);
}
partial void OnFocusChildOnOpenChangedImplementation(PropertyChangedEventArgs<bool> e);
//
// SetFocusOnClose dependency property
//
/// <summary>
/// Identifies the SetFocusOnClose dependency property.
/// </summary>
public static readonly DependencyProperty SetFocusOnCloseProperty = DependencyProperty.Register( "SetFocusOnClose", typeof(bool), typeof(DismissiblePopup), new PropertyMetadata( BooleanBoxes.FalseBox, SetFocusOnCloseProperty_PropertyChanged) );
/// <summary>
/// Indicates whether the focus returns to either a defined by the FocusOnCloseTarget dependency property UIElement or PlacementTarget or not.
/// </summary>
[Bindable(true)]
[Category("Common Properties")]
[Description("Indicates whether the focus returns to either a defined by the FocusOnCloseTarget dependency property UIElement or PlacementTarget or not.")]
[Localizability(LocalizationCategory.None)]
public bool SetFocusOnClose
{
get
{
return (bool) GetValue(SetFocusOnCloseProperty);
}
set
{
SetValue(SetFocusOnCloseProperty,BooleanBoxes.Box(value));
}
}
static private void SetFocusOnCloseProperty_PropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
DismissiblePopup obj = (DismissiblePopup) o;
obj.OnSetFocusOnCloseChanged( new PropertyChangedEventArgs<bool>((bool)e.OldValue, (bool)e.NewValue) );
}
/// <summary>
/// Occurs when SetFocusOnClose property changes.
/// </summary>
public event EventHandler<PropertyChangedEventArgs<bool>> SetFocusOnCloseChanged;
/// <summary>
/// Called when SetFocusOnClose property changes.
/// </summary>
protected virtual void OnSetFocusOnCloseChanged(PropertyChangedEventArgs<bool> e)
{
OnSetFocusOnCloseChangedImplementation(e);
RaisePropertyChangedEvent(SetFocusOnCloseChanged, e);
}
partial void OnSetFocusOnCloseChangedImplementation(PropertyChangedEventArgs<bool> e);
//
// SetFocusOnCloseElement dependency property
//
/// <summary>
/// Identifies the SetFocusOnCloseElement dependency property.
/// </summary>
public static readonly DependencyProperty SetFocusOnCloseElementProperty = DependencyProperty.Register( "SetFocusOnCloseElement", typeof(UIElement), typeof(DismissiblePopup), new PropertyMetadata( null, SetFocusOnCloseElementProperty_PropertyChanged) );
/// <summary>
/// If the SetFocusOnClose property is set True and this property is set to a valid UIElement, focus returns to this UIElement after the DismissiblePopup is closed.
/// </summary>
[Bindable(true)]
[Category("Common Properties")]
[Description("If the SetFocusOnClose property is set True and this property is set to a valid UIElement, focus returns to this UIElement after the DismissiblePopup is closed.")]
[Localizability(LocalizationCategory.None)]
public UIElement SetFocusOnCloseElement
{
get
{
return (UIElement) GetValue(SetFocusOnCloseElementProperty);
}
set
{
SetValue(SetFocusOnCloseElementProperty,value);
}
}
static private void SetFocusOnCloseElementProperty_PropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
DismissiblePopup obj = (DismissiblePopup) o;
obj.OnSetFocusOnCloseElementChanged( new PropertyChangedEventArgs<UIElement>((UIElement)e.OldValue, (UIElement)e.NewValue) );
}
/// <summary>
/// Occurs when SetFocusOnCloseElement property changes.
/// </summary>
public event EventHandler<PropertyChangedEventArgs<UIElement>> SetFocusOnCloseElementChanged;
/// <summary>
/// Called when SetFocusOnCloseElement property changes.
/// </summary>
protected virtual void OnSetFocusOnCloseElementChanged(PropertyChangedEventArgs<UIElement> e)
{
OnSetFocusOnCloseElementChangedImplementation(e);
RaisePropertyChangedEvent(SetFocusOnCloseElementChanged, e);
}
partial void OnSetFocusOnCloseElementChangedImplementation(PropertyChangedEventArgs<UIElement> 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);
}
}
//
// Static constructor
//
/// <summary>
/// Called when the type is initialized.
/// </summary>
static DismissiblePopup()
{
CommandManager.RegisterClassCommandBinding( typeof(DismissiblePopup), new CommandBinding( DismissiblePopup.DismissPopupCommand, DismissPopupCommand_CommandExecuted ));
StaticConstructorImplementation();
}
static partial void StaticConstructorImplementation();
}
}
#endregion
|