112 lines
5.1 KiB
XML
112 lines
5.1 KiB
XML
<Page
|
|
x:Class="HueUWP.Views.LightsView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:local="using:HueUWP.Views"
|
|
xmlns:convert="using:HueUWP.Helpers"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
|
mc:Ignorable="d">
|
|
|
|
<Page.Resources>
|
|
<convert:NullableBooleanConverter x:Key="BoolConverter"/>
|
|
</Page.Resources>
|
|
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<RelativePanel Grid.Row="0">
|
|
<TextBlock RelativePanel.AlignLeftWithPanel="True" FontSize="24" Margin="20,10,0,0">Hue Lights</TextBlock>
|
|
</RelativePanel>
|
|
|
|
<RelativePanel Grid.Row="1" Visibility="Visible" Name="FeedbackPanel">
|
|
<ProgressRing Height="60" Width="60" RelativePanel.AlignHorizontalCenterWithPanel="True" Margin=" 0,10,0,10" IsActive="True" Name="Loading" />
|
|
<TextBlock RelativePanel.AlignLeftWithPanel="True" Name="ErrorMessage" Margin="20,10,0,10"/>
|
|
</RelativePanel>
|
|
|
|
|
|
<RelativePanel Grid.Row="2" Margin="0,10,0,0" Name="LightListPanel">
|
|
<ListView x:Name="LightsList" ItemsSource="{Binding}" IsItemClickEnabled="True" ItemClick="LightsList_ItemClick" SelectionMode="Extended" RelativePanel.AlignBottomWithPanel="True" RelativePanel.AlignTopWithPanel="True" RelativePanel.AlignLeftWithPanel="True" RelativePanel.AlignRightWithPanel="True">
|
|
<ListView.ItemTemplate>
|
|
<DataTemplate x:Name="ListViewDataTemplate">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Rectangle Width="30" Height="30" Fill="{Binding Color}" Margin="10,0,0,0"/>
|
|
|
|
<StackPanel Orientation="Vertical" Width="140" Margin="10,0,0,0" >
|
|
<TextBlock Text="{Binding Name}" FontSize="24" />
|
|
<TextBlock Text="{Binding Type}" FontSize="14" />
|
|
</StackPanel>
|
|
|
|
<ToggleSwitch Margin="10,0,00,0" Toggled="ToggleSwitch_Toggled" IsOn="{Binding IsOn, Mode=TwoWay, Converter={StaticResource BoolConverter}}">
|
|
<ToggleSwitch.OffContent>Off</ToggleSwitch.OffContent>
|
|
<ToggleSwitch.OnContent>On</ToggleSwitch.OnContent>
|
|
</ToggleSwitch>
|
|
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ListView.ItemTemplate>
|
|
|
|
</ListView>
|
|
</RelativePanel>
|
|
|
|
</Grid>
|
|
|
|
<Page.BottomAppBar>
|
|
<CommandBar>
|
|
<!-- Update values -->
|
|
<AppBarButton Label="Change values" Name="ValuesButton" Click="ValuesButton_Click" Visibility="Collapsed">
|
|
<AppBarButton.Icon>
|
|
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph=""/>
|
|
</AppBarButton.Icon>
|
|
</AppBarButton>
|
|
<!-- Update on/off -->
|
|
<AppBarButton Label="On" Name="OnOffButton" Click="OnOffButton_Click" Visibility="Collapsed">
|
|
<AppBarButton.Icon>
|
|
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph=""/>
|
|
</AppBarButton.Icon>
|
|
</AppBarButton>
|
|
<!-- Group -->
|
|
<AppBarToggleButton Label="Select" Name="GroupButton" Click="GroupButton_Click">
|
|
<AppBarToggleButton.Icon>
|
|
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph=""/>
|
|
</AppBarToggleButton.Icon>
|
|
</AppBarToggleButton>
|
|
|
|
<AppBarSeparator Name="Seperator" />
|
|
|
|
<!-- Disco -->
|
|
<AppBarToggleButton Label="Disco" Name="DiscoButton" Click="DiscoButton_Click">
|
|
<AppBarToggleButton.Icon>
|
|
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph=""/>
|
|
</AppBarToggleButton.Icon>
|
|
</AppBarToggleButton>
|
|
|
|
<!-- Settings -->
|
|
<AppBarButton Label="Settings" Name="SettingsButton" Click="SettingsButton_Click">
|
|
<AppBarButton.Icon>
|
|
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph=""/>
|
|
</AppBarButton.Icon>
|
|
</AppBarButton>
|
|
<!-- Refresh -->
|
|
<AppBarButton Label="Refresh" Name="RefreshButton" Click="RefreshButton_Click">
|
|
<AppBarButton.Icon>
|
|
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph=""/>
|
|
</AppBarButton.Icon>
|
|
</AppBarButton>
|
|
|
|
|
|
<CommandBar.SecondaryCommands>
|
|
<AppBarButton Label="About" Click="AboutButton_Click"/>
|
|
<AppBarButton Label="Groups" Click="GroupsButton_Click"/>
|
|
</CommandBar.SecondaryCommands>
|
|
</CommandBar>
|
|
</Page.BottomAppBar>
|
|
|
|
</Page>
|
|
|