代码拉取完成,页面将自动刷新
<Window x:Class="BalanceAdapter.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:hc="https://handyorg.github.io/handycontrol"
xmlns:local="clr-namespace:BalanceAdapter"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
Loaded="Window_Loaded"
Icon="/Images/电子称.png"
Background="White"
Title="电子天平适配器" Height="450" Width="700"
Closing="Window_Closing"
ResizeMode="CanMinimize">
<Window.Resources>
<ResourceDictionary>
<WindowChrome x:Key="WindowChromeKey" GlassFrameThickness="-1">
<WindowChrome.ResizeBorderThickness>
<Thickness>5</Thickness>
</WindowChrome.ResizeBorderThickness>
<WindowChrome.CaptionHeight>0</WindowChrome.CaptionHeight>
</WindowChrome>
<SolidColorBrush x:Key="MainColor" Color="#FF5722"/>
<SolidColorBrush x:Key="FontColor" Color="#1A3b6c"/>
<SolidColorBrush x:Key="HoverColor" Color="#FF5722"/>
<SolidColorBrush x:Key="AlertColor" Color="#FF5722"/>
<SolidColorBrush x:Key="BlackColor" Color="#393D49"/>
<SolidColorBrush x:Key="RedColor" Color="#FF5722"/>
<SolidColorBrush x:Key="GrayColor" Color="#c2c2c2"/>
<SolidColorBrush x:Key="BlueColor" Color="#1E9FFF"/>
<SolidColorBrush x:Key="Tech1" Color="#081934"/>
<SolidColorBrush x:Key="BlackBlue" Color="#1A3b6c"/>
<SolidColorBrush x:Key="WhiteColor" Color="#FFFFFF"/>
</ResourceDictionary>
</Window.Resources>
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="20"></RowDefinition>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<GroupBox Grid.Column="0" Header="设备信息" Margin="5"
Style="{StaticResource InputElementBaseStyle}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
</Grid.RowDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<ComboBox Grid.Row="0" x:Name="cb_device" IsEditable="False" hc:InfoElement.Title="串口号:" hc:InfoElement.TitlePlacement="Left" Style="{StaticResource ComboBoxExtend}" Margin="0,16,0,0"/>
<ComboBox Grid.Row="1" x:Name="cb_rate" IsEditable="False" hc:InfoElement.Title="波特率:" hc:InfoElement.TitlePlacement="Left" Style="{StaticResource ComboBoxExtend}" Margin="0,16,0,0">
<ComboBoxItem IsSelected="True">9600</ComboBoxItem>
<ComboBoxItem>2400</ComboBoxItem>
<ComboBoxItem>4800</ComboBoxItem>
</ComboBox>
<ComboBox Grid.Row="2" x:Name="cb_databit" IsEditable="False" hc:InfoElement.Title="数据位:" hc:InfoElement.TitlePlacement="Left" Style="{StaticResource ComboBoxExtend}" Margin="0,16,0,0">
<ComboBoxItem IsSelected="True">8</ComboBoxItem>
<ComboBoxItem >7</ComboBoxItem>
<ComboBoxItem >6</ComboBoxItem>
<ComboBoxItem >5</ComboBoxItem>
</ComboBox>
<!--<ComboBox Grid.Row="3" x:Name="cb_stopbit" IsEditable="False" hc:InfoElement.Title="停止位" hc:InfoElement.TitlePlacement="Left" Style="{StaticResource ComboBoxExtend}" Margin="0,16,0,0">
<ComboBoxItem IsSelected="True">1</ComboBoxItem>
<ComboBoxItem >1.5</ComboBoxItem>
<ComboBoxItem >2</ComboBoxItem>
</ComboBox>-->
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" FontSize="14" x:Name="txt_state" HorizontalAlignment="Left" Text="设备未连接" Style="{StaticResource TextBlockDefaultDanger}"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="btn_connect" Click="btn_connect_Click" Width="80" Content="连接" Margin="5" Style="{StaticResource ButtonSuccess}"/>
<Button x:Name="btn_dis_connect" Click="btn_dis_connect_Click" Width="80" Content="断开连接" Margin="5" Style="{StaticResource ButtonDanger}" Visibility="Collapsed"/>
<Button x:Name="btn_test" Click="btn_test_Click" Width="80" Content="测试" Margin="5" Style="{StaticResource ButtonDanger}" Visibility="Collapsed"/>
</StackPanel>
</Grid>
</Grid>
</GroupBox>
<GroupBox Grid.Column="1" Header="称重结果" Margin="5"
Style="{StaticResource InputElementBaseStyle}">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10">
<TextBlock x:Name="txt_heavy" HorizontalAlignment="Left"
Text="" FontSize="40" TextWrapping="Wrap"
Style="{StaticResource TextBlockTitleBold}"/>
</StackPanel>
</GroupBox>
</Grid>
<TextBlock Grid.Row="1" VerticalAlignment="Center" Text="版权所有:北京际威试验仪器有限公司" HorizontalAlignment="Center"></TextBlock>
<hc:NotifyIcon Name="notifyIcon"
HorizontalAlignment="Left" Grid.Row="1"
VerticalAlignment="Top" Width="100" Icon="/Images/电子称.ico"
Click="notifyIcon_Click"
Text="际威电子天平转换"/>
</Grid>
</Window>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。