Xamarin Forms Best Practices
Xamarin Forms-
Do not use Padding where using Spacing makes sense
-
Use async and await when you can
-
Don't use transparency if you don't need it
-
Don't use a Grid when StackLayout would work
-
Don't bind things that can be set statically
-
Don't use multiple StackLayouts when the Grid could be used
-
Do not use a StackLayout to host a single child
-
Do not set values of your Xamarin Foms Control properties to default values
-
When using Grid, make sure that as few of your row/column definitions are Auto sized
-
When using a StackLayout, ensure that only one child is set to LayoutOptions.Expands
-
Don't set the VerticalOptions and HorizontalOptions properties of a layout unless required
-
Do not overuse AbsoluteLayout
-
Optimize image resources
-
Use XAML compilation
-
Use dependency injection
-
Use MVVM framework or use your own one
-
Use the right time zone
-
Use caching
-
Use animations and micro interactions
-
Handle permission requests
-
Become a Best practice hero.Help us to grow the catalogue of best practices.
Recently added best practices
- Avoid #region in your code wherever possible
- Remove unused using statements
- Do not use "this" keyword
- Use Resharper
- Use query string to filter resource collections
- Never use CRUD function names in URIs
- Do not use underscores in URIs
- Do not use file extensions in API endpoint URIs
- Use lowercase letters in URIs
- Do not use forward trailing slash in URLs
- Use the right terminology
- Use consistent patterns across all API endpoints
- Do not return plain text
- Use SSL to protect your data during transfer
- Your API should be stateless
- Do not use session in your RESTful API endpoints
- Do not trust the input parameters
- Use correct HTTP status codes
- Use HTTP headers for content negotiation
- Use sub-resources for relations
Comments
0
/
0