Skip to content

Commit ab3455d

Browse files
committed
Convert Design projects to Sdk-style
- Add Design project for the UWP Media controls. - Update Solution to Use CPS for the Design projects. - Move 'MetadataRegistration.cs' file into Common folder. - Remove 'AssemblyInfo.cs' as it is generated by the .NET SDK. - Build Design project's parent first when not under solution build.
1 parent 2d74076 commit ab3455d

File tree

20 files changed

+501
-992
lines changed

20 files changed

+501
-992
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.Core.Design/MetadataRegistration.cs renamed to Microsoft.Toolkit.Uwp.UI.Controls.Core.Design/Common/MetadataRegistration.cs

+6-4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ public MetadataRegistration() : base()
2020
// Note:
2121
// The default constructor sets value of 'AssemblyFullName' and
2222
// 'XmlResourceName' used by 'MetadataRegistrationBase.AddDescriptions()'.
23-
// The convention here is that the <RootNamespace> in '.DesignTools.csproj'
24-
// (or Default namespace in Project -> Properties -> Application tab)
25-
// must be the same as runtime assembly's main namespace plus ".Design".
23+
// The convention here is that the root namespace plus the Controls category.
24+
// Example:
25+
// <RootNamespace> + "." + <ControlsCategory> + ".xml"
26+
// "Microsoft.Toolkit.Uwp.UI.Controls" + "." + "Primitives" + ".xml"
27+
2628
Type thisType = this.GetType();
2729
AssemblyName designLib = thisType.Assembly.GetName();
2830

@@ -31,7 +33,7 @@ public MetadataRegistration() : base()
3133
string controlLibName = designLib.Name.Remove(annexStart, annexString.Length);
3234

3335
AssemblyFullName = designLib.FullName;
34-
XmlResourceName = $"{thisType.Namespace}{controlLibName}.xml";
36+
XmlResourceName = $"{controlLibName}.xml";
3537
}
3638
}
3739
}
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,15 @@
1-
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
2+
33
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
6-
<ProjectGuid>{7AEFC959-ED7C-4D96-9E92-72609B40FBE0}</ProjectGuid>
7-
<OutputType>Library</OutputType>
8-
<AppDesignerFolder>Properties</AppDesignerFolder>
9-
<RootNamespace>Microsoft.Toolkit.Uwp.UI.Controls.Design</RootNamespace>
10-
<AssemblyName>Microsoft.Toolkit.Uwp.UI.Controls.Core.DesignTools</AssemblyName>
11-
<FileAlignment>512</FileAlignment>
12-
<TargetPlatformVersion>8.1</TargetPlatformVersion>
13-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
14-
<ValidateFrameworkCompatibility>false</ValidateFrameworkCompatibility>
15-
</PropertyGroup>
16-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
17-
<DebugSymbols>true</DebugSymbols>
18-
<OutputPath>..\Microsoft.Toolkit.Uwp.UI.Controls.Core\bin\Debug\uap10.0.17763\Design\</OutputPath>
19-
<DebugType>full</DebugType>
20-
<Optimize>false</Optimize>
21-
<DefineConstants>TRACE;DEBUG</DefineConstants>
22-
<PlatformTarget>x86</PlatformTarget>
23-
</PropertyGroup>
24-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
25-
<OutputPath>..\Microsoft.Toolkit.Uwp.UI.Controls.Core\bin\Release\uap10.0.17763\Design\</OutputPath>
26-
<DebugType>pdbonly</DebugType>
27-
<PlatformTarget>x86</PlatformTarget>
28-
<Optimize>true</Optimize>
29-
<DefineConstants>TRACE</DefineConstants>
4+
<TargetFramework>net472</TargetFramework>
5+
<RootNamespace>Microsoft.Toolkit.Uwp.UI.Controls</RootNamespace>
306
</PropertyGroup>
7+
318
<PropertyGroup>
32-
<NoWarn>$(NoWarn);0618</NoWarn>
33-
<AssetTargetFallback>$(AssetTargetFallback);uap10.0.17763</AssetTargetFallback>
9+
<AssemblyTitle>Windows Community Toolkit - Common Controls (DesignTools)</AssemblyTitle>
10+
<Description>Design time support for Windows Community Toolkit Common Controls</Description>
3411
</PropertyGroup>
35-
<ItemGroup>
36-
<Reference Include="System.Runtime" />
37-
<Reference Include="System.ObjectModel" />
38-
<Reference Include="System.Runtime.WindowsRuntime" />
39-
<Reference Include="System.Runtime.InteropServices.WindowsRuntime" />
40-
<Reference Include="Microsoft.VisualStudio.DesignTools.Extensibility">
41-
<SpecificVersion>False</SpecificVersion>
42-
<Private>False</Private>
43-
</Reference>
44-
<Reference Include="Microsoft.VisualStudio.DesignTools.Interaction">
45-
<SpecificVersion>False</SpecificVersion>
46-
<Private>False</Private>
47-
</Reference>
48-
<Reference Include="System" />
49-
<Reference Include="System.Core" />
50-
<Reference Include="System.Xml.Linq" />
51-
<Reference Include="System.Data.DataSetExtensions" />
52-
<Reference Include="Microsoft.CSharp" />
53-
<Reference Include="System.Data" />
54-
<Reference Include="System.Xml" />
55-
<Reference Include="Windows, Version=255.255.255.255, Culture=neutral, processorArchitecture=MSIL">
56-
<Private>False</Private>
57-
<SpecificVersion>False</SpecificVersion>
58-
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\10.0.17763.0\Windows.winmd</HintPath>
59-
</Reference>
60-
<Reference Include="WindowsBase" />
61-
<Reference Include="PresentationCore" />
62-
<Reference Include="PresentationFramework" />
63-
</ItemGroup>
64-
<ItemGroup Label="WinRT References">
65-
<Reference Include="System.Xaml" />
66-
<Reference Include="System.Runtime.WindowsRuntime.UI.Xaml" />
67-
<Reference Include="Windows.Foundation.FoundationContract">
68-
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\References\10.0.17763.0\Windows.Foundation.FoundationContract\3.0.0.0\Windows.Foundation.FoundationContract.winmd</HintPath>
69-
<Aliases>WindowsRuntime</Aliases>
70-
<Private>False</Private>
71-
</Reference>
72-
<Reference Include="Windows.Foundation.UniversalApiContract">
73-
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\References\10.0.17763.0\Windows.Foundation.UniversalApiContract\7.0.0.0\Windows.Foundation.UniversalApiContract.winmd</HintPath>
74-
<Aliases>WindowsRuntime</Aliases>
75-
<Private>False</Private>
76-
</Reference>
77-
</ItemGroup>
78-
<ItemGroup>
79-
<Compile Include="Common\Constants.cs" />
80-
<Compile Include="Common\MetadataRegistrationBase.cs" />
81-
<Compile Include="Common\PlatformTypes.cs" />
82-
<Compile Include="Controls\DropShadowPanel.Metadata.cs" />
83-
<Compile Include="Controls\DropShadowPanel.Typedata.cs" />
84-
<Compile Include="Controls\ImageEx.Metadata.cs" />
85-
<Compile Include="Controls\ImageEx.Typedata.cs" />
86-
<Compile Include="Controls\InAppNotification.Metadata.cs" />
87-
<Compile Include="Controls\InAppNotification.Typedata.cs" />
88-
<Compile Include="Controls\Loading.Metadata.cs" />
89-
<Compile Include="Controls\Loading.Typedata.cs" />
90-
<Compile Include="Controls\Menu.Metadata.cs" />
91-
<Compile Include="Controls\Menu.Typedata.cs" />
92-
<Compile Include="Controls\MenuItem.Metadata.cs" />
93-
<Compile Include="Controls\MenuItem.Typedata.cs" />
94-
<Compile Include="Controls\RadialProgressBar.Metadata.cs" />
95-
<Compile Include="Controls\RadialProgressBar.Typedata.cs" />
96-
<Compile Include="Controls\RotatorTile.Metadata.cs" />
97-
<Compile Include="Controls\RotatorTile.Typedata.cs" />
98-
<Compile Include="Controls\ScrollHeader.Metadata.cs" />
99-
<Compile Include="Controls\ScrollHeader.Typedata.cs" />
100-
<Compile Include="Controls\TabbedCommandBar.Metadata.cs" />
101-
<Compile Include="Controls\TabbedCommandBar.Typedata.cs" />
102-
<Compile Include="Controls\TabbedCommandBarItem.Metadata.cs" />
103-
<Compile Include="Controls\TabbedCommandBarItem.Typedata.cs" />
104-
<Compile Include="Controls\TextToolbar.Metadata.cs" />
105-
<Compile Include="Controls\TextToolbar.Typedata.cs" />
106-
<Compile Include="Controls\TileControl.Metadata.cs" />
107-
<Compile Include="Controls\TileControl.Typedata.cs" />
108-
<Compile Include="MetadataRegistration.cs" />
109-
<Compile Include="Properties\AssemblyInfo.cs">
110-
<SubType>Code</SubType>
111-
</Compile>
112-
<Compile Include="Properties\Resources.Designer.cs">
113-
<AutoGen>True</AutoGen>
114-
<DesignTime>True</DesignTime>
115-
<DependentUpon>Resources.resx</DependentUpon>
116-
</Compile>
117-
<EmbeddedResource Include="Properties\Resources.resx">
118-
<Generator>ResXFileCodeGenerator</Generator>
119-
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
120-
</EmbeddedResource>
121-
<AppDesigner Include="Properties\" />
122-
</ItemGroup>
123-
<ItemGroup>
124-
<EmbeddedResource Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Core\bin\$(Configuration)\uap10.0.17763\Microsoft.Toolkit.Uwp.UI.Controls.Core.xml">
125-
<Link>Microsoft.Toolkit.Uwp.UI.Controls.Core.xml</Link>
126-
<Visible>False</Visible>
127-
</EmbeddedResource>
128-
</ItemGroup>
129-
<ItemGroup>
130-
<EmbeddedResource Include="Icons\Microsoft.Toolkit.Uwp.UI.Controls.Menu.icon.png" />
131-
<EmbeddedResource Include="Icons\Microsoft.Toolkit.Uwp.UI.Controls.RotatorTile.icon.png" />
132-
</ItemGroup>
133-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
134-
<!-- No-op to avoid build error when packing solution from commandline -->
135-
<Target Name="Pack" />
12+
13+
<Import Project="$(BuildToolsDirectory)Windows.Toolkit.VisualStudio.Design.targets" />
14+
13615
</Project>

