Created
January 8, 2019 05:26
-
-
Save adamdriscoll/eb56e88d4b55dcf13e99e539906220b5 to your computer and use it in GitHub Desktop.
Universal Dashboard view model support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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