Skip to content

Commit

Permalink
Make it simpler to enable IntelliSense for XAML resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinnara committed Apr 8, 2020
1 parent d86b8df commit 0438fd8
Show file tree
Hide file tree
Showing 15 changed files with 76 additions and 55 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>0.8.2-preview.1</Version>
<Version>0.8.2-dev.200408007</Version>
<Authors>Yimeng Wu</Authors>
<Product>ModernWPF UI Library</Product>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
8 changes: 0 additions & 8 deletions ModernWpf.SampleApp/DesignTime/IntellisenseResources.cs

This file was deleted.

20 changes: 12 additions & 8 deletions ModernWpf.SampleApp/ModernWpf.SampleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>

<ItemGroup>
<Page Update="Properties\DesignTimeResources.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<ContainsDesignTimeResources>True</ContainsDesignTimeResources>
</Page>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
Expand Down Expand Up @@ -61,6 +53,10 @@
<Resource Include="Assets\**" />
</ItemGroup>

<ItemGroup>
<Page Remove="Properties\DesignTimeResources.xaml" />
</ItemGroup>

<ItemGroup>
<Resource Remove="Assets\SampleMedia\cliff.jpg" />
<Resource Remove="Assets\SampleMedia\rainier.jpg" />
Expand All @@ -75,4 +71,12 @@
</Content>
</ItemGroup>

<ItemGroup>
<None Include="Properties\DesignTimeResources.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<ContainsDesignTimeResources>True</ContainsDesignTimeResources>
</None>
</ItemGroup>

</Project>
6 changes: 2 additions & 4 deletions ModernWpf.SampleApp/Properties/DesignTimeResources.xaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:designTime="clr-namespace:ModernWpf.SampleApp.DesignTime">

xmlns:ui="http://schemas.modernwpf.com/2019">
<ResourceDictionary.MergedDictionaries>
<designTime:IntellisenseResources Source="/ModernWpf;component/DesignTime/DesignTimeResources.xaml" />
<ui:IntellisenseResources Source="/ModernWpf;component/DesignTime/DesignTimeResources.xaml" />
</ResourceDictionary.MergedDictionaries>

</ResourceDictionary>
6 changes: 3 additions & 3 deletions ModernWpf/DesignTime/DesignTimeResources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/ModernWpf;component/DesignTime/SystemColors.xaml" />
<ResourceDictionary Source="/ModernWpf;component/ThemeResources/Light.xaml" />
<ResourceDictionary Source="/ModernWpf;component/ControlsResources.xaml" />
<ResourceDictionary Source="SystemColors.xaml" />
<ResourceDictionary Source="/ThemeResources/Light.xaml" />
<ResourceDictionary Source="/ControlsResources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
9 changes: 9 additions & 0 deletions ModernWpf/DesignTime/IntellisenseResources.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace ModernWpf.DesignTime
{
public class IntellisenseResources : IntellisenseResourcesBase
{
public IntellisenseResources()
{
}
}
}
8 changes: 0 additions & 8 deletions samples/FluentWPFSample/DesignTime/IntellisenseResources.cs

This file was deleted.

18 changes: 11 additions & 7 deletions samples/FluentWPFSample/FluentWPFSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>

<ItemGroup>
<Page Remove="Properties\DesignTimeResources.xaml" />
</ItemGroup>

<ItemGroup>
<None Include="Properties\DesignTimeResources.xaml">
<ContainsDesignTimeResources>True</ContainsDesignTimeResources>
<SubType>Designer</SubType>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentWPF" Version="0.8.0" />
<PackageReference Include="MahApps.Metro" Version="2.0.0-alpha0748" />
Expand All @@ -19,11 +30,4 @@
<ProjectReference Include="..\SamplesCommon\SamplesCommon.csproj" />
</ItemGroup>

<ItemGroup>
<Page Update="Properties\DesignTimeResources.xaml">
<ContainsDesignTimeResources>True</ContainsDesignTimeResources>
<SubType>Designer</SubType>
</Page>
</ItemGroup>

</Project>
6 changes: 2 additions & 4 deletions samples/FluentWPFSample/Properties/DesignTimeResources.xaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:designTime="clr-namespace:FluentWPFSample.DesignTime">

xmlns:ui="http://schemas.modernwpf.com/2019">
<ResourceDictionary.MergedDictionaries>
<designTime:IntellisenseResources Source="/ModernWpf;component/DesignTime/DesignTimeResources.xaml" />
<ui:IntellisenseResources Source="/ModernWpf;component/DesignTime/DesignTimeResources.xaml" />
</ResourceDictionary.MergedDictionaries>

</ResourceDictionary>
6 changes: 6 additions & 0 deletions samples/MahAppsSample/MahAppsSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
<ItemGroup>
<Resource Remove="Assets\SampleMedia\**" />
<Content Include="Assets\SampleMedia\**" />
<Page Remove="Properties\DesignTimeResources.xaml" />
<None Include="Properties\DesignTimeResources.xaml">
<ContainsDesignTimeResources>True</ContainsDesignTimeResources>
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</None>
<Content Update="Assets\SampleMedia\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
8 changes: 8 additions & 0 deletions samples/MahAppsSample/Properties/DesignTimeResources.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.modernwpf.com/2019">
<ResourceDictionary.MergedDictionaries>
<ui:IntellisenseResources Source="/ModernWpf;component/DesignTime/DesignTimeResources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
8 changes: 8 additions & 0 deletions samples/SamplesCommon/Properties/DesignTimeResources.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.modernwpf.com/2019">
<ResourceDictionary.MergedDictionaries>
<ui:IntellisenseResources Source="/ModernWpf;component/DesignTime/DesignTimeResources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
12 changes: 12 additions & 0 deletions samples/SamplesCommon/SamplesCommon.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<UseWPF>true</UseWPF>
</PropertyGroup>

<ItemGroup>
<Page Remove="Properties\DesignTimeResources.xaml" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.7.0" />
</ItemGroup>
Expand Down Expand Up @@ -32,4 +36,12 @@
</Reference>
</ItemGroup>

<ItemGroup>
<None Include="Properties\DesignTimeResources.xaml">
<ContainsDesignTimeResources>True</ContainsDesignTimeResources>
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</None>
</ItemGroup>

</Project>
8 changes: 0 additions & 8 deletions test/ModernWpfTestApp/IntellisenseResources.cs

This file was deleted.

6 changes: 2 additions & 4 deletions test/ModernWpfTestApp/Properties/DesignTimeResources.xaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MUXControlsTestApp">

xmlns:ui="http://schemas.modernwpf.com/2019">
<ResourceDictionary.MergedDictionaries>
<local:IntellisenseResources Source="/ModernWpf;component/DesignTime/DesignTimeResources.xaml" />
<ui:IntellisenseResources Source="/ModernWpf;component/DesignTime/DesignTimeResources.xaml" />
</ResourceDictionary.MergedDictionaries>

</ResourceDictionary>

0 comments on commit 0438fd8

Please sign in to comment.