<UserControl x:Class="Bro.UI.Ctrls.DeviceStatusCtrl"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:local="clr-namespace:Bro.UI.Ctrls"
|
xmlns:Converter="clr-namespace:Bro.UI.Converter"
|
mc:Ignorable="d"
|
d:DesignHeight="450" d:DesignWidth="800" Background="Transparent">
|
<UserControl.Resources>
|
<Converter:DeviceStateColorConvert x:Key="dscConvert"/>
|
<Style TargetType="ListBox" x:Key="deviceStatusStyle">
|
<Setter Property="ItemsPanel">
|
<Setter.Value>
|
<ItemsPanelTemplate>
|
<StackPanel Orientation="Horizontal"/>
|
</ItemsPanelTemplate>
|
</Setter.Value>
|
</Setter>
|
<Setter Property="ItemTemplate">
|
<Setter.Value>
|
<DataTemplate>
|
<Grid>
|
<Border BorderBrush="SteelBlue" BorderThickness="1" CornerRadius="5" Background="{Binding CurrentState,Converter={StaticResource dscConvert},Mode=OneWay}">
|
<TextBlock Margin="3" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Text="{Binding InitialConfig.Name}"/>
|
</Border>
|
</Grid>
|
</DataTemplate>
|
</Setter.Value>
|
</Setter>
|
<Setter Property="ItemContainerStyle">
|
<Setter.Value>
|
<Style TargetType="ListBoxItem">
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
<Setter Property="Background" Value="Transparent"/>
|
<Setter Property="BorderThickness" Value="0"/>
|
</Style>
|
</Setter.Value>
|
</Setter>
|
</Style>
|
</UserControl.Resources>
|
<Grid Background="Transparent">
|
<ListBox Style="{StaticResource deviceStatusStyle}" x:Name="lbDevices" ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" Background="Transparent"/>
|
</Grid>
|
</UserControl>
|