-
-
Notifications
You must be signed in to change notification settings - Fork 276
/
Copy pathDirectory.Build.shared.xamltools.props
73 lines (59 loc) · 2.81 KB
/
Directory.Build.shared.xamltools.props
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="XAMLTools.MSBuild" Version="1.0.0-alpha0085" PrivateAssets="all" />
</ItemGroup>
<!-- Note: to disable XAML tools during debug and development, use the following csproj:
<PropertyGroup>
<XamlToolsDisableInDebugMode>true</XamlToolsDisableInDebugMode>
</PropertyGroup>
In order to make Resharper work properly add Extra condtions to your ItemGroup with XAMLCombineItems,
as in exmaple below:
<ItemGroup Condition="'$(Configuration)' != 'Debug' Or '$(XamlToolsDisableInDebugMode)' != 'true'">
<XAMLCombineItems Include="Themes\Styles.xaml">
<TargetFile>Themes\Generic.generated.xaml</TargetFile>
<Visible>True</Visible>
</XAMLCombineItems>
...
</ItemGroup>
-->
<ItemGroup>
<Page Remove="Themes\Generic.XamlTools.Disabled.xaml" />
<None Include="Themes\Generic.XamlTools.Disabled.xaml" />
<Page Remove="Themes\Generic.XamlTools.Enabled.xaml" />
<None Include="Themes\Generic.XamlTools.Enabled.xaml" />
</ItemGroup>
<PropertyGroup>
<XamlToolsDisable>false</XamlToolsDisable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug' And '$(XamlToolsDisableInDebugMode)' == 'true'">
<XamlToolsDisable>true</XamlToolsDisable>
</PropertyGroup>
<!-- Generic shared properties -->
<PropertyGroup>
<XAMLColorSchemeGeneratorEnabled>False</XAMLColorSchemeGeneratorEnabled>
<XAMLCombineImportMergedResourceDictionaryReferences>False</XAMLCombineImportMergedResourceDictionaryReferences>
<RemoveXAMLCombineItemsFromPages>False</RemoveXAMLCombineItemsFromPages>
</PropertyGroup>
<PropertyGroup>
<!-- Enable by default -->
<XAMLCombineEnabled>True</XAMLCombineEnabled>
</PropertyGroup>
<!--Allow disabling XAML tools during debug mode-->
<PropertyGroup Condition="'$(XamlToolsDisable)' == 'true'">
<XAMLCombineEnabled>False</XAMLCombineEnabled>
</PropertyGroup>
<ItemGroup Condition="'$(XamlToolsDisable)' == 'true'">
<Page Remove="Themes\Generic.generated.xaml" />
<None Include="Themes\Generic.generated.xaml" />
</ItemGroup>
<!--Copy correct file based on whether it's enabled or not-->
<Target Name="PreBuildXamlToolsDisabled" AfterTargets="PreBuildEvent"
Condition="'$(XamlToolsDisable)' == 'true'">
<Exec Command="xcopy /f /y "$(ProjectDir)Themes\Generic.XamlTools.Disabled.xaml" "$(ProjectDir)Themes\Generic.xaml"" />
</Target>
<Target Name="PreBuildXamlToolsEnabled" AfterTargets="PreBuildEvent"
Condition="'$(XamlToolsDisable)' != 'true'">
<Exec Command="xcopy /f /y "$(ProjectDir)Themes\Generic.XamlTools.Enabled.xaml" "$(ProjectDir)Themes\Generic.xaml"" />
</Target>
</Project>