Browse Source

添加项目文件。

Landidi666 5 months ago
parent
commit
db53059bbf
7 changed files with 161 additions and 0 deletions
  1. 9 0
      App.xaml
  2. 14 0
      App.xaml.cs
  3. 10 0
      AssemblyInfo.cs
  4. 11 0
      EdgeVoyagerWPF.csproj
  5. 22 0
      EdgeVoyagerWPF.sln
  6. 35 0
      MainWindow.xaml
  7. 60 0
      MainWindow.xaml.cs

+ 9 - 0
App.xaml

@@ -0,0 +1,9 @@
+<Application x:Class="EdgeVoyagerWPF.App"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:local="clr-namespace:EdgeVoyagerWPF"
+             StartupUri="MainWindow.xaml">
+    <Application.Resources>
+         
+    </Application.Resources>
+</Application>

+ 14 - 0
App.xaml.cs

@@ -0,0 +1,14 @@
+using System.Configuration;
+using System.Data;
+using System.Windows;
+
+namespace EdgeVoyagerWPF
+{
+    /// <summary>
+    /// Interaction logic for App.xaml
+    /// </summary>
+    public partial class App : Application
+    {
+    }
+
+}

+ 10 - 0
AssemblyInfo.cs

@@ -0,0 +1,10 @@
+using System.Windows;
+
+[assembly: ThemeInfo(
+    ResourceDictionaryLocation.None,            //where theme specific resource dictionaries are located
+                                                //(used if a resource is not found in the page,
+                                                // or application resource dictionaries)
+    ResourceDictionaryLocation.SourceAssembly   //where the generic resource dictionary is located
+                                                //(used if a resource is not found in the page,
+                                                // app, or any theme specific resource dictionaries)
+)]

+ 11 - 0
EdgeVoyagerWPF.csproj

@@ -0,0 +1,11 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>WinExe</OutputType>
+    <TargetFramework>net8.0-windows</TargetFramework>
+    <Nullable>enable</Nullable>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <UseWPF>true</UseWPF>
+  </PropertyGroup>
+
+</Project>

+ 22 - 0
EdgeVoyagerWPF.sln

@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.12.35527.113 d17.12
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EdgeVoyagerWPF", "EdgeVoyagerWPF.csproj", "{702ABF4A-1EB1-44B5-ABBF-2A61F5067606}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{702ABF4A-1EB1-44B5-ABBF-2A61F5067606}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{702ABF4A-1EB1-44B5-ABBF-2A61F5067606}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{702ABF4A-1EB1-44B5-ABBF-2A61F5067606}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{702ABF4A-1EB1-44B5-ABBF-2A61F5067606}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 35 - 0
MainWindow.xaml

@@ -0,0 +1,35 @@
+<Window x:Class="EdgeVoyagerWPF.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:local="clr-namespace:EdgeVoyagerWPF"
+        mc:Ignorable="d"
+        Title="MainWindow" Height="450" Width="800">
+    <Grid>
+        <Menu Margin="0,0,0,391">
+            <MenuItem Header="_Edit">
+                <MenuItem Command="ApplicationCommands.Copy"/>
+                <MenuItem Command="ApplicationCommands.Cut"/>
+                <MenuItem Command="ApplicationCommands.Paste"/>
+            </MenuItem>
+            <MenuItem Header="_Font">
+                <MenuItem Header="_Bold" IsCheckable="True"
+              Checked="Bold_Checked"
+              Unchecked="Bold_Unchecked"/>
+                <MenuItem Header="_Italic" IsCheckable="True"
+              Checked="Italic_Checked"
+              Unchecked="Italic_Unchecked"/>
+                <Separator/>
+                <MenuItem Header="I_ncrease Font Size"
+              Click="IncreaseFont_Click"/>
+                <MenuItem Header="_Decrease Font Size"
+              Click="DecreaseFont_Click"/>
+            </MenuItem>
+        </Menu>
+        <TextBox Name="textBox1" TextWrapping="Wrap"
+         Margin="2,81,2,2">
+            The quick brown fox jumps over the lazy dog.
+        </TextBox>
+    </Grid>
+</Window>

+ 60 - 0
MainWindow.xaml.cs

@@ -0,0 +1,60 @@
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace EdgeVoyagerWPF
+{
+    /// <summary>
+    /// Interaction logic for MainWindow.xaml
+    /// </summary>
+    public partial class MainWindow : Window
+    {
+        public MainWindow()
+        {
+            InitializeComponent();
+        }
+
+        private void Bold_Checked(object sender, RoutedEventArgs e)
+        {
+            textBox1.FontWeight = FontWeights.Bold;
+        }
+
+        private void Bold_Unchecked(object sender, RoutedEventArgs e)
+        {
+            textBox1.FontWeight = FontWeights.Normal;
+        }
+
+        private void Italic_Checked(object sender, RoutedEventArgs e)
+        {
+            textBox1.FontStyle = FontStyles.Italic;
+        }
+
+        private void Italic_Unchecked(object sender, RoutedEventArgs e)
+        {
+            textBox1.FontStyle = FontStyles.Normal;
+        }
+
+        private void IncreaseFont_Click(object sender, RoutedEventArgs e)
+        {
+            if (textBox1.FontSize < 18)
+            {
+                textBox1.FontSize += 2;
+            }
+        }
+
+        private void DecreaseFont_Click(object sender, RoutedEventArgs e)
+        {
+            if (textBox1.FontSize > 10)
+            {
+                textBox1.FontSize -= 2;
+            }
+        }
+    }
+}