Werbung

Herkunft

Kurzinformation

Creates a new System.Windows.Media.Media3D.Viewport3DVisual

Syntax

<# .Description Creates a new System.Windows.Media.Media3D.Viewport3DVisual .Synopsis Creates a new System.Windows.Media.Media3D.Viewport3DVisual .Example New-Viewport3DVisual .Example New-Viewport3DVisual -OutputXaml .Example New-Viewport3DVisual -Show .Example New-Viewport3DVisual -AsJob .Parameter AsJob If Set, will show the visual in a background WPF Job .Parameter OutputXaml If Set, will output the object as XAML instead of creating it .Parameter Show If Set, will show the visual in a new window #> param( ${Clip}, [System.Double] ${Opacity}, ${OpacityMask}, ${BitmapEffect}, ${BitmapEffectInput}, ${Transform}, ${Offset}, ${Camera}, ${Viewport}, ${Children}, [Switch] ${OutputXaml}, [System.Collections.Hashtable] ${DependencyProperty}, [Switch] ${Show}, [System.Int32] ${Row}, [System.Int32] ${Column}, [System.Int32] ${RowSpan}, [System.Int32] ${ColumnSpan}, [System.Int32] ${ZIndex}, [System.Windows.Controls.Dock] ${Dock}, [System.Double] ${Top}, [System.Double] ${Left}, [Switch] ${AsJob} ) begin { } process { if ($PSBoundParameters.ContainsKey("AsJob")) { $null = $psBoundParameters.Remove("AsJob") $ScriptBlock = $MyInvocation.MyCommand.ScriptBlock $Command = $MyInvocation.InvocationName if (-not $Command) { $Command = "Start-WPFJob" } $Parameters = $PSBoundParameters $AdditionalContext = @(Get-PSCallstack)[1].InvocationInfo.MyCommand.Definition if (-not $AdditionalContext) { $AdditionalContext += {} } if ($AdditionalContext -like "*.ps1") { $AdditionalContext = [ScriptBlock]::Create( [IO.File]::ReadAllText($AdditionalContext) ) } else { $AdditionalContext = [ScriptBlock]::Create($AdditionalContext) } $JobParameters = @{ ScriptBlock = $MyInvocation.MyCommand.ScriptBlock Command = $Command AdditionalContext = $AdditionalContext Name = $Name } if (-not $JobParameters.Name) { $JobParameters.Name = $MyInvocation.InvocationName } if ($Parameters) { Start-WPFJob @JobParameters -Parameter $Parameters } else { Start-WPFJob @JobParameters } return } try { $Object = New-Object System.Windows.Media.Media3D.Viewport3DVisual } catch { throw $_ return } if ($PSBoundParameters.ContainsKey("Left")) { $object.SetValue([Windows.Controls.Canvas]::LeftProperty, $Left) $Null = $PSBoundParameters.Remove("Left") } if ($PSBoundParameters.ContainsKey("Top")) { $object.SetValue([Windows.Controls.Canvas]::TopProperty, $top) $Null = $PSBoundParameters.Remove("Top") } if ($PSBoundParameters.ContainsKey("Row")) { $Object.SetValue([Windows.Controls.Grid]::RowProperty, $row) $Null = $PSBoundParameters.Remove("Row") } if ($PSBoundParameters.ContainsKey("Column")) { $Object.SetValue([Windows.Controls.Grid]::ColumnProperty, $column) $Null = $PSBoundParameters.Remove("Column") } if ($PSBoundParameters.ContainsKey("RowSpan")) { $Object.SetValue([Windows.Controls.Grid]::RowSpanProperty, $rowSpan) $Null = $PSBoundParameters.Remove("RowSpan") } if ($PSBoundParameters.ContainsKey("ColumnSpan")) { $Object.SetValue([Windows.Controls.Grid]::ColumnSpanProperty, $columnSpan) $Null = $PSBoundParameters.Remove("ColumnSpan") } if ($PSBoundParameters.ContainsKey("ZIndex")) { $Object.SetValue([Windows.Controls.Panel]::ZIndexProperty, $ZIndex) $Null = $PSBoundParameters.Remove("ZIndex") } if ($PSBoundParameters.ContainsKey("Dock")) { $Object.SetValue([Windows.Controls.DockPanel]::DockProperty, $Dock) $Null = $PSBoundParameters.Remove("Dock") } $null = $psBoundParameters.Remove("Show") if ($PsBoundParameters.ContainsKey("DependencyProperty")) { $null = $PsBoundParameters.Remove("DependencyProperty") foreach ($dp in $dependencyProperty.GetEnumerator()) { if ($dp.Key -is [Windows.DependencyProperty]) { $Null = $Object.SetValue($dp.Key, $dp.Value) } else { $Prop = $Object.GetType()::"$($dp.Key)Property" if ($Prop) { $null = $Object.SetValue( $Prop, $dp.Value -as $Prop.PropertyType ) } } } } Set-Property -property $psBoundParameters -inputObject $Object if ($outputXaml) { $strWrite = New-Object IO.StringWriter ([xml]([Windows.Markup.XamlWriter]::Save($Object))).Save($strWrite) return "$strWrite" } if ($show) { return Show-Window $Object } $Object } end { }

Beschreibung

Creates a new System.Windows.Media.Media3D.Viewport3DVisual

Links

Liste aller Commandlets Mehr über die Windows PowerShell

Bücher zur PowerShell

Buchcover Windows PowerShell 5.0 - Das Praxishandbuch (1. Auflage 2016/5. Auflage Gesamtreihe) Windows PowerShell 5.0 - Das Praxishandbuch (1. Auflage 2016/5. Auflage Gesamtreihe)
Autoren: Dr. Holger Schwichtenberg
erschienen 2016, 996 Seiten, 49,99 €
ISBN: 3446446435
Bestellung: Amazon.de oder im Buchhandel über ISBN 3446446435

Schulungen/Seminare

Offene Seminare zur PowerShell
In-House-Seminare zur PowerShell