Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review analyzers for default Xamarin.Forms controls #411

Closed
mrlacey opened this issue Sep 13, 2020 · 11 comments
Closed

Review analyzers for default Xamarin.Forms controls #411

mrlacey opened this issue Sep 13, 2020 · 11 comments
Labels
READY-FOR-RELEASE The work has been done but not yet released Xamain.Forms Relates to XAML in Xamarin.Forms projects XAML-Analysis Relates to XAML Analysis functionality
Milestone

Comments

@mrlacey
Copy link
Owner

mrlacey commented Sep 13, 2020

Depends on #163

@mrlacey mrlacey added XAML-Analysis Relates to XAML Analysis functionality Xamain.Forms Relates to XAML in Xamarin.Forms projects labels Sep 13, 2020
@mrlacey mrlacey added this to the 1.0 milestone Sep 13, 2020
@mrlacey mrlacey modified the milestones: 1.0, 0.12 Oct 1, 2020
@mrlacey
Copy link
Owner Author

mrlacey commented Mar 16, 2021

For Image, add a check on file name format

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/images?tabs=windows

To use the same image filename across all platforms the name must be valid on all platforms. Android drawables have naming restrictions – only lowercase letters, numbers, underscore, and period are allowed – and for cross-platform compatibility this must be followed on all the other platforms too. The example filename waterfront.png follows the rules, but examples of invalid filenames include "water front.png", "WaterFront.png", "water-front.png", and "wåterfront.png".

@mrlacey
Copy link
Owner Author

mrlacey commented Mar 16, 2021

For Line check on if the Fill property is set

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/shapes/line

Setting the Fill property of a Line has no effect, because a line has no interior.

@mrlacey
Copy link
Owner Author

mrlacey commented Mar 16, 2021

@mrlacey
Copy link
Owner Author

mrlacey commented Mar 16, 2021

If a WebView is inside a StackLayout, ensure WidthRequest and HeightRequest are set

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/webview?tabs=windows

It may be necessary to set the WidthRequest and HeightRequest properties of the WebView to see the HTML content, depending upon the layout the WebView is a child of. For example, this is required in a StackLayout.

@mrlacey
Copy link
Owner Author

mrlacey commented Mar 16, 2021

For Slider check that Minimum is less than Maximum

@mrlacey
Copy link
Owner Author

mrlacey commented Mar 16, 2021

For Slider, check if ThumbColor and ThumbImageSource are set.

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/slider

The ThumbColor and ThumbImageSource properties are mutually exclusive. If both properties are set, the ThumbImageSource property will take precedence.

@mrlacey
Copy link
Owner Author

mrlacey commented Mar 16, 2021

For Stepper check that Minimum is less than Maximum

@mrlacey
Copy link
Owner Author

mrlacey commented Mar 16, 2021

For DatePicker try and ensure MinimumDate is less than or equal to MaximumDate

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/datepicker

Need to consider date formatting if do this.

Can't do this (yet) as don't know project-level settings for locale :(

@mrlacey
Copy link
Owner Author

mrlacey commented Mar 16, 2021

For ProgressBar

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/progressbar

Do not use unconstrained horizontal layout options such as Center, Start, or End with ProgressBar. On UWP, the ProgressBar collapses to a bar of zero width. Keep the default HorizontalOptions value of Fill and don't use a width of Auto when putting a ProgressBar in a Grid layout.

@mrlacey
Copy link
Owner Author

mrlacey commented Mar 16, 2021

Don't put a ViewCell in a Carousel

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/carouselview/populate-data

When using CarouselView, never set the root element of your DataTemplate objects to a ViewCell. This will result in an exception being thrown because CarouselView has no concept of cells.

mrlacey added a commit that referenced this issue Apr 1, 2021
mrlacey added a commit that referenced this issue Apr 1, 2021
mrlacey added a commit that referenced this issue May 8, 2021
@mrlacey mrlacey added the READY-FOR-RELEASE The work has been done but not yet released label May 14, 2021
@mrlacey
Copy link
Owner Author

mrlacey commented May 17, 2021

This functionality has been released as part of v 0.12.0 and is available now.

@mrlacey mrlacey closed this as completed May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
READY-FOR-RELEASE The work has been done but not yet released Xamain.Forms Relates to XAML in Xamarin.Forms projects XAML-Analysis Relates to XAML Analysis functionality
Projects
None yet
Development

No branches or pull requests

1 participant