Skip to content

Instantly share code, notes, and snippets.

@adamdriscoll
Created January 8, 2019 05:26
Show Gist options
  • Save adamdriscoll/eb56e88d4b55dcf13e99e539906220b5 to your computer and use it in GitHub Desktop.
Save adamdriscoll/eb56e88d4b55dcf13e99e539906220b5 to your computer and use it in GitHub Desktop.
Universal Dashboard view model support
Import-Module "F:\universal-dashboard\src\UniversalDashboard\bin\Debug\UniversalDashboard.Community.psd1"
$ViewModel = New-UDViewModel -Name "Home" -Members @{
Text = 1
Icon = 'user'
Click = New-UDEndpoint -Endpoint {
$this.Text++
$this.Icon = 'group'
}
Clear = New-UDEndpoint -Endpoint {
$this.Text = 0
$this.Icon = 'user'
}
}
$Dashboard = New-UDDashboard -Title "Test" -Content {
New-UDChip -LabelBinding "Text" -IconBinding 'Icon'
New-UDChip -LabelBinding "Text" -IconBinding 'Icon'
New-UDChip -LabelBinding "Text" -IconBinding 'Icon'
New-UDChip -Label 'Click Me!' -OnClickBinding "Click" -Clickable
New-UDChip -Label 'Clear Me!' -OnClickBinding "Clear" -Clickable
} -ViewModel $ViewModel
Start-UDDashboard -Port 10001 -Dashboard $Dashboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment