Explorar el Código

1.更改主窗口背景;
2.添加图标。

Yumin hace 6 años
padre
commit
eccbef498a
Se han modificado 4 ficheros con 10 adiciones y 4 borrados
  1. 1 1
      FaceChange/AppContext.cs
  2. BIN
      FaceChange/Face.ico
  3. 6 0
      FaceChange/FaceChange.csproj
  4. 3 3
      FaceChange/MainWindow.xaml

+ 1 - 1
FaceChange/AppContext.cs

@@ -125,7 +125,7 @@ namespace FaceChange
                 _serialPort.Read(readBuffer, 0, len);
                 // 处理 readBuffer 中的数据,自定义处理过程
                 var msg = Encoding.Default.GetString(readBuffer, 0, len);
-                Console.WriteLine(msg);
+                Console.Write(msg);
                 // 委托执行
                 var index = GetNoRepeatRandom(0, _faces.Count);
                 ThreadProcSafePost(index);

BIN
FaceChange/Face.ico


+ 6 - 0
FaceChange/FaceChange.csproj

@@ -34,6 +34,9 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup>
+    <ApplicationIcon>Face.ico</ApplicationIcon>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />
     <Reference Include="System.Data" />
@@ -121,6 +124,9 @@
   <ItemGroup>
     <None Include="App.config" />
   </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Face.ico" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.

+ 3 - 3
FaceChange/MainWindow.xaml

@@ -5,9 +5,9 @@
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:FaceChange"
         mc:Ignorable="d"
-        Title="魔幻变脸" Height="500" Width="500" KeyDown="Window_KeyDown" ResizeMode="CanMinimize" Loaded="Window_Loaded" Closing="Window_Closing">
-    <Grid>
-        <ToolBar x:Name="ToolBar" VerticalAlignment="Top" Padding="0,0" Height="32">
+        Title="魔幻变脸" Height="500" Width="500" KeyDown="Window_KeyDown" ResizeMode="CanMinimize" Loaded="Window_Loaded" Closing="Window_Closing" Icon="Face.ico">
+    <Grid Background="Black">
+        <ToolBar x:Name="ToolBar" VerticalAlignment="Top" Padding="0,0" Margin="0,0" Height="32">
             <Button x:Name="Settings" Content="&#xF013; 设置" ToolTip="设置" Style="{StaticResource FontAwesome}" Click="Settings_Click" VerticalAlignment="Stretch"/>
             <Separator/>
             <Button x:Name="FullScreen" Content="&#xF31E; 全屏" ToolTip="全屏" Style="{StaticResource FontAwesome}" Click="FullScreen_Click" VerticalAlignment="Stretch"/>