diff --git a/DeedyDesigner/Deedy.Design/AssemblyInfo.cs b/DeedyDesigner/Deedy.Design/AssemblyInfo.cs new file mode 100644 index 0000000..b0ec827 --- /dev/null +++ b/DeedyDesigner/Deedy.Design/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) +)] diff --git a/DeedyDesigner/Deedy.Design/Deedy.Design.csproj b/DeedyDesigner/Deedy.Design/Deedy.Design.csproj new file mode 100644 index 0000000..6c78894 --- /dev/null +++ b/DeedyDesigner/Deedy.Design/Deedy.Design.csproj @@ -0,0 +1,10 @@ + + + + net8.0-windows + enable + true + enable + + + diff --git a/DeedyDesigner/Deedy.Design/DeedyViewer.cs b/DeedyDesigner/Deedy.Design/DeedyViewer.cs new file mode 100644 index 0000000..6a600cd --- /dev/null +++ b/DeedyDesigner/Deedy.Design/DeedyViewer.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Deedy.Design +{ + /// + /// 按照步骤 1a 或 1b 操作,然后执行步骤 2 以在 XAML 文件中使用此自定义控件。 + /// + /// 步骤 1a) 在当前项目中存在的 XAML 文件中使用该自定义控件。 + /// 将此 XmlNamespace 特性添加到要使用该特性的标记文件的根 + /// 元素中: + /// + /// xmlns:MyNamespace="clr-namespace:Deedy.Design" + /// + /// + /// 步骤 1b) 在其他项目中存在的 XAML 文件中使用该自定义控件。 + /// 将此 XmlNamespace 特性添加到要使用该特性的标记文件的根 + /// 元素中: + /// + /// xmlns:MyNamespace="clr-namespace:Deedy.Design;assembly=Deedy.Design" + /// + /// 您还需要添加一个从 XAML 文件所在的项目到此项目的项目引用, + /// 并重新生成以避免编译错误: + /// + /// 在解决方案资源管理器中右击目标项目,然后依次单击 + /// “添加引用”->“项目”->[浏览查找并选择此项目] + /// + /// + /// 步骤 2) + /// 继续操作并在 XAML 文件中使用控件。 + /// + /// + /// + /// + public class DeedyViewer : Control + { + static DeedyViewer() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(DeedyViewer), new FrameworkPropertyMetadata(typeof(DeedyViewer))); + } + } +} diff --git a/DeedyDesigner/Deedy.Design/Themes/Generic.xaml b/DeedyDesigner/Deedy.Design/Themes/Generic.xaml new file mode 100644 index 0000000..268bfe2 --- /dev/null +++ b/DeedyDesigner/Deedy.Design/Themes/Generic.xaml @@ -0,0 +1,19 @@ + + + + + diff --git a/DeedyDesigner/DeedyDesigner.sln b/DeedyDesigner/DeedyDesigner.sln new file mode 100644 index 0000000..56da7c8 --- /dev/null +++ b/DeedyDesigner/DeedyDesigner.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35527.113 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Deedy.Design", "Deedy.Design\Deedy.Design.csproj", "{31386106-38FB-4CF6-A379-936CC292AFAE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {31386106-38FB-4CF6-A379-936CC292AFAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {31386106-38FB-4CF6-A379-936CC292AFAE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {31386106-38FB-4CF6-A379-936CC292AFAE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {31386106-38FB-4CF6-A379-936CC292AFAE}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal