<My:MWindow  xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl"
             x:Class="B20UVLog.Windows.PLCSet"
            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:B20UVLog.Windows" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
            mc:Ignorable="d"
            WindowStyle="ToolWindow" WindowStartupLocation="CenterScreen"
            Title="PLC配置" Height="600" Width="1200">
    <Window.Resources>
        <Style TargetType="TextBox">
            <Setter Property="Height" Value="25"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
        </Style>
    </Window.Resources>
    <Window.DataContext>
        <viewmodels:PLCSetViewModel/>
    </Window.DataContext>
    <Grid Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <WrapPanel Grid.Row="0" Orientation="Horizontal">
            <Label Content="IP地址："/>
            <TextBox x:Name="PlcIpAddress" DockPanel.Dock="Left"  Width="120"/>
            <Label Content="端口号："/>
            <TextBox x:Name="PlcPort" DockPanel.Dock="Left"  Width="120"/>
            <My:MButton Type="Primary" x:Name="BtnChangeIpAndPort" Content="修改IP地址端口号"  Click="BtnChangeIpAndPort_Click" />
            <My:MButton Type="Primary" x:Name="BtnConnectPLC" Content="连接PLC"  Click="BtnConnectPLC_Click" />
            <My:MButton Type="Primary" x:Name="BtnStartPlcLogMonitor" Content="开启PLC监控"  Click="BtnStartPlcLogMonitor_Click" />
            <My:MButton Type="Primary" x:Name="BtnDisConnectPLC" Content="断开PLC连接"  Click="BtnDisConnectPLC_Click" />
        </WrapPanel>
        <WrapPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center">
            <Label Content="PLC地址："/>
            <TextBox x:Name="PlcAddress" DockPanel.Dock="Left" Width="100"/>
            <Label Content="写入值："/>
            <TextBox x:Name="TxbWriteValue" DockPanel.Dock="Left"  Width="150"/>
            <Label Content="长度："/>
            <TextBox x:Name="DataLength" DockPanel.Dock="Left" Text="1"  Width="50"/>
            <Label Content="数据类型："/>
            <My:MComboBox x:Name="CmbDataType" DockPanel.Dock="Left"  Width="100"/>
            <CheckBox x:Name="IsBatch"  Content="批量" Width="50" VerticalAlignment="Center"/>
            <My:MButton Type="Primary" x:Name="BtnReadPLC" Content="读取" Click="BtnReadPLC_Click" />
            <My:MButton Type="Primary"  x:Name="BtnWritePLC" Content="写入" Click="BtnWritePLC_Click" />
        </WrapPanel>
        <RichTextBox x:Name="RtbRunLog" Grid.Row="2">
            <FlowDocument>
            </FlowDocument>
        </RichTextBox>
    </Grid>
</My:MWindow>
