Is it able to check XAML Designer mode in csproj?
William Liu
346
Reputation points
I have a .net 8 WPF project which is developed with lastest Visual Studio Community Version (v17.10.5).
I have learned that I can use Condition attribute in csproj file to toggle build property.
My question is, is there a Condition key word to check if current environment is in the Visual Studio XAML Designer mode, not a actual WPF running environment? I would like to introduce some design resource library which only used for helping XAML designer work, but I don't want to include this library in the actual project.
Expected:
<ItemGroup>
<ProjectReference Condition=" '$(XamlDesignerMode)' == 'true' "
Include="..\DesignerResource\DesignerResource.csproj" />
</ItemGroup>