LibS7Adv/PLCControl.xaml

44 lines
1.8 KiB
Plaintext
Raw Normal View History

2024-06-22 14:08:27 -03:00
<UserControl x:Class="LibS7Adv.PLCControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2024-06-22 19:07:41 -03:00
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:LibS7Adv"
xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" >
2024-06-22 14:08:27 -03:00
<UserControl.DataContext>
<local:PLCViewModel />
</UserControl.DataContext>
2024-06-22 19:07:41 -03:00
<UserControl.Resources>
2024-06-22 14:08:27 -03:00
2024-06-22 19:07:41 -03:00
<!-- Style for Connect/Disconnect Button -->
<Style x:Key="ConnectDisconnectButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Transparent" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsConnected}" Value="True">
<Setter Property="Background" Value="LightGreen" />
</DataTrigger>
</Style.Triggers>
</Style>
2024-06-22 14:08:27 -03:00
2024-06-22 19:07:41 -03:00
</UserControl.Resources>
2024-06-22 14:08:27 -03:00
2024-06-22 19:07:41 -03:00
<Grid>
<StackPanel>
<xctk:PropertyGrid MinWidth="300" x:Name="PanelEdicion" AutoGenerateProperties="True"
SelectedObject="{Binding PlcData}" ShowDescriptionByTooltip="True" ShowSearchBox="False"
ShowSortOptions="False" ForceCursor="True" Margin="5,5,5,5" />
2024-06-22 14:08:27 -03:00
2024-06-22 19:07:41 -03:00
<ToolBarTray>
<ToolBar>
<Button Command="{Binding ConnectButtonCommand}" ToolTip="Conectar PLC"
Style="{StaticResource ConnectDisconnectButtonStyle}">
<StackPanel>
<Image Source="Icons/connect.png" Width="24" Height="24" />
<TextBlock Text="Conectar" />
</StackPanel>
</Button>
</ToolBar>
</ToolBarTray>
</StackPanel>
2024-06-22 14:08:27 -03:00
</Grid>
2024-06-22 19:07:41 -03:00
2024-06-22 14:08:27 -03:00
</UserControl>