Skip to content

Instantly share code, notes, and snippets.

@Jaykul
Last active August 27, 2018 17:23
Show Gist options
  • Select an option

  • Save Jaykul/c7947c132d257d4ad8ee to your computer and use it in GitHub Desktop.

Select an option

Save Jaykul/c7947c132d257d4ad8ee to your computer and use it in GitHub Desktop.
MahApps.Metro
@{
ModuleVersion = '1.0'
RequiredModules = 'ShowUI'
RequiredAssemblies = '.\lib\net40\MahApps.Metro.dll'
ModuleToProcess = 'MahApps.Metro.psm1'
GUID = '36f28fcd-90dc-4278-9baa-b8544a032d84'
FunctionsToExport = @('New-CloseTabItemAction','New-SetFlyoutOpenAction','New-BindableResourceBehavior','New-BorderlessWindowBehavior','New-GlowWindowBehavior','New-WindowsSettingBehaviour','New-CustomValidationPopup','New-DataGridNumericUpDownColumn','New-LoginDialogSettings','New-CustomDialog','New-DropDownButton','New-FlipViewItem','New-FlipView','New-Flyout','New-FlyoutsControl','New-Glow','New-LayoutInvalidationCatcher','New-MetroAnimatedSingleRowTabControl','New-MetroAnimatedTabControl','New-MetroWindow','New-MetroNavigationWindow','New-MetroProgressBar','New-MetroTabControl','New-MetroTabItem','New-MultiFrameImage','New-NumericUpDown','New-Pivot','New-PivotItem','New-ScrollViewerOffsetMediator','New-SplitButton','New-WindowButtonCommands','New-WindowCommands','New-Planerator','New-ProgressRing','New-RangeSlider','New-ToggleSwitchButton','New-TransitioningContentControl','New-TiltBehavior','New-MetroContentControl','New-RevealImage','New-Tile','New-ToggleSwitch','New-ToUpperConverter','New-ToLowerConverter')
AliasesToExport = @('CloseTabItemAction','SetFlyoutOpenAction','BindableResourceBehavior','BorderlessWindowBehavior','GlowWindowBehavior','WindowsSettingBehaviour','CustomValidationPopup','DataGridNumericUpDownColumn','LoginDialogSettings','CustomDialog','DropDownButton','FlipViewItem','FlipView','Flyout','FlyoutsControl','Glow','LayoutInvalidationCatcher','MetroAnimatedSingleRowTabControl','MetroAnimatedTabControl','MetroWindow','MetroNavigationWindow','MetroProgressBar','MetroTabControl','MetroTabItem','MultiFrameImage','NumericUpDown','Pivot','PivotItem','ScrollViewerOffsetMediator','SplitButton','WindowButtonCommands','WindowCommands','Planerator','ProgressRing','RangeSlider','ToggleSwitchButton','TransitioningContentControl','TiltBehavior','MetroContentControl','RevealImage','Tile','ToggleSwitch','ToUpperConverter','ToLowerConverter' )
}
function New-CloseTabItemAction {
<#
.Example
New-CloseTabItemAction
.Example
New-CloseTabItemAction -OutputXaml
.Description
Creates a new MahApps.Metro.Actions.CloseTabItemAction
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Actions.CloseTabItemAction
#>
[OutputType([MahApps.Metro.Actions.CloseTabItemAction])]
param(
${TabControl},
${TabItem},
[switch]
${IsEnabled},
[scriptblock[]]
${On_Changed},
[switch]
${OutputXaml}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Actions.CloseTabItemAction
} catch {
throw $_
return
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
Write-Output (,$Object)
}
end {
}
}
function New-SetFlyoutOpenAction {
<#
.Example
New-SetFlyoutOpenAction
.Example
New-SetFlyoutOpenAction -OutputXaml
.Description
Creates a new MahApps.Metro.Actions.SetFlyoutOpenAction
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Actions.SetFlyoutOpenAction
#>
[OutputType([MahApps.Metro.Actions.SetFlyoutOpenAction])]
param(
[switch]
${Value},
${TargetObject},
${TargetName},
[switch]
${IsEnabled},
[scriptblock[]]
${On_Changed},
[switch]
${OutputXaml}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Actions.SetFlyoutOpenAction
} catch {
throw $_
return
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
Write-Output (,$Object)
}
end {
}
}
function New-BindableResourceBehavior {
<#
.Example
New-BindableResourceBehavior
.Example
New-BindableResourceBehavior -OutputXaml
.Description
Creates a new MahApps.Metro.Behaviours.BindableResourceBehavior
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Behaviours.BindableResourceBehavior
#>
[OutputType([MahApps.Metro.Behaviours.BindableResourceBehavior])]
param(
${ResourceName},
${Property},
[scriptblock[]]
${On_Changed},
[switch]
${OutputXaml}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Behaviours.BindableResourceBehavior
} catch {
throw $_
return
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
Write-Output (,$Object)
}
end {
}
}
function New-BorderlessWindowBehavior {
<#
.Example
New-BorderlessWindowBehavior
.Example
New-BorderlessWindowBehavior -OutputXaml
.Description
Creates a new MahApps.Metro.Behaviours.BorderlessWindowBehavior
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Behaviours.BorderlessWindowBehavior
#>
[OutputType([MahApps.Metro.Behaviours.BorderlessWindowBehavior])]
param(
[switch]
${EnableDWMDropShadow},
[scriptblock[]]
${On_Changed},
[switch]
${OutputXaml}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Behaviours.BorderlessWindowBehavior
} catch {
throw $_
return
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
Write-Output (,$Object)
}
end {
}
}
function New-GlowWindowBehavior {
<#
.Example
New-GlowWindowBehavior
.Example
New-GlowWindowBehavior -OutputXaml
.Description
Creates a new MahApps.Metro.Behaviours.GlowWindowBehavior
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Behaviours.GlowWindowBehavior
#>
[OutputType([MahApps.Metro.Behaviours.GlowWindowBehavior])]
param(
[scriptblock[]]
${On_Changed},
[switch]
${OutputXaml}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Behaviours.GlowWindowBehavior
} catch {
throw $_
return
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
Write-Output (,$Object)
}
end {
}
}
function New-WindowsSettingBehaviour {
<#
.Example
New-WindowsSettingBehaviour
.Example
New-WindowsSettingBehaviour -OutputXaml
.Description
Creates a new MahApps.Metro.Behaviours.WindowsSettingBehaviour
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Behaviours.WindowsSettingBehaviour
#>
[OutputType([MahApps.Metro.Behaviours.WindowsSettingBehaviour])]
param(
[scriptblock[]]
${On_Changed},
[switch]
${OutputXaml}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Behaviours.WindowsSettingBehaviour
} catch {
throw $_
return
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
Write-Output (,$Object)
}
end {
}
}
function New-CustomValidationPopup {
<#
.Example
New-CustomValidationPopup
.Example
New-CustomValidationPopup -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.CustomValidationPopup
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.CustomValidationPopup
#>
[OutputType([MahApps.Metro.Controls.CustomValidationPopup])]
param(
${Child},
[switch]
${IsOpen},
[System.Windows.Controls.Primitives.PlacementMode]
${Placement},
${CustomPopupPlacementCallback},
[switch]
${StaysOpen},
[double]
${HorizontalOffset},
[double]
${VerticalOffset},
${PlacementTarget},
${PlacementRectangle},
[System.Windows.Controls.Primitives.PopupAnimation]
${PopupAnimation},
[switch]
${AllowsTransparency},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_Opened},
[scriptblock[]]
${On_Closed},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.CustomValidationPopup
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-DataGridNumericUpDownColumn {
<#
.Example
New-DataGridNumericUpDownColumn
.Example
New-DataGridNumericUpDownColumn -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.DataGridNumericUpDownColumn
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.DataGridNumericUpDownColumn
#>
[OutputType([MahApps.Metro.Controls.DataGridNumericUpDownColumn])]
param(
[double]
${Minimum},
[double]
${Maximum},
[double]
${Interval},
${StringFormat},
[switch]
${HideUpDownButtons},
${Binding},
${ElementStyle},
${EditingElementStyle},
${ClipboardContentBinding},
${Header},
${HeaderStyle},
${HeaderStringFormat},
${HeaderTemplate},
${HeaderTemplateSelector},
${CellStyle},
[switch]
${IsReadOnly},
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[int]
${DisplayIndex},
${SortMemberPath},
[switch]
${CanUserSort},
${SortDirection},
[switch]
${IsAutoGenerated},
[switch]
${IsFrozen},
[switch]
${CanUserReorder},
${DragIndicatorStyle},
[switch]
${CanUserResize},
[System.Windows.Visibility]
${Visibility},
[scriptblock[]]
${On_CopyingCellClipboardContent},
[scriptblock[]]
${On_PastingCellClipboardContent},
[switch]
${OutputXaml}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.DataGridNumericUpDownColumn
} catch {
throw $_
return
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
Write-Output (,$Object)
}
end {
}
}
function New-LoginDialogSettings {
<#
.Example
New-LoginDialogSettings
.Example
New-LoginDialogSettings -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.Dialogs.LoginDialogSettings
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.Dialogs.LoginDialogSettings
#>
[OutputType([MahApps.Metro.Controls.Dialogs.LoginDialogSettings])]
param(
${InitialUsername},
${UsernameWatermark},
${PasswordWatermark},
[System.Windows.Visibility]
${NegativeButtonVisibility},
${AffirmativeButtonText},
${NegativeButtonText},
${FirstAuxiliaryButtonText},
${SecondAuxiliaryButtonText},
[MahApps.Metro.Controls.Dialogs.MetroDialogColorScheme]
${ColorScheme},
[switch]
${AnimateShow},
[switch]
${AnimateHide},
${DefaultText},
[double]
${MaximumBodyHeight},
[switch]
${OutputXaml}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.Dialogs.LoginDialogSettings
} catch {
throw $_
return
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
Write-Output (,$Object)
}
end {
}
}
function New-CustomDialog {
<#
.Example
New-CustomDialog
.Example
New-CustomDialog -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.Dialogs.CustomDialog
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.Dialogs.CustomDialog
#>
[OutputType([MahApps.Metro.Controls.Dialogs.CustomDialog])]
param(
${Content},
${Title},
${DialogTop},
${DialogBottom},
${ContentTemplate},
${ContentTemplateSelector},
${ContentStringFormat},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.Dialogs.CustomDialog
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-DropDownButton {
<#
.Example
New-DropDownButton
.Example
New-DropDownButton -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.DropDownButton
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.DropDownButton
#>
[OutputType([MahApps.Metro.Controls.DropDownButton])]
param(
${Items},
${Content},
${CommandParameter},
${CommandTarget},
${Command},
[switch]
${IsExpanded},
${ExtraTag},
[System.Windows.Controls.Orientation]
${Orientation},
${Icon},
${ItemsSource},
${DisplayMemberPath},
${ItemTemplate},
${ItemTemplateSelector},
${ItemStringFormat},
${ItemBindingGroup},
${ItemContainerStyle},
${ItemContainerStyleSelector},
${ItemsPanel},
${GroupStyle},
${GroupStyleSelector},
[int]
${AlternationCount},
[switch]
${IsTextSearchEnabled},
[switch]
${IsTextSearchCaseSensitive},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_Click},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.DropDownButton
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-FlipViewItem {
<#
.Example
New-FlipViewItem
.Example
New-FlipViewItem -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.FlipViewItem
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.FlipViewItem
#>
[OutputType([MahApps.Metro.Controls.FlipViewItem])]
param(
${Content},
${ContentTemplate},
${ContentTemplateSelector},
${ContentStringFormat},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.FlipViewItem
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-FlipView {
<#
.Example
New-FlipView
.Example
New-FlipView -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.FlipView
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.FlipView
#>
[OutputType([MahApps.Metro.Controls.FlipView])]
param(
${Items},
[MahApps.Metro.Controls.TransitionType]
${UpTransition},
[MahApps.Metro.Controls.TransitionType]
${DownTransition},
[MahApps.Metro.Controls.TransitionType]
${LeftTransition},
[MahApps.Metro.Controls.TransitionType]
${RightTransition},
[switch]
${MouseOverGlowEnabled},
[System.Windows.Controls.Orientation]
${Orientation},
${BannerText},
[switch]
${IsBannerEnabled},
${IsSynchronizedWithCurrentItem},
[int]
${SelectedIndex},
${SelectedItem},
${SelectedValue},
${SelectedValuePath},
${ItemsSource},
${DisplayMemberPath},
${ItemTemplate},
${ItemTemplateSelector},
${ItemStringFormat},
${ItemBindingGroup},
${ItemContainerStyle},
${ItemContainerStyleSelector},
${ItemsPanel},
${GroupStyle},
${GroupStyleSelector},
[int]
${AlternationCount},
[switch]
${IsTextSearchEnabled},
[switch]
${IsTextSearchCaseSensitive},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_SelectionChanged},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.FlipView
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-Flyout {
<#
.Example
New-Flyout
.Example
New-Flyout -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.Flyout
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.Flyout
#>
[OutputType([MahApps.Metro.Controls.Flyout])]
param(
${Content},
[switch]
${AreAnimationsEnabled},
[System.Windows.Visibility]
${TitleVisibility},
[System.Windows.Visibility]
${CloseButtonVisibility},
${CloseCommand},
${HeaderTemplate},
[switch]
${IsOpen},
[switch]
${AnimateOnPositionChange},
[switch]
${AnimateOpacity},
[switch]
${IsPinned},
[System.Windows.Input.MouseButton]
${ExternalCloseButton},
[switch]
${IsModal},
[MahApps.Metro.Controls.Position]
${Position},
${Header},
[MahApps.Metro.Controls.FlyoutTheme]
${Theme},
${FocusedElement},
[switch]
${AllowFocusElement},
${ContentTemplate},
${ContentTemplateSelector},
${ContentStringFormat},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_IsOpenChanged},
[scriptblock[]]
${On_ClosingFinished},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.Flyout
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-FlyoutsControl {
<#
.Example
New-FlyoutsControl
.Example
New-FlyoutsControl -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.FlyoutsControl
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.FlyoutsControl
#>
[OutputType([MahApps.Metro.Controls.FlyoutsControl])]
param(
${Items},
${OverrideExternalCloseButton},
[switch]
${OverrideIsPinned},
${ItemsSource},
${DisplayMemberPath},
${ItemTemplate},
${ItemTemplateSelector},
${ItemStringFormat},
${ItemBindingGroup},
${ItemContainerStyle},
${ItemContainerStyleSelector},
${ItemsPanel},
${GroupStyle},
${GroupStyleSelector},
[int]
${AlternationCount},
[switch]
${IsTextSearchEnabled},
[switch]
${IsTextSearchCaseSensitive},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.FlyoutsControl
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-Glow {
<#
.Example
New-Glow
.Example
New-Glow -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.Glow
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.Glow
#>
[OutputType([MahApps.Metro.Controls.Glow])]
param(
${GlowBrush},
${NonActiveGlowBrush},
[switch]
${IsGlow},
[System.Windows.Controls.Orientation]
${Orientation},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.Glow
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-LayoutInvalidationCatcher {
<#
.Example
New-LayoutInvalidationCatcher
.Example
New-LayoutInvalidationCatcher -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.LayoutInvalidationCatcher
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.LayoutInvalidationCatcher
#>
[OutputType([MahApps.Metro.Controls.LayoutInvalidationCatcher])]
param(
${Child},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.LayoutInvalidationCatcher
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-MetroAnimatedSingleRowTabControl {
<#
.Example
New-MetroAnimatedSingleRowTabControl
.Example
New-MetroAnimatedSingleRowTabControl -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.MetroAnimatedSingleRowTabControl
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.MetroAnimatedSingleRowTabControl
#>
[OutputType([MahApps.Metro.Controls.MetroAnimatedSingleRowTabControl])]
param(
${Items},
${TabStripMargin},
${CloseTabCommand},
[System.Windows.Controls.Dock]
${TabStripPlacement},
${SelectedContent},
${SelectedContentTemplate},
${SelectedContentTemplateSelector},
${SelectedContentStringFormat},
${ContentTemplate},
${ContentTemplateSelector},
${ContentStringFormat},
${IsSynchronizedWithCurrentItem},
[int]
${SelectedIndex},
${SelectedItem},
${SelectedValue},
${SelectedValuePath},
${ItemsSource},
${DisplayMemberPath},
${ItemTemplate},
${ItemTemplateSelector},
${ItemStringFormat},
${ItemBindingGroup},
${ItemContainerStyle},
${ItemContainerStyleSelector},
${ItemsPanel},
${GroupStyle},
${GroupStyleSelector},
[int]
${AlternationCount},
[switch]
${IsTextSearchEnabled},
[switch]
${IsTextSearchCaseSensitive},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_TabItemClosingEvent},
[scriptblock[]]
${On_SelectionChanged},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.MetroAnimatedSingleRowTabControl
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-MetroAnimatedTabControl {
<#
.Example
New-MetroAnimatedTabControl
.Example
New-MetroAnimatedTabControl -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.MetroAnimatedTabControl
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.MetroAnimatedTabControl
#>
[OutputType([MahApps.Metro.Controls.MetroAnimatedTabControl])]
param(
${Items},
${TabStripMargin},
${CloseTabCommand},
[System.Windows.Controls.Dock]
${TabStripPlacement},
${SelectedContent},
${SelectedContentTemplate},
${SelectedContentTemplateSelector},
${SelectedContentStringFormat},
${ContentTemplate},
${ContentTemplateSelector},
${ContentStringFormat},
${IsSynchronizedWithCurrentItem},
[int]
${SelectedIndex},
${SelectedItem},
${SelectedValue},
${SelectedValuePath},
${ItemsSource},
${DisplayMemberPath},
${ItemTemplate},
${ItemTemplateSelector},
${ItemStringFormat},
${ItemBindingGroup},
${ItemContainerStyle},
${ItemContainerStyleSelector},
${ItemsPanel},
${GroupStyle},
${GroupStyleSelector},
[int]
${AlternationCount},
[switch]
${IsTextSearchEnabled},
[switch]
${IsTextSearchCaseSensitive},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_TabItemClosingEvent},
[scriptblock[]]
${On_SelectionChanged},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.MetroAnimatedTabControl
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-MetroWindow {
<#
.Example
New-MetroWindow
.Example
New-MetroWindow -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.MetroWindow
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.MetroWindow
#>
[OutputType([MahApps.Metro.Controls.MetroWindow])]
param(
${Content},
${OverrideDefaultWindowCommandsBrush},
${MetroDialogOptions},
[switch]
${EnableDWMDropShadow},
[switch]
${IsWindowDraggable},
[MahApps.Metro.Controls.WindowCommandsOverlayBehavior]
${LeftWindowCommandsOverlayBehavior},
[MahApps.Metro.Controls.WindowCommandsOverlayBehavior]
${RightWindowCommandsOverlayBehavior},
[MahApps.Metro.Controls.WindowCommandsOverlayBehavior]
${WindowButtonCommandsOverlayBehavior},
[MahApps.Metro.Controls.WindowCommandsOverlayBehavior]
${IconOverlayBehavior},
${WindowMinButtonStyle},
${WindowMaxButtonStyle},
${WindowCloseButtonStyle},
[switch]
${WindowTransitionsEnabled},
${Flyouts},
${IconTemplate},
${TitleTemplate},
${LeftWindowCommands},
${RightWindowCommands},
[switch]
${IgnoreTaskbarOnMaximize},
${TitleForeground},
[switch]
${SaveWindowPosition},
${WindowPlacementSettings},
[switch]
${ShowIconOnTitleBar},
[System.Windows.Media.EdgeMode]
${IconEdgeMode},
[System.Windows.Media.BitmapScalingMode]
${IconBitmapScalingMode},
[switch]
${ShowTitleBar},
[switch]
${UseNoneWindowStyle},
[switch]
${ShowMinButton},
[switch]
${ShowMaxRestoreButton},
[switch]
${ShowCloseButton},
[switch]
${IsMinButtonEnabled},
[switch]
${IsMaxRestoreButtonEnabled},
[switch]
${IsCloseButtonEnabled},
[switch]
${ShowSystemMenuOnRightClick},
[int]
${TitlebarHeight},
[switch]
${TitleCaps},
${WindowTitleBrush},
${GlowBrush},
${NonActiveGlowBrush},
${NonActiveBorderBrush},
${NonActiveWindowTitleBrush},
${TaskbarItemInfo},
[switch]
${AllowsTransparency},
${Title},
${Icon},
[System.Windows.SizeToContent]
${SizeToContent},
[double]
${Top},
[double]
${Left},
[System.Windows.WindowStartupLocation]
${WindowStartupLocation},
[switch]
${ShowInTaskbar},
${Owner},
${DialogResult},
[System.Windows.WindowStyle]
${WindowStyle},
[System.Windows.WindowState]
${WindowState},
[System.Windows.ResizeMode]
${ResizeMode},
[switch]
${Topmost},
[switch]
${ShowActivated},
${ContentTemplate},
${ContentTemplateSelector},
${ContentStringFormat},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_FlyoutsStatusChanged},
[scriptblock[]]
${On_SourceInitialized},
[scriptblock[]]
${On_Activated},
[scriptblock[]]
${On_Deactivated},
[scriptblock[]]
${On_StateChanged},
[scriptblock[]]
${On_LocationChanged},
[scriptblock[]]
${On_Closing},
[scriptblock[]]
${On_Closed},
[scriptblock[]]
${On_ContentRendered},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.MetroWindow
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-MetroNavigationWindow {
<#
.Example
New-MetroNavigationWindow
.Example
New-MetroNavigationWindow -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.MetroNavigationWindow
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.MetroNavigationWindow
#>
[OutputType([MahApps.Metro.Controls.MetroNavigationWindow])]
param(
${Content},
${OverlayContent},
${PageContent},
${Source},
${OverrideDefaultWindowCommandsBrush},
${MetroDialogOptions},
[switch]
${EnableDWMDropShadow},
[switch]
${IsWindowDraggable},
[MahApps.Metro.Controls.WindowCommandsOverlayBehavior]
${LeftWindowCommandsOverlayBehavior},
[MahApps.Metro.Controls.WindowCommandsOverlayBehavior]
${RightWindowCommandsOverlayBehavior},
[MahApps.Metro.Controls.WindowCommandsOverlayBehavior]
${WindowButtonCommandsOverlayBehavior},
[MahApps.Metro.Controls.WindowCommandsOverlayBehavior]
${IconOverlayBehavior},
${WindowMinButtonStyle},
${WindowMaxButtonStyle},
${WindowCloseButtonStyle},
[switch]
${WindowTransitionsEnabled},
${Flyouts},
${IconTemplate},
${TitleTemplate},
${LeftWindowCommands},
${RightWindowCommands},
[switch]
${IgnoreTaskbarOnMaximize},
${TitleForeground},
[switch]
${SaveWindowPosition},
${WindowPlacementSettings},
[switch]
${ShowIconOnTitleBar},
[System.Windows.Media.EdgeMode]
${IconEdgeMode},
[System.Windows.Media.BitmapScalingMode]
${IconBitmapScalingMode},
[switch]
${ShowTitleBar},
[switch]
${UseNoneWindowStyle},
[switch]
${ShowMinButton},
[switch]
${ShowMaxRestoreButton},
[switch]
${ShowCloseButton},
[switch]
${IsMinButtonEnabled},
[switch]
${IsMaxRestoreButtonEnabled},
[switch]
${IsCloseButtonEnabled},
[switch]
${ShowSystemMenuOnRightClick},
[int]
${TitlebarHeight},
[switch]
${TitleCaps},
${WindowTitleBrush},
${GlowBrush},
${NonActiveGlowBrush},
${NonActiveBorderBrush},
${NonActiveWindowTitleBrush},
${TaskbarItemInfo},
[switch]
${AllowsTransparency},
${Title},
${Icon},
[System.Windows.SizeToContent]
${SizeToContent},
[double]
${Top},
[double]
${Left},
[System.Windows.WindowStartupLocation]
${WindowStartupLocation},
[switch]
${ShowInTaskbar},
${Owner},
${DialogResult},
[System.Windows.WindowStyle]
${WindowStyle},
[System.Windows.WindowState]
${WindowState},
[System.Windows.ResizeMode]
${ResizeMode},
[switch]
${Topmost},
[switch]
${ShowActivated},
${ContentTemplate},
${ContentTemplateSelector},
${ContentStringFormat},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_FragmentNavigation},
[scriptblock[]]
${On_Navigating},
[scriptblock[]]
${On_NavigationFailed},
[scriptblock[]]
${On_NavigationProgress},
[scriptblock[]]
${On_NavigationStopped},
[scriptblock[]]
${On_Navigated},
[scriptblock[]]
${On_LoadCompleted},
[scriptblock[]]
${On_FlyoutsStatusChanged},
[scriptblock[]]
${On_SourceInitialized},
[scriptblock[]]
${On_Activated},
[scriptblock[]]
${On_Deactivated},
[scriptblock[]]
${On_StateChanged},
[scriptblock[]]
${On_LocationChanged},
[scriptblock[]]
${On_Closing},
[scriptblock[]]
${On_Closed},
[scriptblock[]]
${On_ContentRendered},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.MetroNavigationWindow
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-MetroProgressBar {
<#
.Example
New-MetroProgressBar
.Example
New-MetroProgressBar -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.MetroProgressBar
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.MetroProgressBar
#>
[OutputType([MahApps.Metro.Controls.MetroProgressBar])]
param(
[double]
${EllipseDiameter},
[double]
${EllipseOffset},
[switch]
${IsIndeterminate},
[System.Windows.Controls.Orientation]
${Orientation},
[double]
${Minimum},
[double]
${Maximum},
[double]
${Value},
[double]
${LargeChange},
[double]
${SmallChange},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_ValueChanged},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.MetroProgressBar
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-MetroTabControl {
<#
.Example
New-MetroTabControl
.Example
New-MetroTabControl -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.MetroTabControl
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.MetroTabControl
#>
[OutputType([MahApps.Metro.Controls.MetroTabControl])]
param(
${Items},
${TabStripMargin},
${CloseTabCommand},
[System.Windows.Controls.Dock]
${TabStripPlacement},
${SelectedContent},
${SelectedContentTemplate},
${SelectedContentTemplateSelector},
${SelectedContentStringFormat},
${ContentTemplate},
${ContentTemplateSelector},
${ContentStringFormat},
${IsSynchronizedWithCurrentItem},
[int]
${SelectedIndex},
${SelectedItem},
${SelectedValue},
${SelectedValuePath},
${ItemsSource},
${DisplayMemberPath},
${ItemTemplate},
${ItemTemplateSelector},
${ItemStringFormat},
${ItemBindingGroup},
${ItemContainerStyle},
${ItemContainerStyleSelector},
${ItemsPanel},
${GroupStyle},
${GroupStyleSelector},
[int]
${AlternationCount},
[switch]
${IsTextSearchEnabled},
[switch]
${IsTextSearchCaseSensitive},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_TabItemClosingEvent},
[scriptblock[]]
${On_SelectionChanged},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.MetroTabControl
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-MetroTabItem {
<#
.Example
New-MetroTabItem
.Example
New-MetroTabItem -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.MetroTabItem
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.MetroTabItem
#>
[OutputType([MahApps.Metro.Controls.MetroTabItem])]
param(
${Header},
${Content},
[switch]
${CloseButtonEnabled},
${CloseTabCommand},
${CloseTabCommandParameter},
[switch]
${IsSelected},
${HeaderTemplate},
${HeaderTemplateSelector},
${HeaderStringFormat},
${ContentTemplate},
${ContentTemplateSelector},
${ContentStringFormat},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.MetroTabItem
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-MultiFrameImage {
<#
.Example
New-MultiFrameImage
.Example
New-MultiFrameImage -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.MultiFrameImage
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.MultiFrameImage
#>
[OutputType([MahApps.Metro.Controls.MultiFrameImage])]
param(
${Source},
[System.Windows.Media.Stretch]
${Stretch},
[System.Windows.Controls.StretchDirection]
${StretchDirection},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_ImageFailed},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.MultiFrameImage
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-NumericUpDown {
<#
.Example
New-NumericUpDown
.Example
New-NumericUpDown -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.NumericUpDown
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.NumericUpDown
#>
[OutputType([MahApps.Metro.Controls.NumericUpDown])]
param(
[int]
${Delay},
[switch]
${InterceptArrowKeys},
[switch]
${InterceptMouseWheel},
[switch]
${TrackMouseWheelWhenMouseOver},
[switch]
${InterceptManualEnter},
[switch]
${HideUpDownButtons},
[double]
${Interval},
[switch]
${IsReadOnly},
[double]
${Maximum},
[double]
${Minimum},
[switch]
${Speedup},
${StringFormat},
[System.Windows.TextAlignment]
${TextAlignment},
${Value},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_ValueChanged},
[scriptblock[]]
${On_MaximumReached},
[scriptblock[]]
${On_MinimumReached},
[scriptblock[]]
${On_ValueIncremented},
[scriptblock[]]
${On_ValueDecremented},
[scriptblock[]]
${On_DelayChanged},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.NumericUpDown
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-Pivot {
<#
.Example
New-Pivot
.Example
New-Pivot -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.Pivot
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.Pivot
#>
[OutputType([MahApps.Metro.Controls.Pivot])]
param(
${Items},
${HeaderTemplate},
${Header},
[int]
${SelectedIndex},
${ItemsSource},
${DisplayMemberPath},
${ItemTemplate},
${ItemTemplateSelector},
${ItemStringFormat},
${ItemBindingGroup},
${ItemContainerStyle},
${ItemContainerStyleSelector},
${ItemsPanel},
${GroupStyle},
${GroupStyleSelector},
[int]
${AlternationCount},
[switch]
${IsTextSearchEnabled},
[switch]
${IsTextSearchCaseSensitive},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_SelectionChanged},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.Pivot
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-PivotItem {
<#
.Example
New-PivotItem
.Example
New-PivotItem -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.PivotItem
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.PivotItem
#>
[OutputType([MahApps.Metro.Controls.PivotItem])]
param(
${Content},
${Header},
${ContentTemplate},
${ContentTemplateSelector},
${ContentStringFormat},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.PivotItem
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-ScrollViewerOffsetMediator {
<#
.Example
New-ScrollViewerOffsetMediator
.Example
New-ScrollViewerOffsetMediator -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.ScrollViewerOffsetMediator
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.ScrollViewerOffsetMediator
#>
[OutputType([MahApps.Metro.Controls.ScrollViewerOffsetMediator])]
param(
${ScrollViewer},
[double]
${HorizontalOffset},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.ScrollViewerOffsetMediator
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-SplitButton {
<#
.Example
New-SplitButton
.Example
New-SplitButton -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.SplitButton
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.SplitButton
#>
[OutputType([MahApps.Metro.Controls.SplitButton])]
param(
${Items},
${CommandParameter},
${CommandTarget},
${Command},
[int]
${SelectedIndex},
${SelectedItem},
[switch]
${IsExpanded},
${ExtraTag},
[System.Windows.Controls.Orientation]
${Orientation},
${Icon},
${ItemsSource},
${DisplayMemberPath},
${ItemTemplate},
${ItemTemplateSelector},
${ItemStringFormat},
${ItemBindingGroup},
${ItemContainerStyle},
${ItemContainerStyleSelector},
${ItemsPanel},
${GroupStyle},
${GroupStyleSelector},
[int]
${AlternationCount},
[switch]
${IsTextSearchEnabled},
[switch]
${IsTextSearchCaseSensitive},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_SelectionChanged},
[scriptblock[]]
${On_Click},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.SplitButton
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-WindowButtonCommands {
<#
.Example
New-WindowButtonCommands
.Example
New-WindowButtonCommands -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.WindowButtonCommands
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.WindowButtonCommands
#>
[OutputType([MahApps.Metro.Controls.WindowButtonCommands])]
param(
${Content},
[switch]
${ActualHeightProperty},
[switch]
${ActualWidthProperty},
[switch]
${AllowDropProperty},
[switch]
${AreAnyTouchesCapturedProperty},
[switch]
${AreAnyTouchesCapturedWithinProperty},
[switch]
${AreAnyTouchesDirectlyOverProperty},
[switch]
${AreAnyTouchesOverProperty},
[switch]
${BackgroundProperty},
[switch]
${BindingGroupProperty},
[switch]
${BitmapEffectInputProperty},
[switch]
${BitmapEffectProperty},
[switch]
${BorderBrushProperty},
[switch]
${BorderThicknessProperty},
[switch]
${CacheModeProperty},
[switch]
${ClipProperty},
[switch]
${ClipToBoundsProperty},
[switch]
${ContentProperty},
[switch]
${ContentStringFormatProperty},
[switch]
${ContentTemplateProperty},
[switch]
${ContentTemplateSelectorProperty},
[switch]
${ContextMenuClosingEvent},
[switch]
${ContextMenuOpeningEvent},
[switch]
${ContextMenuProperty},
[switch]
${CursorProperty},
[switch]
${DataContextProperty},
[switch]
${DragEnterEvent},
[switch]
${DragLeaveEvent},
[switch]
${DragOverEvent},
[switch]
${DropEvent},
[switch]
${EffectProperty},
[switch]
${FlowDirectionProperty},
[switch]
${FocusableProperty},
[switch]
${FocusVisualStyleProperty},
[switch]
${FontFamilyProperty},
[switch]
${FontSizeProperty},
[switch]
${FontStretchProperty},
[switch]
${FontStyleProperty},
[switch]
${FontWeightProperty},
[switch]
${ForceCursorProperty},
[switch]
${ForegroundProperty},
[switch]
${GiveFeedbackEvent},
[switch]
${GotFocusEvent},
[switch]
${GotKeyboardFocusEvent},
[switch]
${GotMouseCaptureEvent},
[switch]
${GotStylusCaptureEvent},
[switch]
${GotTouchCaptureEvent},
[switch]
${HasContentProperty},
[switch]
${HeightProperty},
[switch]
${HorizontalAlignmentProperty},
[switch]
${HorizontalContentAlignmentProperty},
[switch]
${InputScopeProperty},
[switch]
${IsEnabledProperty},
[switch]
${IsFocusedProperty},
[switch]
${IsHitTestVisibleProperty},
[switch]
${IsKeyboardFocusedProperty},
[switch]
${IsKeyboardFocusWithinProperty},
[switch]
${IsManipulationEnabledProperty},
[switch]
${IsMouseCapturedProperty},
[switch]
${IsMouseCaptureWithinProperty},
[switch]
${IsMouseDirectlyOverProperty},
[switch]
${IsMouseOverProperty},
[switch]
${IsStylusCapturedProperty},
[switch]
${IsStylusCaptureWithinProperty},
[switch]
${IsStylusDirectlyOverProperty},
[switch]
${IsStylusOverProperty},
[switch]
${IsTabStopProperty},
[switch]
${IsVisibleProperty},
[switch]
${KeyDownEvent},
[switch]
${KeyUpEvent},
[switch]
${LanguageProperty},
[switch]
${LayoutTransformProperty},
[switch]
${LoadedEvent},
[switch]
${LostFocusEvent},
[switch]
${LostKeyboardFocusEvent},
[switch]
${LostMouseCaptureEvent},
[switch]
${LostStylusCaptureEvent},
[switch]
${LostTouchCaptureEvent},
[switch]
${ManipulationBoundaryFeedbackEvent},
[switch]
${ManipulationCompletedEvent},
[switch]
${ManipulationDeltaEvent},
[switch]
${ManipulationInertiaStartingEvent},
[switch]
${ManipulationStartedEvent},
[switch]
${ManipulationStartingEvent},
[switch]
${MarginProperty},
[switch]
${MaxHeightProperty},
[switch]
${MaxWidthProperty},
[switch]
${MinHeightProperty},
[switch]
${MinWidthProperty},
[switch]
${MouseDoubleClickEvent},
[switch]
${MouseDownEvent},
[switch]
${MouseEnterEvent},
[switch]
${MouseLeaveEvent},
[switch]
${MouseLeftButtonDownEvent},
[switch]
${MouseLeftButtonUpEvent},
[switch]
${MouseMoveEvent},
[switch]
${MouseRightButtonDownEvent},
[switch]
${MouseRightButtonUpEvent},
[switch]
${MouseUpEvent},
[switch]
${MouseWheelEvent},
[switch]
${NameProperty},
[switch]
${OpacityMaskProperty},
[switch]
${OpacityProperty},
[switch]
${OverridesDefaultStyleProperty},
[switch]
${PaddingProperty},
[switch]
${PreviewDragEnterEvent},
[switch]
${PreviewDragLeaveEvent},
[switch]
${PreviewDragOverEvent},
[switch]
${PreviewDropEvent},
[switch]
${PreviewGiveFeedbackEvent},
[switch]
${PreviewGotKeyboardFocusEvent},
[switch]
${PreviewKeyDownEvent},
[switch]
${PreviewKeyUpEvent},
[switch]
${PreviewLostKeyboardFocusEvent},
[switch]
${PreviewMouseDoubleClickEvent},
[switch]
${PreviewMouseDownEvent},
[switch]
${PreviewMouseLeftButtonDownEvent},
[switch]
${PreviewMouseLeftButtonUpEvent},
[switch]
${PreviewMouseMoveEvent},
[switch]
${PreviewMouseRightButtonDownEvent},
[switch]
${PreviewMouseRightButtonUpEvent},
[switch]
${PreviewMouseUpEvent},
[switch]
${PreviewMouseWheelEvent},
[switch]
${PreviewQueryContinueDragEvent},
[switch]
${PreviewStylusButtonDownEvent},
[switch]
${PreviewStylusButtonUpEvent},
[switch]
${PreviewStylusDownEvent},
[switch]
${PreviewStylusInAirMoveEvent},
[switch]
${PreviewStylusInRangeEvent},
[switch]
${PreviewStylusMoveEvent},
[switch]
${PreviewStylusOutOfRangeEvent},
[switch]
${PreviewStylusSystemGestureEvent},
[switch]
${PreviewStylusUpEvent},
[switch]
${PreviewTextInputEvent},
[switch]
${PreviewTouchDownEvent},
[switch]
${PreviewTouchMoveEvent},
[switch]
${PreviewTouchUpEvent},
[switch]
${QueryContinueDragEvent},
[switch]
${QueryCursorEvent},
[switch]
${RenderTransformOriginProperty},
[switch]
${RenderTransformProperty},
[switch]
${RequestBringIntoViewEvent},
[switch]
${SizeChangedEvent},
[switch]
${SnapsToDevicePixelsProperty},
[switch]
${StyleProperty},
[switch]
${StylusButtonDownEvent},
[switch]
${StylusButtonUpEvent},
[switch]
${StylusDownEvent},
[switch]
${StylusEnterEvent},
[switch]
${StylusInAirMoveEvent},
[switch]
${StylusInRangeEvent},
[switch]
${StylusLeaveEvent},
[switch]
${StylusMoveEvent},
[switch]
${StylusOutOfRangeEvent},
[switch]
${StylusSystemGestureEvent},
[switch]
${StylusUpEvent},
[switch]
${TabIndexProperty},
[switch]
${TagProperty},
[switch]
${TemplateProperty},
[switch]
${TextInputEvent},
[switch]
${ToolTipClosingEvent},
[switch]
${ToolTipOpeningEvent},
[switch]
${ToolTipProperty},
[switch]
${TouchDownEvent},
[switch]
${TouchEnterEvent},
[switch]
${TouchLeaveEvent},
[switch]
${TouchMoveEvent},
[switch]
${TouchUpEvent},
[switch]
${UidProperty},
[switch]
${UnloadedEvent},
[switch]
${UseLayoutRoundingProperty},
[switch]
${VerticalAlignmentProperty},
[switch]
${VerticalContentAlignmentProperty},
[switch]
${VisibilityProperty},
[switch]
${WidthProperty},
${ParentWindow},
${ContentTemplate},
${ContentTemplateSelector},
${ContentStringFormat},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_ClosingWindow},
[scriptblock[]]
${On_PropertyChanged},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.WindowButtonCommands
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
$Type = 'MahApps.Metro.Controls.WindowButtonCommands' -as [Type]
if (-not $Type) { return }
foreach ($k in $psBoundParameters.Keys) {
if (-not $k) {
continue
}
$type::$k
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-WindowCommands {
<#
.Example
New-WindowCommands
.Example
New-WindowCommands -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.WindowCommands
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.WindowCommands
#>
[OutputType([MahApps.Metro.Controls.WindowCommands])]
param(
${Items},
[switch]
${ActualHeightProperty},
[switch]
${ActualWidthProperty},
[switch]
${AllowDropProperty},
[switch]
${AlternationCountProperty},
[switch]
${AlternationIndexProperty},
[switch]
${AreAnyTouchesCapturedProperty},
[switch]
${AreAnyTouchesCapturedWithinProperty},
[switch]
${AreAnyTouchesDirectlyOverProperty},
[switch]
${AreAnyTouchesOverProperty},
[switch]
${BackgroundProperty},
[switch]
${BindingGroupProperty},
[switch]
${BitmapEffectInputProperty},
[switch]
${BitmapEffectProperty},
[switch]
${BorderBrushProperty},
[switch]
${BorderThicknessProperty},
[switch]
${CacheModeProperty},
[switch]
${ClipProperty},
[switch]
${ClipToBoundsProperty},
[switch]
${ContextMenuClosingEvent},
[switch]
${ContextMenuOpeningEvent},
[switch]
${ContextMenuProperty},
[switch]
${CursorProperty},
[switch]
${DataContextProperty},
[switch]
${DisplayMemberPathProperty},
[switch]
${DragEnterEvent},
[switch]
${DragLeaveEvent},
[switch]
${DragOverEvent},
[switch]
${DropEvent},
[switch]
${EffectProperty},
[switch]
${FlowDirectionProperty},
[switch]
${FocusableProperty},
[switch]
${FocusVisualStyleProperty},
[switch]
${FontFamilyProperty},
[switch]
${FontSizeProperty},
[switch]
${FontStretchProperty},
[switch]
${FontStyleProperty},
[switch]
${FontWeightProperty},
[switch]
${ForceCursorProperty},
[switch]
${ForegroundProperty},
[switch]
${GiveFeedbackEvent},
[switch]
${GotFocusEvent},
[switch]
${GotKeyboardFocusEvent},
[switch]
${GotMouseCaptureEvent},
[switch]
${GotStylusCaptureEvent},
[switch]
${GotTouchCaptureEvent},
[switch]
${GroupStyleSelectorProperty},
[switch]
${HasItemsProperty},
[switch]
${HeightProperty},
[switch]
${HorizontalAlignmentProperty},
[switch]
${HorizontalContentAlignmentProperty},
[switch]
${InputScopeProperty},
[switch]
${IsEnabledProperty},
[switch]
${IsFocusedProperty},
[switch]
${IsGroupingProperty},
[switch]
${IsHitTestVisibleProperty},
[switch]
${IsKeyboardFocusedProperty},
[switch]
${IsKeyboardFocusWithinProperty},
[switch]
${IsManipulationEnabledProperty},
[switch]
${IsMouseCapturedProperty},
[switch]
${IsMouseCaptureWithinProperty},
[switch]
${IsMouseDirectlyOverProperty},
[switch]
${IsMouseOverProperty},
[switch]
${IsStylusCapturedProperty},
[switch]
${IsStylusCaptureWithinProperty},
[switch]
${IsStylusDirectlyOverProperty},
[switch]
${IsStylusOverProperty},
[switch]
${IsTabStopProperty},
[switch]
${IsTextSearchCaseSensitiveProperty},
[switch]
${IsTextSearchEnabledProperty},
[switch]
${IsVisibleProperty},
[switch]
${ItemBindingGroupProperty},
[switch]
${ItemContainerStyleProperty},
[switch]
${ItemContainerStyleSelectorProperty},
[switch]
${ItemsPanelProperty},
[switch]
${ItemsSourceProperty},
[switch]
${ItemStringFormatProperty},
[switch]
${ItemTemplateProperty},
[switch]
${ItemTemplateSelectorProperty},
[switch]
${KeyDownEvent},
[switch]
${KeyUpEvent},
[switch]
${LanguageProperty},
[switch]
${LayoutTransformProperty},
[switch]
${LoadedEvent},
[switch]
${LostFocusEvent},
[switch]
${LostKeyboardFocusEvent},
[switch]
${LostMouseCaptureEvent},
[switch]
${LostStylusCaptureEvent},
[switch]
${LostTouchCaptureEvent},
[switch]
${ManipulationBoundaryFeedbackEvent},
[switch]
${ManipulationCompletedEvent},
[switch]
${ManipulationDeltaEvent},
[switch]
${ManipulationInertiaStartingEvent},
[switch]
${ManipulationStartedEvent},
[switch]
${ManipulationStartingEvent},
[switch]
${MarginProperty},
[switch]
${MaxHeightProperty},
[switch]
${MaxWidthProperty},
[switch]
${MinHeightProperty},
[switch]
${MinWidthProperty},
[switch]
${MouseDoubleClickEvent},
[switch]
${MouseDownEvent},
[switch]
${MouseEnterEvent},
[switch]
${MouseLeaveEvent},
[switch]
${MouseLeftButtonDownEvent},
[switch]
${MouseLeftButtonUpEvent},
[switch]
${MouseMoveEvent},
[switch]
${MouseRightButtonDownEvent},
[switch]
${MouseRightButtonUpEvent},
[switch]
${MouseUpEvent},
[switch]
${MouseWheelEvent},
[switch]
${NameProperty},
[switch]
${OpacityMaskProperty},
[switch]
${OpacityProperty},
[switch]
${OverridesDefaultStyleProperty},
[switch]
${PaddingProperty},
[switch]
${PreviewDragEnterEvent},
[switch]
${PreviewDragLeaveEvent},
[switch]
${PreviewDragOverEvent},
[switch]
${PreviewDropEvent},
[switch]
${PreviewGiveFeedbackEvent},
[switch]
${PreviewGotKeyboardFocusEvent},
[switch]
${PreviewKeyDownEvent},
[switch]
${PreviewKeyUpEvent},
[switch]
${PreviewLostKeyboardFocusEvent},
[switch]
${PreviewMouseDoubleClickEvent},
[switch]
${PreviewMouseDownEvent},
[switch]
${PreviewMouseLeftButtonDownEvent},
[switch]
${PreviewMouseLeftButtonUpEvent},
[switch]
${PreviewMouseMoveEvent},
[switch]
${PreviewMouseRightButtonDownEvent},
[switch]
${PreviewMouseRightButtonUpEvent},
[switch]
${PreviewMouseUpEvent},
[switch]
${PreviewMouseWheelEvent},
[switch]
${PreviewQueryContinueDragEvent},
[switch]
${PreviewStylusButtonDownEvent},
[switch]
${PreviewStylusButtonUpEvent},
[switch]
${PreviewStylusDownEvent},
[switch]
${PreviewStylusInAirMoveEvent},
[switch]
${PreviewStylusInRangeEvent},
[switch]
${PreviewStylusMoveEvent},
[switch]
${PreviewStylusOutOfRangeEvent},
[switch]
${PreviewStylusSystemGestureEvent},
[switch]
${PreviewStylusUpEvent},
[switch]
${PreviewTextInputEvent},
[switch]
${PreviewTouchDownEvent},
[switch]
${PreviewTouchMoveEvent},
[switch]
${PreviewTouchUpEvent},
[switch]
${QueryContinueDragEvent},
[switch]
${QueryCursorEvent},
[switch]
${RenderTransformOriginProperty},
[switch]
${RenderTransformProperty},
[switch]
${RequestBringIntoViewEvent},
[switch]
${ShowSeparatorsProperty},
[switch]
${SizeChangedEvent},
[switch]
${SnapsToDevicePixelsProperty},
[switch]
${StyleProperty},
[switch]
${StylusButtonDownEvent},
[switch]
${StylusButtonUpEvent},
[switch]
${StylusDownEvent},
[switch]
${StylusEnterEvent},
[switch]
${StylusInAirMoveEvent},
[switch]
${StylusInRangeEvent},
[switch]
${StylusLeaveEvent},
[switch]
${StylusMoveEvent},
[switch]
${StylusOutOfRangeEvent},
[switch]
${StylusSystemGestureEvent},
[switch]
${StylusUpEvent},
[switch]
${TabIndexProperty},
[switch]
${TagProperty},
[switch]
${TemplateProperty},
[switch]
${TextInputEvent},
[switch]
${ToolTipClosingEvent},
[switch]
${ToolTipOpeningEvent},
[switch]
${ToolTipProperty},
[switch]
${TouchDownEvent},
[switch]
${TouchEnterEvent},
[switch]
${TouchLeaveEvent},
[switch]
${TouchMoveEvent},
[switch]
${TouchUpEvent},
[switch]
${UidProperty},
[switch]
${UnloadedEvent},
[switch]
${UseLayoutRoundingProperty},
[switch]
${VerticalAlignmentProperty},
[switch]
${VerticalContentAlignmentProperty},
[switch]
${VisibilityProperty},
[switch]
${WidthProperty},
[switch]
${ShowSeparators},
${ParentWindow},
${ItemsSource},
${DisplayMemberPath},
${ItemTemplate},
${ItemTemplateSelector},
${ItemStringFormat},
${ItemBindingGroup},
${ItemContainerStyle},
${ItemContainerStyleSelector},
${ItemsPanel},
${GroupStyle},
${GroupStyleSelector},
[int]
${AlternationCount},
[switch]
${IsTextSearchEnabled},
[switch]
${IsTextSearchCaseSensitive},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_PropertyChanged},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.WindowCommands
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
$Type = 'MahApps.Metro.Controls.WindowCommands' -as [Type]
if (-not $Type) { return }
foreach ($k in $psBoundParameters.Keys) {
if (-not $k) {
continue
}
$type::$k
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-Planerator {
<#
.Example
New-Planerator
.Example
New-Planerator -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.Planerator
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.Planerator
#>
[OutputType([MahApps.Metro.Controls.Planerator])]
param(
[double]
${RotationX},
[double]
${RotationY},
[double]
${RotationZ},
[double]
${FieldOfView},
${Child},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.Planerator
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-ProgressRing {
<#
.Example
New-ProgressRing
.Example
New-ProgressRing -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.ProgressRing
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.ProgressRing
#>
[OutputType([MahApps.Metro.Controls.ProgressRing])]
param(
[double]
${MaxSideLength},
[double]
${EllipseDiameter},
${EllipseOffset},
[double]
${BindableWidth},
[switch]
${IsActive},
[switch]
${IsLarge},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.ProgressRing
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-RangeSlider {
<#
.Example
New-RangeSlider
.Example
New-RangeSlider -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.RangeSlider
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.RangeSlider
#>
[OutputType([MahApps.Metro.Controls.RangeSlider])]
param(
[int]
${Interval},
[int]
${AutoToolTipPrecision},
[System.Windows.Controls.Primitives.AutoToolTipPlacement]
${AutoToolTipPlacement},
[System.Windows.Controls.Primitives.TickPlacement]
${TickPlacement},
[switch]
${IsMoveToPointEnabled},
[double]
${TickFrequency},
[System.Windows.Controls.Orientation]
${Orientation},
[switch]
${IsSnapToTickEnabled},
[switch]
${ExtendedMode},
[switch]
${MoveWholeRange},
[double]
${MinRangeWidth},
[double]
${LowerValue},
[double]
${UpperValue},
[double]
${MinRange},
[double]
${Minimum},
[double]
${Maximum},
[double]
${Value},
[double]
${LargeChange},
[double]
${SmallChange},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_RangeSelectionChanged},
[scriptblock[]]
${On_LowerValueChanged},
[scriptblock[]]
${On_UpperValueChanged},
[scriptblock[]]
${On_LowerThumbDragStarted},
[scriptblock[]]
${On_LowerThumbDragCompleted},
[scriptblock[]]
${On_UpperThumbDragStarted},
[scriptblock[]]
${On_UpperThumbDragCompleted},
[scriptblock[]]
${On_CentralThumbDragStarted},
[scriptblock[]]
${On_CentralThumbDragCompleted},
[scriptblock[]]
${On_LowerThumbDragDelta},
[scriptblock[]]
${On_UpperThumbDragDelta},
[scriptblock[]]
${On_CentralThumbDragDelta},
[scriptblock[]]
${On_ValueChanged},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.RangeSlider
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-ToggleSwitchButton {
<#
.Example
New-ToggleSwitchButton
.Example
New-ToggleSwitchButton -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.ToggleSwitchButton
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.ToggleSwitchButton
#>
[OutputType([MahApps.Metro.Controls.ToggleSwitchButton])]
param(
${Content},
${SwitchForeground},
${IsChecked},
[switch]
${IsThreeState},
[switch]
${IsPressed},
${Command},
${CommandParameter},
${CommandTarget},
[System.Windows.Controls.ClickMode]
${ClickMode},
${ContentTemplate},
${ContentTemplateSelector},
${ContentStringFormat},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_Checked},
[scriptblock[]]
${On_Unchecked},
[scriptblock[]]
${On_Indeterminate},
[scriptblock[]]
${On_Click},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.ToggleSwitchButton
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
if ($command -is [string]) {
$module =$myInvocation.MyCommand.Module.ModuleName
$cmd =
Get-Command "Get-*Command" -Module $module |
Where-Object { $_.Parameters.$Command }
if ($cmd) {
$params = @{$Command = $true}
$psBoundParameters.Command = & $cmd @Params
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-TransitioningContentControl {
<#
.Example
New-TransitioningContentControl
.Example
New-TransitioningContentControl -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.TransitioningContentControl
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.TransitioningContentControl
#>
[OutputType([MahApps.Metro.Controls.TransitioningContentControl])]
param(
${Content},
${CustomVisualStates},
${CustomVisualStatesName},
[switch]
${IsTransitioning},
[MahApps.Metro.Controls.TransitionType]
${Transition},
[switch]
${RestartTransitionOnContentChange},
${ContentTemplate},
${ContentTemplateSelector},
${ContentStringFormat},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_TransitionCompleted},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.TransitioningContentControl
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-TiltBehavior {
<#
.Example
New-TiltBehavior
.Example
New-TiltBehavior -OutputXaml
.Description
Creates a new MahApps.Metro.Behaviours.TiltBehavior
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Behaviours.TiltBehavior
#>
[OutputType([MahApps.Metro.Behaviours.TiltBehavior])]
param(
[switch]
${KeepDragging},
[int]
${TiltFactor},
${RotatorParent},
[scriptblock[]]
${On_Changed},
[switch]
${OutputXaml}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Behaviours.TiltBehavior
} catch {
throw $_
return
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
Write-Output (,$Object)
}
end {
}
}
function New-MetroContentControl {
<#
.Example
New-MetroContentControl
.Example
New-MetroContentControl -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.MetroContentControl
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.MetroContentControl
#>
[OutputType([MahApps.Metro.Controls.MetroContentControl])]
param(
${Content},
[switch]
${ReverseTransition},
[switch]
${TransitionsEnabled},
[switch]
${OnlyLoadTransition},
${ContentTemplate},
${ContentTemplateSelector},
${ContentStringFormat},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.MetroContentControl
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-RevealImage {
<#
.Example
New-RevealImage
.Example
New-RevealImage -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.RevealImage
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.RevealImage
#>
[OutputType([MahApps.Metro.Controls.RevealImage])]
param(
${Content},
${Text},
${Image},
${ContentTemplate},
${ContentTemplateSelector},
${ContentStringFormat},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.RevealImage
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-Tile {
<#
.Example
New-Tile
.Example
New-Tile -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.Tile
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.Tile
#>
[OutputType([MahApps.Metro.Controls.Tile])]
param(
${Content},
${Title},
${Count},
[switch]
${KeepDragging},
[int]
${TiltFactor},
[int]
${TitleFontSize},
[int]
${CountFontSize},
[switch]
${IsDefault},
[switch]
${IsCancel},
[switch]
${IsPressed},
${Command},
${CommandParameter},
${CommandTarget},
[System.Windows.Controls.ClickMode]
${ClickMode},
${ContentTemplate},
${ContentTemplateSelector},
${ContentStringFormat},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_Click},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.Tile
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
if ($command -is [string]) {
$module =$myInvocation.MyCommand.Module.ModuleName
$cmd =
Get-Command "Get-*Command" -Module $module |
Where-Object { $_.Parameters.$Command }
if ($cmd) {
$params = @{$Command = $true}
$psBoundParameters.Command = & $cmd @Params
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-ToggleSwitch {
<#
.Example
New-ToggleSwitch
.Example
New-ToggleSwitch -OutputXaml
.Description
Creates a new MahApps.Metro.Controls.ToggleSwitch
.Parameter Resource
A Dictionary of Resources. Use this dictionary to store information that
the rest of the user interface needs to access.
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Controls.ToggleSwitch
#>
[OutputType([MahApps.Metro.Controls.ToggleSwitch])]
param(
${Content},
${OnLabel},
${OffLabel},
${Header},
${HeaderTemplate},
${SwitchForeground},
[System.Windows.FlowDirection]
${ContentDirection},
${IsChecked},
${ContentTemplate},
${ContentTemplateSelector},
${ContentStringFormat},
${BorderBrush},
${BorderThickness},
${Background},
${Foreground},
${FontFamily},
[double]
${FontSize},
${FontStretch},
${FontStyle},
${FontWeight},
[System.Windows.HorizontalAlignment]
${HorizontalContentAlignment},
[System.Windows.VerticalAlignment]
${VerticalContentAlignment},
[int]
${TabIndex},
[switch]
${IsTabStop},
${Padding},
${Template},
${Style},
[switch]
${OverridesDefaultStyle},
[switch]
${UseLayoutRounding},
${Triggers},
${DataContext},
${BindingGroup},
${Language},
${Name},
${Tag},
${InputScope},
${LayoutTransform},
[double]
${Width},
[double]
${MinWidth},
[double]
${MaxWidth},
[double]
${Height},
[double]
${MinHeight},
[double]
${MaxHeight},
[System.Windows.FlowDirection]
${FlowDirection},
${Margin},
[System.Windows.HorizontalAlignment]
${HorizontalAlignment},
[System.Windows.VerticalAlignment]
${VerticalAlignment},
${FocusVisualStyle},
${Cursor},
[switch]
${ForceCursor},
${ToolTip},
${ContextMenu},
${InputBindings},
${CommandBindings},
[switch]
${AllowDrop},
${RenderSize},
${RenderTransform},
${RenderTransformOrigin},
[double]
${Opacity},
${OpacityMask},
${BitmapEffect},
${Effect},
${BitmapEffectInput},
${CacheMode},
${Uid},
[System.Windows.Visibility]
${Visibility},
[switch]
${ClipToBounds},
${Clip},
[switch]
${SnapsToDevicePixels},
[switch]
${IsEnabled},
[switch]
${IsHitTestVisible},
[switch]
${Focusable},
[switch]
${IsManipulationEnabled},
[scriptblock[]]
${On_Checked},
[scriptblock[]]
${On_Unchecked},
[scriptblock[]]
${On_Indeterminate},
[scriptblock[]]
${On_Click},
[scriptblock[]]
${On_IsCheckedChanged},
[scriptblock[]]
${On_PreviewMouseDoubleClick},
[scriptblock[]]
${On_MouseDoubleClick},
[scriptblock[]]
${On_TargetUpdated},
[scriptblock[]]
${On_SourceUpdated},
[scriptblock[]]
${On_DataContextChanged},
[scriptblock[]]
${On_RequestBringIntoView},
[scriptblock[]]
${On_SizeChanged},
[scriptblock[]]
${On_Initialized},
[scriptblock[]]
${On_Loaded},
[scriptblock[]]
${On_Unloaded},
[scriptblock[]]
${On_ToolTipOpening},
[scriptblock[]]
${On_ToolTipClosing},
[scriptblock[]]
${On_ContextMenuOpening},
[scriptblock[]]
${On_ContextMenuClosing},
[scriptblock[]]
${On_PreviewMouseDown},
[scriptblock[]]
${On_MouseDown},
[scriptblock[]]
${On_PreviewMouseUp},
[scriptblock[]]
${On_MouseUp},
[scriptblock[]]
${On_PreviewMouseLeftButtonDown},
[scriptblock[]]
${On_MouseLeftButtonDown},
[scriptblock[]]
${On_PreviewMouseLeftButtonUp},
[scriptblock[]]
${On_MouseLeftButtonUp},
[scriptblock[]]
${On_PreviewMouseRightButtonDown},
[scriptblock[]]
${On_MouseRightButtonDown},
[scriptblock[]]
${On_PreviewMouseRightButtonUp},
[scriptblock[]]
${On_MouseRightButtonUp},
[scriptblock[]]
${On_PreviewMouseMove},
[scriptblock[]]
${On_MouseMove},
[scriptblock[]]
${On_PreviewMouseWheel},
[scriptblock[]]
${On_MouseWheel},
[scriptblock[]]
${On_MouseEnter},
[scriptblock[]]
${On_MouseLeave},
[scriptblock[]]
${On_GotMouseCapture},
[scriptblock[]]
${On_LostMouseCapture},
[scriptblock[]]
${On_QueryCursor},
[scriptblock[]]
${On_PreviewStylusDown},
[scriptblock[]]
${On_StylusDown},
[scriptblock[]]
${On_PreviewStylusUp},
[scriptblock[]]
${On_StylusUp},
[scriptblock[]]
${On_PreviewStylusMove},
[scriptblock[]]
${On_StylusMove},
[scriptblock[]]
${On_PreviewStylusInAirMove},
[scriptblock[]]
${On_StylusInAirMove},
[scriptblock[]]
${On_StylusEnter},
[scriptblock[]]
${On_StylusLeave},
[scriptblock[]]
${On_PreviewStylusInRange},
[scriptblock[]]
${On_StylusInRange},
[scriptblock[]]
${On_PreviewStylusOutOfRange},
[scriptblock[]]
${On_StylusOutOfRange},
[scriptblock[]]
${On_PreviewStylusSystemGesture},
[scriptblock[]]
${On_StylusSystemGesture},
[scriptblock[]]
${On_GotStylusCapture},
[scriptblock[]]
${On_LostStylusCapture},
[scriptblock[]]
${On_StylusButtonDown},
[scriptblock[]]
${On_StylusButtonUp},
[scriptblock[]]
${On_PreviewStylusButtonDown},
[scriptblock[]]
${On_PreviewStylusButtonUp},
[scriptblock[]]
${On_PreviewKeyDown},
[scriptblock[]]
${On_KeyDown},
[scriptblock[]]
${On_PreviewKeyUp},
[scriptblock[]]
${On_KeyUp},
[scriptblock[]]
${On_PreviewGotKeyboardFocus},
[scriptblock[]]
${On_GotKeyboardFocus},
[scriptblock[]]
${On_PreviewLostKeyboardFocus},
[scriptblock[]]
${On_LostKeyboardFocus},
[scriptblock[]]
${On_PreviewTextInput},
[scriptblock[]]
${On_TextInput},
[scriptblock[]]
${On_PreviewQueryContinueDrag},
[scriptblock[]]
${On_QueryContinueDrag},
[scriptblock[]]
${On_PreviewGiveFeedback},
[scriptblock[]]
${On_GiveFeedback},
[scriptblock[]]
${On_PreviewDragEnter},
[scriptblock[]]
${On_DragEnter},
[scriptblock[]]
${On_PreviewDragOver},
[scriptblock[]]
${On_DragOver},
[scriptblock[]]
${On_PreviewDragLeave},
[scriptblock[]]
${On_DragLeave},
[scriptblock[]]
${On_PreviewDrop},
[scriptblock[]]
${On_Drop},
[scriptblock[]]
${On_PreviewTouchDown},
[scriptblock[]]
${On_TouchDown},
[scriptblock[]]
${On_PreviewTouchMove},
[scriptblock[]]
${On_TouchMove},
[scriptblock[]]
${On_PreviewTouchUp},
[scriptblock[]]
${On_TouchUp},
[scriptblock[]]
${On_GotTouchCapture},
[scriptblock[]]
${On_LostTouchCapture},
[scriptblock[]]
${On_TouchEnter},
[scriptblock[]]
${On_TouchLeave},
[scriptblock[]]
${On_IsMouseDirectlyOverChanged},
[scriptblock[]]
${On_IsKeyboardFocusWithinChanged},
[scriptblock[]]
${On_IsMouseCapturedChanged},
[scriptblock[]]
${On_IsMouseCaptureWithinChanged},
[scriptblock[]]
${On_IsStylusDirectlyOverChanged},
[scriptblock[]]
${On_IsStylusCapturedChanged},
[scriptblock[]]
${On_IsStylusCaptureWithinChanged},
[scriptblock[]]
${On_IsKeyboardFocusedChanged},
[scriptblock[]]
${On_LayoutUpdated},
[scriptblock[]]
${On_GotFocus},
[scriptblock[]]
${On_LostFocus},
[scriptblock[]]
${On_IsEnabledChanged},
[scriptblock[]]
${On_IsHitTestVisibleChanged},
[scriptblock[]]
${On_IsVisibleChanged},
[scriptblock[]]
${On_FocusableChanged},
[scriptblock[]]
${On_ManipulationStarting},
[scriptblock[]]
${On_ManipulationStarted},
[scriptblock[]]
${On_ManipulationDelta},
[scriptblock[]]
${On_ManipulationInertiaStarting},
[scriptblock[]]
${On_ManipulationBoundaryFeedback},
[scriptblock[]]
${On_ManipulationCompleted},
[switch]
${OutputXaml},
[hashtable]
${Resource},
[hashtable]
${DataBinding},
[hashtable]
${RoutedEvent},
[string]
${ControlName},
[Alias('UIStyle')]
[string]
${VisualStyle},
[switch]
${Show},
[switch]
${ShowUI}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Controls.ToggleSwitch
} catch {
throw $_
return
}
if ($PSBoundParameters.ContainsKey("VisualStyle")) {
$Object.SetValue([ShowUI.ShowUISetting]::StyleNameProperty, $PSBoundParameters.VisualStyle)
$Null = $PSBoundParameters.Remove("VisualStyle")
}
$null = $psBoundParameters.Remove("Show")
if ($PsBoundParameters.ContainsKey("RoutedEvent")) {
$null = $PsBoundParameters.Remove("RoutedEvent")
foreach ($re in $RoutedEvent.GetEnumerator()) {
if ($re.Key -is [Windows.RoutedEvent]) {
$Null = $Object.AddHandler($re.Key, $re.Value -as $re.Key.HandlerType)
} else {
$Event = $object.GetType()::"$($re.Key)Event"
if ($Event) {
$null = $Object.AddHandler(
$Event,
$re.Value -as $Event.HandlerType
)
}
}
}
}
$Object.Resources.Timers =
New-Object Collections.Generic.Dictionary["string,Windows.Threading.DispatcherTimer"]
$Object.Resources.TemporaryControls = @{}
$Object.Resources.Scripts =
New-Object Collections.Generic.Dictionary["string,ScriptBlock"]
$Object.Uid = [GUID]::NewGuid()
if ($psBoundParameters.ContainsKey("DataBinding")) {
$null = $psBoundParameters.Remove("DataBinding")
foreach ($db in $DataBinding.GetEnumerator()) {
if ($db.Key -is [Windows.DependencyProperty]) {
$Null = $Object.SetBinding($db.Key, $db.Value)
} else {
$Prop = $Object.GetType()::"$($db.Key)Property"
if ($Prop) {
Write-Debug (
$Object.SetBinding(
$Prop,
$db.Value) | Out-String
)
}
}
}
}
$parentFunctionParameters =
try {
Get-Variable -Name psboundparameters -ValueOnly -Scope 1 -ErrorAction Ignore
} catch {
}
if ($parentFunctionParameters) {
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $parentFunctionParameters.GetEnumerator()) {
if (-not $psBoundParameters.Resource.ContainsKey($kv.Key)) {
$psBoundParameters.Resource[$kv.Key] = $kv.Value
}
}
} else {
$null = $psBoundParameters.Add("Resource", (@{} + $parentFunctionParameters))
}
}
if ($psBoundParameters.ContainsKey("Resource")) {
foreach ($kv in $psBoundParameters['Resource'].GetEnumerator())
{
$null = $object.Resources.Add($kv.Key, $kv.Value)
if ('Object', 'psBoundParameters','Show','AsJob','OutputXaml' -notcontains $kv.Key -and
$psBoundParameters.Keys -notcontains $kv.Key) {
Set-Variable -Name $kv.Key -Value $kv.Value
}
}
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
if ($ControlName) {
$object.SetValue([ShowUI.ShowUISetting]::ControlNameProperty, $ControlName)
}
Write-Output (,$Object)
}
end {
}
}
function New-ToUpperConverter {
<#
.Example
New-ToUpperConverter
.Example
New-ToUpperConverter -OutputXaml
.Description
Creates a new MahApps.Metro.Converters.ToUpperConverter
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Converters.ToUpperConverter
#>
[OutputType([MahApps.Metro.Converters.ToUpperConverter])]
param(
[switch]
${OutputXaml}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Converters.ToUpperConverter
} catch {
throw $_
return
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
Write-Output (,$Object)
}
end {
}
}
function New-ToLowerConverter {
<#
.Example
New-ToLowerConverter
.Example
New-ToLowerConverter -OutputXaml
.Description
Creates a new MahApps.Metro.Converters.ToLowerConverter
.Parameter OutputXaml
If Set, will output the object as XAML instead of creating it
.Synopsis
Creates a new MahApps.Metro.Converters.ToLowerConverter
#>
[OutputType([MahApps.Metro.Converters.ToLowerConverter])]
param(
[switch]
${OutputXaml}
)
begin {
}
process {
try {
$Object = New-Object MahApps.Metro.Converters.ToLowerConverter
} catch {
throw $_
return
}
Set-Property -property $psBoundParameters -inputObject $Object
if ($outputXaml) {
return $object | Out-Xaml -Flash
}
Write-Output (,$Object)
}
end {
}
}
Set-Alias -Name CloseTabItemAction -Value New-CloseTabItemAction
Set-Alias -Name SetFlyoutOpenAction -Value New-SetFlyoutOpenAction
Set-Alias -Name BindableResourceBehavior -Value New-BindableResourceBehavior
Set-Alias -Name BorderlessWindowBehavior -Value New-BorderlessWindowBehavior
Set-Alias -Name GlowWindowBehavior -Value New-GlowWindowBehavior
Set-Alias -Name WindowsSettingBehaviour -Value New-WindowsSettingBehaviour
Set-Alias -Name CustomValidationPopup -Value New-CustomValidationPopup
Set-Alias -Name DataGridNumericUpDownColumn -Value New-DataGridNumericUpDownColumn
Set-Alias -Name LoginDialogSettings -Value New-LoginDialogSettings
Set-Alias -Name CustomDialog -Value New-CustomDialog
Set-Alias -Name DropDownButton -Value New-DropDownButton
Set-Alias -Name FlipViewItem -Value New-FlipViewItem
Set-Alias -Name FlipView -Value New-FlipView
Set-Alias -Name Flyout -Value New-Flyout
Set-Alias -Name FlyoutsControl -Value New-FlyoutsControl
Set-Alias -Name Glow -Value New-Glow
Set-Alias -Name LayoutInvalidationCatcher -Value New-LayoutInvalidationCatcher
Set-Alias -Name MetroAnimatedSingleRowTabControl -Value New-MetroAnimatedSingleRowTabControl
Set-Alias -Name MetroAnimatedTabControl -Value New-MetroAnimatedTabControl
Set-Alias -Name MetroWindow -Value New-MetroWindow
Set-Alias -Name MetroNavigationWindow -Value New-MetroNavigationWindow
Set-Alias -Name MetroProgressBar -Value New-MetroProgressBar
Set-Alias -Name MetroTabControl -Value New-MetroTabControl
Set-Alias -Name MetroTabItem -Value New-MetroTabItem
Set-Alias -Name MultiFrameImage -Value New-MultiFrameImage
Set-Alias -Name NumericUpDown -Value New-NumericUpDown
Set-Alias -Name Pivot -Value New-Pivot
Set-Alias -Name PivotItem -Value New-PivotItem
Set-Alias -Name ScrollViewerOffsetMediator -Value New-ScrollViewerOffsetMediator
Set-Alias -Name SplitButton -Value New-SplitButton
Set-Alias -Name WindowButtonCommands -Value New-WindowButtonCommands
Set-Alias -Name WindowCommands -Value New-WindowCommands
Set-Alias -Name Planerator -Value New-Planerator
Set-Alias -Name ProgressRing -Value New-ProgressRing
Set-Alias -Name RangeSlider -Value New-RangeSlider
Set-Alias -Name ToggleSwitchButton -Value New-ToggleSwitchButton
Set-Alias -Name TransitioningContentControl -Value New-TransitioningContentControl
Set-Alias -Name TiltBehavior -Value New-TiltBehavior
Set-Alias -Name MetroContentControl -Value New-MetroContentControl
Set-Alias -Name RevealImage -Value New-RevealImage
Set-Alias -Name Tile -Value New-Tile
Set-Alias -Name ToggleSwitch -Value New-ToggleSwitch
Set-Alias -Name ToUpperConverter -Value New-ToUpperConverter
Set-Alias -Name ToLowerConverter -Value New-ToLowerConverter
Export-ModuleMember -Cmdlet * -Function * -Alias *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment