OnPlatform could be simplified at build time #4716
Labels
area-xaml
XAML, CSS, Triggers, Behaviors
fixed-in-6.0.300-rc.1
Look for this fix in 6.0.300-rc.1!
proposal/open
t/perf
The issue affects performance (runtime speed, memory usage, startup time, etc.)
Projects
Description
For XamlC scenarios (Release builds), as we now multi-targeting, {OnPlatform} markup extensions could be simplified at build time.
this Xaml code
should be evaluated as
on iOS, and
Padding="30"
on other platforms.This is possible as the platform won't change while the app is build.
To avoid writing too much specialised code around this, I'd recommend adding this rule as a visitor early in the parsing, before the IL generation, so the IL generator (XamlC) won't see any difference.
/cc @eerhardt
Public API Changes
/
Intended Use-Case
/
The text was updated successfully, but these errors were encountered: