commit 370dff18c091bc04a87ddf4710690afed5df2ceb Author: Bunny <1319900154@qq.com> Date: Thu Jan 9 17:17:05 2025 +0800 3-WPF命令 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ffd1659 --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ +logs/ +application-prod.yml +[b|B]in +[o|O]bj + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/3-WPF命令.sln b/3-WPF命令.sln new file mode 100644 index 0000000..420ac2f --- /dev/null +++ b/3-WPF命令.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "3-WPF命令", "3-WPF命令\3-WPF命令.csproj", "{8288325E-B69B-4111-8BC6-ADB148B94BE9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8288325E-B69B-4111-8BC6-ADB148B94BE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8288325E-B69B-4111-8BC6-ADB148B94BE9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8288325E-B69B-4111-8BC6-ADB148B94BE9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8288325E-B69B-4111-8BC6-ADB148B94BE9}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/3-WPF命令/3-WPF命令.csproj b/3-WPF命令/3-WPF命令.csproj new file mode 100644 index 0000000..27d3e20 --- /dev/null +++ b/3-WPF命令/3-WPF命令.csproj @@ -0,0 +1,19 @@ + + + + WinExe + net8.0-windows + _3_WPF命令 + enable + enable + true + + + + + + Always + + + + diff --git a/3-WPF命令/App.xaml b/3-WPF命令/App.xaml new file mode 100644 index 0000000..2e96691 --- /dev/null +++ b/3-WPF命令/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/3-WPF命令/App.xaml.cs b/3-WPF命令/App.xaml.cs new file mode 100644 index 0000000..d618c21 --- /dev/null +++ b/3-WPF命令/App.xaml.cs @@ -0,0 +1,12 @@ +using System.Configuration; +using System.Data; +using System.Windows; + +namespace _3_WPF命令; + +/// +/// Interaction logic for App.xaml +/// +public partial class App : Application +{ +} \ No newline at end of file diff --git a/3-WPF命令/AssemblyInfo.cs b/3-WPF命令/AssemblyInfo.cs new file mode 100644 index 0000000..4a05c7d --- /dev/null +++ b/3-WPF命令/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) +)] \ No newline at end of file diff --git a/3-WPF命令/MainWindow.xaml b/3-WPF命令/MainWindow.xaml new file mode 100644 index 0000000..cf3933c --- /dev/null +++ b/3-WPF命令/MainWindow.xaml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/3-WPF命令/MainWindow.xaml.cs b/3-WPF命令/MainWindow.xaml.cs new file mode 100644 index 0000000..bebe567 --- /dev/null +++ b/3-WPF命令/MainWindow.xaml.cs @@ -0,0 +1,23 @@ +using System.Windows; +using System.Windows.Input; + +namespace _3_WPF命令; + +/// +/// Interaction logic for MainWindow.xaml +/// +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + var commandBinding = new CommandBinding(ApplicationCommands.New); + commandBinding.Executed += New_Executed; + CommandBindings.Add(commandBinding); + } + + private void New_Executed(object sender, ExecutedRoutedEventArgs e) + { + MessageBox.Show("New command executed!"); + } +} \ No newline at end of file diff --git a/3-WPF命令/public/003540AH4M72.jpg b/3-WPF命令/public/003540AH4M72.jpg new file mode 100644 index 0000000..4aa96ac Binary files /dev/null and b/3-WPF命令/public/003540AH4M72.jpg differ