Permalink
Switch branches/tags
Nothing to show
Find file Copy path
f7db2cd Feb 12, 2017
1 contributor

Users who have contributed to this file

141 lines (141 sloc) 5.51 KB
<Window x:Class="SimpleHmi.Views.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Converters="clr-namespace:SimpleHmi.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:SimpleHmi.ViewModels"
Title="MainWindow"
Width="525"
Height="350"
mc:Ignorable="d">
<Window.Resources>
<Converters:BooleanToBrushConverter x:Key="BooleanToBrushConverter" />
</Window.Resources>
<Window.DataContext>
<vm:MainWindowViewModel />
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<TextBlock Width="117"
Height="17"
Margin="11,13,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Text="Ip address"
TextWrapping="Wrap" />
<TextBox Width="117"
Height="28"
Margin="11,35,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Text="{Binding IpAddress}"
TextWrapping="Wrap" />
<Button Width="90"
Height="28"
Margin="144,35,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Command="{Binding ConnectCommand,
Mode=OneWay}"
Content="Connect" />
<Button Width="90"
Height="28"
Margin="249,35,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Command="{Binding DisconnectCommand,
Mode=OneWay}"
Content="Disconnect" />
<Ellipse Width="19"
Height="18"
Margin="29,107,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Fill="{Binding HighLimit,
Converter={StaticResource BooleanToBrushConverter}}"
Stroke="Black" />
<TextBlock Width="117"
Height="17"
Margin="53,108,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Text="High limit"
TextWrapping="Wrap" />
<Ellipse Width="19"
Height="18"
Margin="29,136,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Fill="{Binding LowLimit,
Converter={StaticResource BooleanToBrushConverter}}"
Stroke="Black" />
<TextBlock Width="117"
Height="17"
Margin="53,137,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Text="Low limit"
TextWrapping="Wrap" />
<ProgressBar Width="145"
Height="18"
Margin="27,200,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Value="{Binding TankLevel}" />
<TextBlock Width="69"
Height="17"
Margin="27,183,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Text="Filling level:"
TextWrapping="Wrap" />
<TextBlock Width="61"
Height="17"
Margin="96,183,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Text="{Binding TankLevel,
StringFormat={}{0}%}"
TextWrapping="Wrap" />
<Ellipse Width="19"
Height="18"
Margin="183,200,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Fill="{Binding PumpState,
Converter={StaticResource BooleanToBrushConverter}}"
Stroke="Black" />
<TextBlock Width="117"
Height="17"
Margin="207,201,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Text="Pump state"
TextWrapping="Wrap" />
<Button Width="110"
Height="31"
Margin="339,94,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Command="{Binding StartCommand,
Mode=OneWay}"
Content="Start" />
<Button Width="110"
Height="31"
Margin="339,133,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Command="{Binding StopCommand,
Mode=OneWay}"
Content="Stop" />
<StatusBar Grid.Row="1">
<TextBlock Text="{Binding ConnectionState, StringFormat=Connection state: {0}}" />
<Separator />
<TextBlock Text="{Binding ScanTime, StringFormat=ScanTime {0}}" />
</StatusBar>
</Grid>
</Window>