From 54c64230d85fe23d0e8661f6cfef7747a0a5f1a4 Mon Sep 17 00:00:00 2001 From: Bunny <1319900154@qq.com> Date: Thu, 9 Jan 2025 11:42:24 +0800 Subject: [PATCH] =?UTF-8?q?WPF=E7=BB=91=E5=AE=9A=E5=85=83=E7=B4=A0-1-?= =?UTF-8?q?=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WPF控件.sln | 6 ++++ WPF绑定元素-1-示例/App.xaml | 9 ++++++ WPF绑定元素-1-示例/App.xaml.cs | 12 ++++++++ WPF绑定元素-1-示例/AssemblyInfo.cs | 10 +++++++ WPF绑定元素-1-示例/MainWindow.xaml | 24 ++++++++++++++++ WPF绑定元素-1-示例/MainWindow.xaml.cs | 29 ++++++++++++++++++++ WPF绑定元素-1-示例/WPF绑定元素-1-示例.csproj | 12 ++++++++ 7 files changed, 102 insertions(+) create mode 100644 WPF绑定元素-1-示例/App.xaml create mode 100644 WPF绑定元素-1-示例/App.xaml.cs create mode 100644 WPF绑定元素-1-示例/AssemblyInfo.cs create mode 100644 WPF绑定元素-1-示例/MainWindow.xaml create mode 100644 WPF绑定元素-1-示例/MainWindow.xaml.cs create mode 100644 WPF绑定元素-1-示例/WPF绑定元素-1-示例.csproj diff --git a/WPF控件.sln b/WPF控件.sln index e5c156e..5f41ee6 100644 --- a/WPF控件.sln +++ b/WPF控件.sln @@ -44,6 +44,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF控件-16-ProgressBar", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF控件-17-日期控件", "WPF控件-17-日期控件\WPF控件-17-日期控件.csproj", "{2F1CFE81-5AFC-4E79-A1FA-AABD7B6471D6}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF绑定元素-1-示例", "WPF绑定元素-1-示例\WPF绑定元素-1-示例.csproj", "{4AC0C9A3-D0F3-458C-AB1F-A71027447202}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -138,5 +140,9 @@ Global {2F1CFE81-5AFC-4E79-A1FA-AABD7B6471D6}.Debug|Any CPU.Build.0 = Debug|Any CPU {2F1CFE81-5AFC-4E79-A1FA-AABD7B6471D6}.Release|Any CPU.ActiveCfg = Release|Any CPU {2F1CFE81-5AFC-4E79-A1FA-AABD7B6471D6}.Release|Any CPU.Build.0 = Release|Any CPU + {4AC0C9A3-D0F3-458C-AB1F-A71027447202}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4AC0C9A3-D0F3-458C-AB1F-A71027447202}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4AC0C9A3-D0F3-458C-AB1F-A71027447202}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4AC0C9A3-D0F3-458C-AB1F-A71027447202}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/WPF绑定元素-1-示例/App.xaml b/WPF绑定元素-1-示例/App.xaml new file mode 100644 index 0000000..5442451 --- /dev/null +++ b/WPF绑定元素-1-示例/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/WPF绑定元素-1-示例/App.xaml.cs b/WPF绑定元素-1-示例/App.xaml.cs new file mode 100644 index 0000000..50db8a6 --- /dev/null +++ b/WPF绑定元素-1-示例/App.xaml.cs @@ -0,0 +1,12 @@ +using System.Configuration; +using System.Data; +using System.Windows; + +namespace WPF元素绑定_1_示例; + +/// +/// Interaction logic for App.xaml +/// +public partial class App : Application +{ +} \ No newline at end of file diff --git a/WPF绑定元素-1-示例/AssemblyInfo.cs b/WPF绑定元素-1-示例/AssemblyInfo.cs new file mode 100644 index 0000000..4a05c7d --- /dev/null +++ b/WPF绑定元素-1-示例/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绑定元素-1-示例/MainWindow.xaml b/WPF绑定元素-1-示例/MainWindow.xaml new file mode 100644 index 0000000..f6584f0 --- /dev/null +++ b/WPF绑定元素-1-示例/MainWindow.xaml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WPF绑定元素-1-示例/MainWindow.xaml.cs b/WPF绑定元素-1-示例/MainWindow.xaml.cs new file mode 100644 index 0000000..8f87d04 --- /dev/null +++ b/WPF绑定元素-1-示例/MainWindow.xaml.cs @@ -0,0 +1,29 @@ +using System.Windows; + +namespace WPF元素绑定_1_示例; + +/// +/// Interaction logic for MainWindow.xaml +/// +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + } + + private void SetLarge_OnClick(object sender, RoutedEventArgs e) + { + SliderFontSize.Value = 100; + } + + private void SetNormal_OnClick(object sender, RoutedEventArgs e) + { + SliderFontSize.Value = 40; + } + + private void SetSmall_OnClick(object sender, RoutedEventArgs e) + { + SliderFontSize.Value = 10; + } +} \ No newline at end of file diff --git a/WPF绑定元素-1-示例/WPF绑定元素-1-示例.csproj b/WPF绑定元素-1-示例/WPF绑定元素-1-示例.csproj new file mode 100644 index 0000000..7cb79da --- /dev/null +++ b/WPF绑定元素-1-示例/WPF绑定元素-1-示例.csproj @@ -0,0 +1,12 @@ + + + + WinExe + net8.0-windows + WPF元素绑定_1_示例 + enable + enable + true + + +