-
Notifications
You must be signed in to change notification settings - Fork 69
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
Paterns on special dates and special date Selection #81
Comments
Hello. By looking the code a bit it looks like (i think) the BackgroundPattern is being overridden by the default background color when a user selects a date.
|
Hello. I have the same problem. Any solution? |
I fixed it moving the assignment of BackgroundPattern at the end. protected void SetButtonSelected(CalendarButton button, SpecialDate special) {
Device.BeginInvokeOnMainThread(() => {
button.BackgroundImage = special != null ? special.BackgroundImage : null;
var defaultBackgroundColor = button.IsOutOfMonth ? DatesBackgroundColorOutsideMonth : DatesBackgroundColor;
var defaultTextColor = button.IsOutOfMonth ? DatesTextColorOutsideMonth : DatesTextColor;
var defaultFontAttributes = button.IsOutOfMonth ? DatesFontAttributesOutsideMonth : DatesFontAttributes;
var defaultFontFamily = button.IsOutOfMonth ? DatesFontFamilyOutsideMonth : DatesFontFamily;
button.IsEnabled = true;
button.IsSelected = true;
button.FontSize = SelectedFontSize;
button.BorderWidth = SelectedBorderWidth;
button.BorderColor = SelectedBorderColor;
button.BackgroundColor = SelectedBackgroundColor != Color.Default ? SelectedBackgroundColor : (special != null && special.BackgroundColor.HasValue ? special.BackgroundColor.Value : defaultBackgroundColor);
button.TextColor = SelectedTextColor != Color.Default ? SelectedTextColor : (special != null && special.TextColor.HasValue ? special.TextColor.Value : defaultTextColor);
button.FontAttributes = SelectedFontAttributes != FontAttributes.None ? SelectedFontAttributes : (special != null && special.FontAttributes.HasValue ? special.FontAttributes.Value : defaultFontAttributes);
button.FontFamily = !string.IsNullOrEmpty(SelectedFontFamily) ? SelectedFontFamily : (special != null && !string.IsNullOrEmpty(special.FontFamily) ? special.FontFamily : defaultFontFamily);
button.BackgroundPattern = special != null ? special.BackgroundPattern : null;
});
} |
@KerosenoDev can you make a pull request to this repository so we can get it fixed? |
Hello, great control.
I have an scenario on which there is only one month, but I need patterns on my special dates.
When selecting a special date that has a list of patterns as BackgroundPattern, some times said selected special date turns its background to white, loosing the pattern.
I wasn't capable of pin pointing the exact ocurrance, It's a bit random.
How can I fix it?
The text was updated successfully, but these errors were encountered: