diff --git a/WPF基础.sln b/WPF基础.sln index 24f70da..49c79ee 100644 --- a/WPF基础.sln +++ b/WPF基础.sln @@ -68,6 +68,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF路由事件-7-鼠标状 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF路由事件-8-鼠标拖拽", "WPF路由事件-8-鼠标拖拽\WPF路由事件-8-鼠标拖拽.csproj", "{C88744AA-839B-473A-9A0D-DD9171AAA0AC}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF路由事件-9-操作", "WPF路由事件-9-操作\WPF路由事件-9-操作.csproj", "{42A632AB-5067-47DE-9DE1-C39E0ADE1408}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -210,5 +212,9 @@ Global {C88744AA-839B-473A-9A0D-DD9171AAA0AC}.Debug|Any CPU.Build.0 = Debug|Any CPU {C88744AA-839B-473A-9A0D-DD9171AAA0AC}.Release|Any CPU.ActiveCfg = Release|Any CPU {C88744AA-839B-473A-9A0D-DD9171AAA0AC}.Release|Any CPU.Build.0 = Release|Any CPU + {42A632AB-5067-47DE-9DE1-C39E0ADE1408}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {42A632AB-5067-47DE-9DE1-C39E0ADE1408}.Debug|Any CPU.Build.0 = Debug|Any CPU + {42A632AB-5067-47DE-9DE1-C39E0ADE1408}.Release|Any CPU.ActiveCfg = Release|Any CPU + {42A632AB-5067-47DE-9DE1-C39E0ADE1408}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/WPF路由事件-9-操作/App.xaml b/WPF路由事件-9-操作/App.xaml new file mode 100644 index 0000000..33b7519 --- /dev/null +++ b/WPF路由事件-9-操作/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/WPF路由事件-9-操作/App.xaml.cs b/WPF路由事件-9-操作/App.xaml.cs new file mode 100644 index 0000000..6732ab3 --- /dev/null +++ b/WPF路由事件-9-操作/App.xaml.cs @@ -0,0 +1,12 @@ +using System.Configuration; +using System.Data; +using System.Windows; + +namespace WPF路由事件_9_操作; + +/// +/// Interaction logic for App.xaml +/// +public partial class App : Application +{ +} \ No newline at end of file diff --git a/WPF路由事件-9-操作/AssemblyInfo.cs b/WPF路由事件-9-操作/AssemblyInfo.cs new file mode 100644 index 0000000..4a05c7d --- /dev/null +++ b/WPF路由事件-9-操作/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路由事件-9-操作/MainWindow.xaml b/WPF路由事件-9-操作/MainWindow.xaml new file mode 100644 index 0000000..b0ab31b --- /dev/null +++ b/WPF路由事件-9-操作/MainWindow.xaml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WPF路由事件-9-操作/MainWindow.xaml.cs b/WPF路由事件-9-操作/MainWindow.xaml.cs new file mode 100644 index 0000000..fa8aafd --- /dev/null +++ b/WPF路由事件-9-操作/MainWindow.xaml.cs @@ -0,0 +1,30 @@ +using System.Windows; +using System.Windows.Input; +using System.Windows.Media; + +namespace WPF路由事件_9_操作; + +/// +/// Interaction logic for MainWindow.xaml +/// +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + } + + private void Canvas_OnManipulationStarting(object? sender, ManipulationStartingEventArgs e) + { + e.ManipulationContainer = Canvas; + e.Mode = ManipulationModes.All; + } + + private void Canvas_OnManipulationDelta(object? sender, ManipulationDeltaEventArgs e) + { + var element = (UIElement)e.Source; + var matrix = ((MatrixTransform)element.RenderTransform).Matrix; + + var eDeltaManipulation = e.DeltaManipulation; + } +} \ No newline at end of file diff --git a/WPF路由事件-9-操作/WPF路由事件-9-操作.csproj b/WPF路由事件-9-操作/WPF路由事件-9-操作.csproj new file mode 100644 index 0000000..af0e9c3 --- /dev/null +++ b/WPF路由事件-9-操作/WPF路由事件-9-操作.csproj @@ -0,0 +1,21 @@ + + + + WinExe + net8.0-windows + WPF路由事件_9_操作 + enable + enable + true + + + + + Always + + + Always + + + + diff --git a/WPF路由事件-9-操作/public/logo.ico b/WPF路由事件-9-操作/public/logo.ico new file mode 100644 index 0000000..d7bff7f Binary files /dev/null and b/WPF路由事件-9-操作/public/logo.ico differ diff --git a/WPF路由事件-9-操作/public/test-image.jpg b/WPF路由事件-9-操作/public/test-image.jpg new file mode 100644 index 0000000..4aa96ac Binary files /dev/null and b/WPF路由事件-9-操作/public/test-image.jpg differ