- Don’t create UI in code behind. Use XAML for it because XAML is more readable then code.
- Avoid using a
RelativeLayout
. It asks CPU to perform significantly more work.
- Enable the XAML Compiler. It performs compile time checking of XAML for any errors and removes some of the load.
- Use correct layout to achieve desired UI. Don’t use
StackLayout
if the same can be achieved by using Grid
. Grid
is more lightweight then StackLayout
.
- Use Layout Compression to improve the
Page
rendering performance.
- Don’t use Binding when there is no need to. Example: if
Button
title is not dynamic, then give it statically in XAML itself.
- Don’t set the
VerticalOptions
and HorizontalOptions
properties of a layout unless required.
- Always try to reduce the Visual Tree Size.
- Reduce the Application Resource Dictionary Size.