Microsoft.Toolkit.Uwp.UI.Controls.Core.Design/Properties/AssemblyInfo.cs

-32
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,19 @@
1-
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
2+
33
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
6-
<ProjectGuid>{6BD0BA4A-DE6D-3E87-8F83-63518C31ECD1}</ProjectGuid>
7-
<OutputType>Library</OutputType>
8-
<AppDesignerFolder>Properties</AppDesignerFolder>
9-
<RootNamespace>Microsoft.Toolkit.Uwp.UI.Controls.Design</RootNamespace>
10-
<AssemblyName>Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.DesignTools</AssemblyName>
11-
<FileAlignment>512</FileAlignment>
12-
<TargetPlatformVersion>8.1</TargetPlatformVersion>
13-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
14-
<ValidateFrameworkCompatibility>false</ValidateFrameworkCompatibility>
15-
</PropertyGroup>
16-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
17-
<DebugSymbols>true</DebugSymbols>
18-
<OutputPath>..\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid\bin\Debug\uap10.0.17763\Design\</OutputPath>
19-
<DebugType>full</DebugType>
20-
<Optimize>false</Optimize>
21-
<DefineConstants>TRACE;DEBUG</DefineConstants>
22-
<PlatformTarget>x86</PlatformTarget>
23-
</PropertyGroup>
24-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
25-
<OutputPath>..\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid\bin\Release\uap10.0.17763\Design\</OutputPath>
26-
<DebugType>pdbonly</DebugType>
27-
<PlatformTarget>x86</PlatformTarget>
28-
<Optimize>true</Optimize>
29-
<DefineConstants>TRACE</DefineConstants>
4+
<TargetFramework>net472</TargetFramework>
5+
<RootNamespace>Microsoft.Toolkit.Uwp.UI.Controls</RootNamespace>
306
</PropertyGroup>
7+
318
<PropertyGroup>
32-
<AssetTargetFallback>$(AssetTargetFallback);uap10.0.17763</AssetTargetFallback>
9+
<AssemblyTitle>Windows Community Toolkit - DataGrid Control (Design)</AssemblyTitle>
10+
<Description>Design time support for Windows Community Toolkit DataGrid Control</Description>
3311
</PropertyGroup>
12+
3413
<ItemGroup>
35-
<Reference Include="System.Runtime" />
36-
<Reference Include="System.ObjectModel" />
37-
<Reference Include="System.Runtime.WindowsRuntime" />
38-
<Reference Include="System.Runtime.InteropServices.WindowsRuntime" />
39-
<Reference Include="Microsoft.VisualStudio.DesignTools.Extensibility">
40-
<SpecificVersion>False</SpecificVersion>
41-
<Private>False</Private>
42-
</Reference>
43-
<Reference Include="Microsoft.VisualStudio.DesignTools.Interaction">
44-
<SpecificVersion>False</SpecificVersion>
45-
<Private>False</Private>
46-
</Reference>
47-
<Reference Include="System" />
48-
<Reference Include="System.Core" />
49-
<Reference Include="System.Xml.Linq" />
50-
<Reference Include="System.Data.DataSetExtensions" />
51-
<Reference Include="Microsoft.CSharp" />
52-
<Reference Include="System.Data" />
53-
<Reference Include="System.Xml" />
54-
<Reference Include="Windows, Version=255.255.255.255, Culture=neutral, processorArchitecture=MSIL">
55-
<Private>False</Private>
56-
<SpecificVersion>False</SpecificVersion>
57-
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\10.0.17763.0\Windows.winmd</HintPath>
58-
</Reference>
59-
<Reference Include="WindowsBase" />
60-
<Reference Include="PresentationCore" />
61-
<Reference Include="PresentationFramework" />
62-
</ItemGroup>
63-
<ItemGroup Label="WinRT References">
64-
<Reference Include="System.Xaml" />
65-
<Reference Include="System.Runtime.WindowsRuntime.UI.Xaml" />
66-
<Reference Include="Windows.Foundation.FoundationContract">
67-
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\References\10.0.17763.0\Windows.Foundation.FoundationContract\3.0.0.0\Windows.Foundation.FoundationContract.winmd</HintPath>
68-
<Aliases>WindowsRuntime</Aliases>
69-
<Private>False</Private>
70-
</Reference>
71-
<Reference Include="Windows.Foundation.UniversalApiContract">
72-
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\References\10.0.17763.0\Windows.Foundation.UniversalApiContract\7.0.0.0\Windows.Foundation.UniversalApiContract.winmd</HintPath>
73-
<Aliases>WindowsRuntime</Aliases>
74-
<Private>False</Private>
75-
</Reference>
76-
</ItemGroup>
77-
<ItemGroup>
78-
<Compile Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Core.Design\Common\Constants.cs" Link="Common\Constants.cs" />
79-
<Compile Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Core.Design\Common\MetadataRegistrationBase.cs" Link="Common\MetadataRegistrationBase.cs" />
80-
<Compile Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Core.Design\Common\PlatformTypes.cs" Link="Common\PlatformTypes.cs" />
81-
<Compile Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Core.Design\MetadataRegistration.cs" Link="MetadataRegistration.cs" />
82-
<Compile Include="Controls\DataGrid.Metadata.cs" />
83-
<Compile Include="Controls\DataGrid.Typedata.cs" />
84-
<Compile Include="Properties\AssemblyInfo.cs">
85-
<SubType>Code</SubType>
86-
</Compile>
87-
<Compile Include="Properties\Resources.Designer.cs">
88-
<AutoGen>True</AutoGen>
89-
<DesignTime>True</DesignTime>
90-
<DependentUpon>Resources.resx</DependentUpon>
91-
</Compile>
92-
<EmbeddedResource Include="Properties\Resources.resx">
93-
<Generator>ResXFileCodeGenerator</Generator>
94-
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
95-
</EmbeddedResource>
96-
<AppDesigner Include="Properties\" />
97-
</ItemGroup>
98-
<ItemGroup>
99-
<EmbeddedResource Include="..\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid\bin\$(Configuration)\uap10.0.17763\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.xml">
100-
<Link>Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.xml</Link>
101-
<Visible>False</Visible>
102-
</EmbeddedResource>
14+
<Compile Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Core.Design\Common\*.cs" LinkBase="Common" />
10315
</ItemGroup>
104-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
105-
<!-- No-op to avoid build error when packing solution from commandline -->
106-
<Target Name="Pack" />
16+
17+
<Import Project="$(BuildToolsDirectory)Windows.Toolkit.VisualStudio.Design.targets" />
18+
10719
</Project>

Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.Design/Properties/AssemblyInfo.cs

-32
This file was deleted.

0 commit comments

Comments
 (0)