1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
| <Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp8"
mc:Ignorable="d"
Title="MainWindow" Height="425" Width="815"
Background="{Binding FORM_General_Background, FallbackValue='Bisque'}">
<Window.Resources>
<local:ListRectifiers x:Key="items"/>
<Style x:Key="HorizontalListBox">
<Setter Property="ListBox.ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</Style>
<DataTemplate x:Key="CellTemplate"
DataType="{x:Type local:Rectifier}">
<Button Background="{Binding CMD_General_Background,FallbackValue='Bisque'}"
BorderBrush="{Binding CMD_General_BorderBrush,FallbackValue='Black'}"
Cursor="Hand"
BorderThickness="{Binding CMD_General_BorderThickness,FallbackValue='1'}"
Command="{Binding CMD_Rectifier}">
<StackPanel Orientation="Vertical">
<Border BorderBrush="{Binding BORDER_General_BorderBrush, FallbackValue='Black'}"
BorderThickness="{Binding BORDER_General_BorderThickness, FallbackValue='2'}"
CornerRadius="1"
Height="{Binding BORDER_General_Height,FallbackValue='15'}"
Width="{Binding BORDER_General_Width,FallbackValue='25'}"
Background="{Binding Installed_Color,FallbackValue='Gray'}" >
<TextBlock Background="Transparent"
Foreground= "{Binding TXT_Title_Foreground,FallbackValue='Black'}"
FontSize="{Binding TXT_Title_Fontsize,FallbackValue='9'}"
Margin="0,1,0,1" TextAlignment="Center" VerticalAlignment ="Center"
Text="{Binding Installed_Text, FallbackValue=''}"/>
</Border>
<Border BorderBrush="{Binding BORDER_General_BorderBrush, FallbackValue='Black'}"
BorderThickness="{Binding BORDER_General_BorderThickness, FallbackValue='2'}"
CornerRadius="1"
Height="{Binding BORDER_General_Height,FallbackValue='15'}"
Width="{Binding BORDER_General_Width,FallbackValue='25'}"
Background="{Binding Logged_Color,FallbackValue='LightGreen'}">
<TextBlock Background="Transparent"
Foreground= "{Binding TXT_Title_Foreground,FallbackValue='Black'}"
FontSize="{Binding TXT_Title_Fontsize,FallbackValue='9'}"
Margin="0,1,0,1" TextAlignment="Center" VerticalAlignment ="Center"
Text="{Binding Logged_Text, FallbackValue=''}"/>
</Border>
<Border BorderBrush="{Binding BORDER_General_BorderBrush, FallbackValue='Black'}"
BorderThickness="{Binding BORDER_General_BorderThickness, FallbackValue='2'}"
CornerRadius="1"
Height="{Binding BORDER_General_Height,FallbackValue='15'}"
Width="{Binding BORDER_General_Width,FallbackValue='25'}"
Background="{Binding Idle_Color,FallbackValue='LightGreen'}">
<TextBlock Background="Transparent"
Foreground= "{Binding TXT_Title_Foreground,FallbackValue='Black'}"
FontSize="{Binding TXT_Title_Fontsize,FallbackValue='9'}"
Margin="0,1,0,1" TextAlignment="Center" VerticalAlignment ="Center"
Text="{Binding Idle_Text, FallbackValue=''}"/>
</Border>
<Border BorderBrush="{Binding BORDER_General_BorderBrush, FallbackValue='Black'}"
BorderThickness="{Binding BORDER_General_BorderThickness, FallbackValue='2'}"
CornerRadius="1"
Height="{Binding BORDER_General_Height,FallbackValue='15'}"
Width="{Binding BORDER_General_Width,FallbackValue='25'}"
Background="{Binding NotDetected_Color,FallbackValue='LightGreen'}">
<TextBlock Background="Transparent"
Foreground= "{Binding TXT_Title_Foreground,FallbackValue='Black'}"
FontSize="{Binding TXT_Title_Fontsize,FallbackValue='9'}"
Margin="0,1,0,1" TextAlignment="Center" VerticalAlignment ="Center"
Text="{Binding NotDetected_Text, FallbackValue=''}"/>
</Border>
<Border BorderBrush="{Binding BORDER_General_BorderBrush, FallbackValue='Black'}"
BorderThickness="{Binding BORDER_General_BorderThickness, FallbackValue='2'}"
CornerRadius="1"
Height="{Binding BORDER_General_Height,FallbackValue='15'}"
Width="{Binding BORDER_General_Width,FallbackValue='25'}"
Background="{Binding MajorAlarm_Color,FallbackValue='LightGreen'}">
<TextBlock Background="Transparent"
Foreground= "{Binding TXT_Title_Foreground,FallbackValue='Black'}"
FontSize="{Binding TXT_Title_Fontsize,FallbackValue='9'}"
Margin="0,1,0,1" TextAlignment="Center" VerticalAlignment ="Center"
Text="{Binding MajorAlarm_Text, FallbackValue=''}"/>
</Border>
<Border BorderBrush="{Binding BORDER_General_BorderBrush, FallbackValue='Black'}"
BorderThickness="{Binding BORDER_General_BorderThickness, FallbackValue='2'}"
CornerRadius="1"
Height="{Binding BORDER_General_Height,FallbackValue='15'}"
Width="{Binding BORDER_General_Width,FallbackValue='25'}"
Background="{Binding MinorAlarm_Color,FallbackValue='LightGreen'}">
<TextBlock Background="Transparent"
Foreground= "{Binding TXT_Title_Foreground,FallbackValue='Black'}"
FontSize="{Binding TXT_Title_Fontsize,FallbackValue='9'}"
Margin="0,1,0,1" TextAlignment="Center" VerticalAlignment ="Center"
Text="{Binding MinorAlarm_Text, FallbackValue=''}"/>
</Border>
<Border BorderBrush="{Binding BORDER_General_BorderBrush, FallbackValue='Black'}"
BorderThickness="{Binding BORDER_General_BorderThickness, FallbackValue='2'}"
Background="{Binding BORDER_General_Background,FallbackValue='Gray'}"
CornerRadius="1"
Height="{Binding BORDER_General_Height,FallbackValue='15'}"
Width="{Binding BORDER_General_Width,FallbackValue='25'}">
<TextBlock Background="Transparent"
Foreground= "{Binding TXT_Current_Foreground,FallbackValue='Yellow'}"
FontSize="{Binding TXT_Current_Fontsize,FallbackValue='9'}"
Margin="0,1,0,1" TextAlignment="Center" VerticalAlignment ="Center"
Text="{Binding Current, FallbackValue='30,2'}"/>
</Border>
<Border BorderBrush="{Binding BORDER_General_BorderBrush, FallbackValue='Black'}"
BorderThickness="{Binding BORDER_General_BorderThickness, FallbackValue='2'}"
Background="{Binding BORDER_General_Background,FallbackValue='Gray'}"
CornerRadius="1"
Height="{Binding BORDER_General_Height,FallbackValue='15'}"
Width="{Binding BORDER_General_Width,FallbackValue='25'}">
<TextBlock Background="Transparent"
Foreground= "{Binding TXT_Temperature_Foreground,FallbackValue='Yellow'}"
FontSize="{Binding TXT_Temperature_Fontsize,FallbackValue='9'}"
Margin="0,1,0,1" TextAlignment="Center" VerticalAlignment ="Center"
Text="{Binding Temperature, FallbackValue='- - -'}"/>
</Border>
<Border BorderBrush="{Binding BORDER_General_BorderBrush, FallbackValue='Black'}"
BorderThickness="{Binding BORDER_General_BorderThickness, FallbackValue='2'}"
Background="{Binding BORDER_General_Background,FallbackValue='Gray'}"
CornerRadius="1"
Height="{Binding BORDER_General_Height,FallbackValue='15'}"
Width="{Binding BORDER_General_Width,FallbackValue='25'}">
<TextBlock Background="Transparent"
Foreground= "{Binding TXT_Tension_Foreground,FallbackValue='Yellow'}"
FontSize="{Binding TXT_Tension_Fontsize,FallbackValue='9'}"
Margin="0,1,0,1" TextAlignment="Center" VerticalAlignment ="Center"
Text="{Binding Tension, FallbackValue='- - -'}"/>
</Border>
<Border BorderBrush="{Binding BORDER_General_BorderBrush, FallbackValue='Black'}"
BorderThickness="{Binding BORDER_General_BorderThickness, FallbackValue='2'}"
Background="{Binding BORDER_General_Background,FallbackValue='Gray'}"
CornerRadius="1"
Height="{Binding BORDER_General_Height,FallbackValue='15'}"
Width="{Binding BORDER_General_Width,FallbackValue='25'}">
<TextBlock Background="Transparent"
Foreground= "{Binding TXT_Tension_Foreground,FallbackValue='Yellow'}"
FontSize="{Binding TXT_Tension_Fontsize,FallbackValue='9'}"
Margin="0,1,0,1" TextAlignment="Center" VerticalAlignment ="Center"
Text="{Binding Idx, FallbackValue='- - -'}"/>
</Border>
</StackPanel>
</Button>
</DataTemplate>
<DataTemplate x:Key="RowTemplate"
>
<ListBox
BorderThickness="0"
Background="Bisque"
ItemsSource="{Binding}"
Style="{StaticResource HorizontalListBox}"
ItemTemplate="{StaticResource CellTemplate}" />
</DataTemplate>
</Window.Resources>
<Grid>
<ListBox
x:Name="lb"
ItemsSource="{Binding Source={StaticResource items}}"
ItemTemplate="{StaticResource RowTemplate}"
Background="Bisque"/>
</Grid>
</Window> |
Partager