XAML conditional prefixes mobile and desktop #7922
Answered
by
jeromelaban
workgroupengineering
asked this question in
Q&A
-
What would you like to be added:Add new XAML conditional prefixes to identify mobile and desktop platform Why is this needed:Some desktop controls are not usable from mobile (DataGrid) and vice versa. To solve this case it generally uses StateTrigger. With these prefixes it is not necessary to use StateTrigger and will also reduce the memory allocation. For which Platform:
Anything else we need to know? |
Beta Was this translation helpful? Give feedback.
Answered by
jeromelaban
Jan 26, 2022
Replies: 1 comment
-
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> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
workgroupengineering
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: