Files

59 lines
2.8 KiB
XML

<Page
x:Class="HueUWP.Views.GroupsView"
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 Groups</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="GroupListPanel">
<ListView x:Name="GroupsList" ItemsSource="{Binding}" IsItemClickEnabled="True" ItemClick="GroupsList_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>