Skip to content

XAML conditional prefixes mobile and desktop #7922

Discussion options

You must be logged in to vote

Thanks for the suggestion!

In general, what's considered mobile and desktop is fuzzy and depends on the application. You can create your own namespace exclusions using this pattern:

	<Choose>
		<When Condition="'$(TargetFramework)'=='xamarinios10' or '$(TargetFramework)'=='monoandroid10.0' or '$(TargetFramework)'=='monoandroid11.0'">
			<ItemGroup>
				<IncludeXamlNamespaces Include="mobile" />
				<ExcludeXamlNamespaces Include="not_mobile" />
			</ItemGroup>
		</When>
		<Otherwise>
			<ItemGroup>
				<IncludeXamlNamespaces Include="not_mobile" />
				<ExcludeXamlNamespaces Include="mobile" />
			</ItemGroup>
		</Otherwise>
	</Choose>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by workgroupengineering
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
kind/enhancement New feature or request triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined.
2 participants
Converted from issue

This discussion was converted from issue #7918 on January 26, 2022 18:36.