diff --git a/WPF基础.sln b/WPF基础.sln index 86f2861..b7124f5 100644 --- a/WPF基础.sln +++ b/WPF基础.sln @@ -54,6 +54,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF基础-11-动态布局", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF路由事件-1-引发路由事件", "WPF路由事件-1-引发路由事件\WPF路由事件-1-引发路由事件.csproj", "{1B8F7458-502C-45A7-9C47-1EF772DD7E19}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF路由事件-2-事件路由", "WPF路由事件-2-事件路由\WPF路由事件-2-事件路由.csproj", "{AB34E12C-1E74-45AA-9085-6CAA81361E90}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -168,5 +170,9 @@ Global {1B8F7458-502C-45A7-9C47-1EF772DD7E19}.Debug|Any CPU.Build.0 = Debug|Any CPU {1B8F7458-502C-45A7-9C47-1EF772DD7E19}.Release|Any CPU.ActiveCfg = Release|Any CPU {1B8F7458-502C-45A7-9C47-1EF772DD7E19}.Release|Any CPU.Build.0 = Release|Any CPU + {AB34E12C-1E74-45AA-9085-6CAA81361E90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AB34E12C-1E74-45AA-9085-6CAA81361E90}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AB34E12C-1E74-45AA-9085-6CAA81361E90}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AB34E12C-1E74-45AA-9085-6CAA81361E90}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/WPF路由事件-2-事件路由/App.xaml b/WPF路由事件-2-事件路由/App.xaml new file mode 100644 index 0000000..d6dd6e8 --- /dev/null +++ b/WPF路由事件-2-事件路由/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/WPF路由事件-2-事件路由/App.xaml.cs b/WPF路由事件-2-事件路由/App.xaml.cs new file mode 100644 index 0000000..bcfbcaa --- /dev/null +++ b/WPF路由事件-2-事件路由/App.xaml.cs @@ -0,0 +1,12 @@ +using System.Configuration; +using System.Data; +using System.Windows; + +namespace WPF路由事件_2_事件路由; + +/// +/// Interaction logic for App.xaml +/// +public partial class App : Application +{ +} \ No newline at end of file diff --git a/WPF路由事件-2-事件路由/AssemblyInfo.cs b/WPF路由事件-2-事件路由/AssemblyInfo.cs new file mode 100644 index 0000000..4a05c7d --- /dev/null +++ b/WPF路由事件-2-事件路由/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/WPF路由事件-2-事件路由/MainWindow.xaml b/WPF路由事件-2-事件路由/MainWindow.xaml new file mode 100644 index 0000000..662e8f2 --- /dev/null +++ b/WPF路由事件-2-事件路由/MainWindow.xaml @@ -0,0 +1,16 @@ + + + \ No newline at end of file diff --git a/WPF路由事件-2-事件路由/MainWindow.xaml.cs b/WPF路由事件-2-事件路由/MainWindow.xaml.cs new file mode 100644 index 0000000..955a6c9 --- /dev/null +++ b/WPF路由事件-2-事件路由/MainWindow.xaml.cs @@ -0,0 +1,29 @@ +using System.Windows; + +namespace WPF路由事件_2_事件路由; + +/// +/// Interaction logic for MainWindow.xaml +/// +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + } + + private void UIElement_OnMouseUp(object sender, RoutedEventArgs routedEventArgs) + { + var source = routedEventArgs.Source; + Console.WriteLine($"source:{source}"); + + var routedEventName = routedEventArgs.RoutedEvent.Name; + Console.WriteLine($"RoutedEvent.Name:{routedEventName}"); + + var originalSource = routedEventArgs.OriginalSource; + Console.WriteLine($"OriginalSource:{originalSource}"); + + var handled = routedEventArgs.Handled; + Console.WriteLine($"Handled:{handled}"); + } +} \ No newline at end of file diff --git a/WPF路由事件-2-事件路由/WPF路由事件-2-事件路由.csproj b/WPF路由事件-2-事件路由/WPF路由事件-2-事件路由.csproj new file mode 100644 index 0000000..077b4ce --- /dev/null +++ b/WPF路由事件-2-事件路由/WPF路由事件-2-事件路由.csproj @@ -0,0 +1,24 @@ + + + + WinExe + net8.0-windows + WPF路由事件_2_事件路由 + enable + enable + true + + + + + Always + + + Always + + + Always + + + + diff --git a/WPF路由事件-2-事件路由/public/images/003540AH4M72.jpg b/WPF路由事件-2-事件路由/public/images/003540AH4M72.jpg new file mode 100644 index 0000000..4aa96ac Binary files /dev/null and b/WPF路由事件-2-事件路由/public/images/003540AH4M72.jpg differ diff --git a/WPF路由事件-2-事件路由/public/logo/1.ico b/WPF路由事件-2-事件路由/public/logo/1.ico new file mode 100644 index 0000000..d7bff7f Binary files /dev/null and b/WPF路由事件-2-事件路由/public/logo/1.ico differ diff --git a/WPF路由事件-2-事件路由/public/logo/1.png b/WPF路由事件-2-事件路由/public/logo/1.png new file mode 100644 index 0000000..5dedbe2 Binary files /dev/null and b/WPF路由事件-2-事件路由/public/logo/1.png differ