Files

62 lines
3.1 KiB
XML

<Page
x:Class="HueUWP.Views.DetailView"
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:ctrl="using:Windows.UI.Xaml.Controls.Control"
mc:Ignorable="d">
<Page.Resources>
<convert:NullableBooleanConverter x:Key="BoolConverter"/>
<convert:VisibilityConverter x:Key="VisibilityConverter"/>
</Page.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<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" Text="{Binding Name}"/>
</RelativePanel>
<RelativePanel Grid.Row="1">
<TextBlock RelativePanel.AlignLeftWithPanel="True" FontSize="14" Margin="20,10,0,0" Text="{Binding Type}" TextWrapping="WrapWholeWords"/>
</RelativePanel>
<RelativePanel Grid.Row="2">
<Rectangle Fill="{Binding Color}" RelativePanel.AlignLeftWithPanel="True" RelativePanel.AlignRightWithPanel="True" Height="20" Margin="0,10,0,10" />
</RelativePanel>
<StackPanel Grid.Row="3">
<ToggleSwitch Margin="20,10,0,10" Toggled="ToggleSwitch_Toggled" IsOn="{Binding IsOn, Mode=TwoWay, Converter={StaticResource BoolConverter}}">
<ToggleSwitch.OffContent>Off</ToggleSwitch.OffContent>
<ToggleSwitch.OnContent>On</ToggleSwitch.OnContent>
</ToggleSwitch>
</StackPanel>
<StackPanel Grid.Row="4">
<StackPanel Margin="20,10,20,0" Visibility="{Binding HueEnabled, Converter={StaticResource VisibilityConverter}}">
<TextBlock FontSize="18">Hue</TextBlock>
<Slider Maximum="65535" Value="{Binding Hue, Mode=TwoWay}" PointerCaptureLost="Slider_Released"/>
</StackPanel>
<StackPanel Margin="20,10,20,0" Visibility="{Binding SaturationEnabled, Converter={StaticResource VisibilityConverter}}">
<TextBlock FontSize="18">Saturation</TextBlock>
<Slider Maximum="254" Value="{Binding Saturation, Mode=TwoWay}" PointerCaptureLost="Slider_Released" />
</StackPanel>
<StackPanel Margin="20,10,20,0" Visibility="{Binding BrightnessEnabled, Converter={StaticResource VisibilityConverter}}">
<TextBlock FontSize="18">Brightness</TextBlock>
<Slider Maximum="254" Value="{Binding Brightness, Mode=TwoWay}" PointerCaptureLost="Slider_Released"/>
</StackPanel>
</StackPanel>
</Grid>
</Page>