Skip to content

Commit

Permalink
存到新文件
Browse files Browse the repository at this point in the history
  • Loading branch information
chao committed Aug 23, 2022
1 parent e782f91 commit cdabb72
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 59 deletions.
4 changes: 2 additions & 2 deletions SuperCom/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/ChaoControls.Style;Component/XAML/Skin/DefaultColor.xaml" />
<ResourceDictionary Source="pack://application:,,,/ChaoControls.Style;Component/Themes/ChaoControls.xaml" />
<ResourceDictionary Source="pack://application:,,,/SuperControls.Style;Component/XAML/Skin/DefaultColor.xaml" />
<ResourceDictionary Source="pack://application:,,,/SuperControls.Style;Component/Themes/SuperControls.xaml" />
<ResourceDictionary Source="pack://application:,,,/SuperCom;Component/CustomStyle/Basic.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
Expand Down
2 changes: 1 addition & 1 deletion SuperCom/CustomStyle/Basic.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<Style
x:Key="TitleButton"
BasedOn="{StaticResource NormalButton}"
BasedOn="{StaticResource FlatButton}"
TargetType="Button">
<Setter Property="Tag" Value="{DynamicResource Window.Title.Hover.Background}" />
<Setter Property="Height" Value="30" />
Expand Down
6 changes: 3 additions & 3 deletions SuperCom/CustomWindows/About.xaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<chao:BaseDialog
<super:BaseDialog
x:Class="SuperCom.CustomWindows.About"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:chao="https://gitee.com/secret/chao-controls"
xmlns:super="https://github.com/SuperStudio/SuperControls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SuperCom.CustomWindows"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Expand Down Expand Up @@ -86,4 +86,4 @@
Text="By SuperStudio" />
</StackPanel>
</Grid>
</chao:BaseDialog>
</super:BaseDialog>
4 changes: 2 additions & 2 deletions SuperCom/CustomWindows/About.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChaoControls.Style;
using SuperControls.Style;
using SuperCom.Utils;
using System;
using System.Collections.Generic;
Expand All @@ -19,7 +19,7 @@ namespace SuperCom.CustomWindows
/// <summary>
/// Interaction logic for About.xaml
/// </summary>
public partial class About : ChaoControls.Style.BaseDialog
public partial class About : SuperControls.Style.BaseDialog
{
public About(Window owner) : base(owner, false)
{
Expand Down
74 changes: 30 additions & 44 deletions SuperCom/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<chao:BaseWindow
<super:BaseWindow
x:Class="SuperCom.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:chao="https://gitee.com/secret/chao-controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SuperCom"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:super="https://github.com/SuperStudio/SuperControls"
Name="mainWindow"
Title="SuperCom-超级串口工具"
Width="1000"
Expand All @@ -17,7 +17,7 @@
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">

<chao:BaseWindow.Resources>
<super:BaseWindow.Resources>
<Style x:Key="BgHoverBorder" TargetType="Border">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="CornerRadius" Value="0" />
Expand All @@ -30,7 +30,7 @@
</Trigger>
</Style.Triggers>
</Style>
</chao:BaseWindow.Resources>
</super:BaseWindow.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30" />
Expand Down Expand Up @@ -118,7 +118,7 @@
<Button
Name="themeButton"
Width="40"
Style="{StaticResource NormalButton}"
Style="{StaticResource FlatButton}"
Tag="{DynamicResource Window.Title.Hover.Background}"
Visibility="Collapsed">
<Viewbox
Expand All @@ -136,9 +136,12 @@

<Button
Width="40"
Margin="0"
Padding="0"
VerticalAlignment="Stretch"
super:CommonExt.HoverBackground="{DynamicResource Window.Title.Hover.Background}"
Click="MinWindow"
Style="{StaticResource NormalButton}"
Tag="{DynamicResource Window.Title.Hover.Background}">
Style="{StaticResource FlatButton}">
<Viewbox
Width="12"
Height="auto"
Expand All @@ -153,9 +156,12 @@
<Button
Name="ButtonMax"
Width="40"
Margin="0"
Padding="0"
VerticalAlignment="Stretch"
super:CommonExt.HoverBackground="{DynamicResource Window.Title.Hover.Background}"
Click="OnMaxWindow"
Style="{StaticResource NormalButton}"
Tag="{DynamicResource Window.Title.Hover.Background}">
Style="{StaticResource FlatButton}">
<Viewbox
Width="12"
Height="auto"
Expand All @@ -171,9 +177,12 @@
<Button
Name="ButtonClose"
Width="40"
Margin="0"
Padding="0"
VerticalAlignment="Stretch"
super:CommonExt.HoverBackground="{DynamicResource Window.Title.Hover.Deep.Background}"
Click="CloseWindow"
Style="{StaticResource NormalButton}"
Tag="{DynamicResource Window.Title.Hover.Deep.Background}">
Style="{StaticResource FlatButton}">
<Viewbox
Width="12"
Height="auto"
Expand Down Expand Up @@ -220,7 +229,7 @@
Fill="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}" />
</Viewbox>
</Border>
<chao:SearchBox
<super:SearchBox
Name="searchBox"
Grid.Column="1"
Width="auto"
Expand Down Expand Up @@ -555,8 +564,9 @@
Width="28"
Height="24"
Margin="5,0,0,0"
super:CommonExt.HoverBackground="{DynamicResource Window.Title.Hover.Deep.Background}"
Click="ClearData"
Style="{StaticResource RoundCloseButton}">
Style="{StaticResource RoundNormalButton}">
<Viewbox
Width="15"
Height="auto"
Expand Down Expand Up @@ -593,7 +603,7 @@
Height="27"
Margin="5,0"
Click="OpenPath"
Style="{StaticResource RoundTitleButton}">
Style="{StaticResource RoundNormalButton}">
<Viewbox
Width="20"
Height="20"
Expand Down Expand Up @@ -644,30 +654,18 @@
<TextBlock Style="{StaticResource BaseTextBlock}" Text="BaudRate" />
<ComboBox
MinWidth="100"
Background="{DynamicResource Window.Side.Background}"
BorderBrush="{DynamicResource Window.Side.Hover.Background}"
Foreground="{DynamicResource Window.Foreground}"
ItemContainerStyle="{StaticResource NormalListBoxItem}"
SelectedIndex="0"
SelectionChanged="BaudRateChanged"
Style="{StaticResource NormalComboBox}"
Tag="{DynamicResource Window.Side.Hover.Background}"
ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}">
Style="{StaticResource BorderComboBox}">
<ComboBoxItem>115200</ComboBoxItem>
<ComboBoxItem>1500000</ComboBoxItem>
</ComboBox>
<TextBlock Style="{StaticResource BaseTextBlock}" Text="DataBits" />
<ComboBox
MinWidth="50"
Background="{DynamicResource Window.Side.Background}"
BorderBrush="{DynamicResource Window.Side.Hover.Background}"
Foreground="{DynamicResource Window.Foreground}"
ItemContainerStyle="{StaticResource NormalListBoxItem}"
SelectedIndex="3"
SelectionChanged="DataBitsChanged"
Style="{StaticResource NormalComboBox}"
Tag="{DynamicResource Window.Side.Hover.Background}"
ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}">
Style="{StaticResource BorderComboBox}">
<ComboBoxItem>5</ComboBoxItem>
<ComboBoxItem>6</ComboBoxItem>
<ComboBoxItem>7</ComboBoxItem>
Expand All @@ -676,31 +674,19 @@
<TextBlock Style="{StaticResource BaseTextBlock}" Text="StopBits" />
<ComboBox
MinWidth="70"
Background="{DynamicResource Window.Side.Background}"
BorderBrush="{DynamicResource Window.Side.Hover.Background}"
Foreground="{DynamicResource Window.Foreground}"
ItemContainerStyle="{StaticResource NormalListBoxItem}"
SelectedIndex="0"
SelectionChanged="StopBitsChanged"
Style="{StaticResource NormalComboBox}"
Tag="{DynamicResource Window.Side.Hover.Background}"
ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}">
Style="{StaticResource BorderComboBox}">
<ComboBoxItem>One</ComboBoxItem>
<ComboBoxItem>Two</ComboBoxItem>
<ComboBoxItem>OnePointFive</ComboBoxItem>
</ComboBox>
<TextBlock Style="{StaticResource BaseTextBlock}" Text="Parity" />
<ComboBox
MinWidth="80"
Background="{DynamicResource Window.Side.Background}"
BorderBrush="{DynamicResource Window.Side.Hover.Background}"
Foreground="{DynamicResource Window.Foreground}"
ItemContainerStyle="{StaticResource NormalListBoxItem}"
SelectedIndex="0"
SelectionChanged="ParityChanged"
Style="{StaticResource NormalComboBox}"
Tag="{DynamicResource Window.Side.Hover.Background}"
ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}">
Style="{StaticResource BorderComboBox}">
<ComboBoxItem>None</ComboBoxItem>
<ComboBoxItem>Odd</ComboBoxItem>
<ComboBoxItem>Even</ComboBoxItem>
Expand All @@ -715,7 +701,7 @@
Foreground="{DynamicResource Window.Foreground}"
ItemContainerStyle="{StaticResource NormalListBoxItem}"
SelectedIndex="0"
Style="{StaticResource NormalComboBox}"
Style="{StaticResource BorderComboBox}"
Tag="{DynamicResource Window.Side.Hover.Background}"
ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}">
<ComboBoxItem>None</ComboBoxItem>
Expand Down Expand Up @@ -808,4 +794,4 @@
TextWrapping="NoWrap" />
</Grid>
</Grid>
</chao:BaseWindow>
</super:BaseWindow>
9 changes: 7 additions & 2 deletions SuperCom/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChaoControls.Style;
using SuperControls.Style;
using SuperCom.CustomWindows;
using SuperCom.Entity;
using SuperCom.Utils;
Expand Down Expand Up @@ -297,7 +297,7 @@ await Task.Run(() =>

private void HandleDataReceived(CustomSerialPort serialPort)
{
string line = serialPort.ReadLine();
string line = serialPort.ReadExisting();
string portName = serialPort.PortName;
PortTabItem portTabItem = vieModel.PortTabItems.Where(arg => arg.Name.Equals(portName)).FirstOrDefault();
if (portTabItem != null)
Expand Down Expand Up @@ -651,5 +651,10 @@ private async void SaveToNewFile(object sender, RoutedEventArgs e)
}
(sender as FrameworkElement).IsEnabled = true;
}

private void tabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
{

}
}
}
7 changes: 3 additions & 4 deletions SuperCom/SuperCom.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
<ApplicationIcon>Resources\Ico\Icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="ChaoControls.Style, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\VS_workplace\Visual_Studio_Project\chao-controls\ChaoControls.Style\bin\Debug\ChaoControls.Style.dll</HintPath>
</Reference>
<Reference Include="CommonServiceLocator, Version=2.0.2.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..\packages\CommonServiceLocator.2.0.2\lib\net47\CommonServiceLocator.dll</HintPath>
</Reference>
Expand All @@ -60,6 +56,9 @@
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.4.1.0, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
</Reference>
<Reference Include="SuperControls.Style">
<HintPath>..\..\SuperControls\SuperControls.Style\bin\Debug\SuperControls.Style.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Reactive, Version=5.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
Expand Down
2 changes: 1 addition & 1 deletion SuperCom/Utils/FileHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChaoControls.Style;
using SuperControls.Style;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down

0 comments on commit cdabb72

Please sign in to comment.