diff --git a/3-WPF命令.sln b/3-WPF命令.sln index db64ee3..d1f5d24 100644 --- a/3-WPF命令.sln +++ b/3-WPF命令.sln @@ -16,6 +16,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "4-WPF资源-2资源层次", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "4-WPF资源-1资源集合", "4-WPF资源-1资源集合\4-WPF资源-1资源集合.csproj", "{9799011A-197B-4934-A691-7D1CF799AFE7}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "4-WPF资源-3资源字典", "4-WPF资源-3资源字典\4-WPF资源-3资源字典.csproj", "{CB76C66A-B6F0-4CB3-AF3E-3DF9FE0D4FE3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -54,5 +56,9 @@ Global {9799011A-197B-4934-A691-7D1CF799AFE7}.Debug|Any CPU.Build.0 = Debug|Any CPU {9799011A-197B-4934-A691-7D1CF799AFE7}.Release|Any CPU.ActiveCfg = Release|Any CPU {9799011A-197B-4934-A691-7D1CF799AFE7}.Release|Any CPU.Build.0 = Release|Any CPU + {CB76C66A-B6F0-4CB3-AF3E-3DF9FE0D4FE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CB76C66A-B6F0-4CB3-AF3E-3DF9FE0D4FE3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CB76C66A-B6F0-4CB3-AF3E-3DF9FE0D4FE3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CB76C66A-B6F0-4CB3-AF3E-3DF9FE0D4FE3}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/4-WPF资源-3资源字典/4-WPF资源-3资源字典.csproj b/4-WPF资源-3资源字典/4-WPF资源-3资源字典.csproj new file mode 100644 index 0000000..2f7fc16 --- /dev/null +++ b/4-WPF资源-3资源字典/4-WPF资源-3资源字典.csproj @@ -0,0 +1,18 @@ + + + + WinExe + net8.0-windows + _4_WPF资源_3资源字典 + enable + enable + true + + + + + Always + + + + diff --git a/4-WPF资源-3资源字典/App.xaml b/4-WPF资源-3资源字典/App.xaml new file mode 100644 index 0000000..6870d0b --- /dev/null +++ b/4-WPF资源-3资源字典/App.xaml @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/4-WPF资源-3资源字典/App.xaml.cs b/4-WPF资源-3资源字典/App.xaml.cs new file mode 100644 index 0000000..e4e6cd3 --- /dev/null +++ b/4-WPF资源-3资源字典/App.xaml.cs @@ -0,0 +1,12 @@ +using System.Configuration; +using System.Data; +using System.Windows; + +namespace _4_WPF资源_3资源字典; + +/// +/// Interaction logic for App.xaml +/// +public partial class App : Application +{ +} \ No newline at end of file diff --git a/4-WPF资源-3资源字典/AssemblyInfo.cs b/4-WPF资源-3资源字典/AssemblyInfo.cs new file mode 100644 index 0000000..4a05c7d --- /dev/null +++ b/4-WPF资源-3资源字典/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/4-WPF资源-3资源字典/ImageBrushDictionary.xaml b/4-WPF资源-3资源字典/ImageBrushDictionary.xaml new file mode 100644 index 0000000..e769474 --- /dev/null +++ b/4-WPF资源-3资源字典/ImageBrushDictionary.xaml @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/4-WPF资源-3资源字典/MainWindow.xaml b/4-WPF资源-3资源字典/MainWindow.xaml new file mode 100644 index 0000000..1eb1bbf --- /dev/null +++ b/4-WPF资源-3资源字典/MainWindow.xaml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/4-WPF资源-3资源字典/MainWindow.xaml.cs b/4-WPF资源-3资源字典/MainWindow.xaml.cs new file mode 100644 index 0000000..b140e13 --- /dev/null +++ b/4-WPF资源-3资源字典/MainWindow.xaml.cs @@ -0,0 +1,19 @@ +using System.Windows; + +namespace _4_WPF资源_3资源字典; + +/// +/// Interaction logic for MainWindow.xaml +/// +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + + var resourceDictionary = new ResourceDictionary + { + Source = new Uri("ImageBrushDictionary.xaml", UriKind.Relative) + }; + } +} \ No newline at end of file diff --git a/4-WPF资源-3资源字典/public/003540AH4M72.jpg b/4-WPF资源-3资源字典/public/003540AH4M72.jpg new file mode 100644 index 0000000..4aa96ac Binary files /dev/null and b/4-WPF资源-3资源字典/public/003540AH4M72.jpg differ