'BorderBrush' property not found on 'Telerik.Maui.Controls.PickerDateSelector'

1 Answer 252 Views
DatePicker TimePicker
Richard
Top achievements
Rank 1
Richard asked on 11 May 2023, 10:01 AM

Hi

I'm getting the following Binding errors when using the Date or Time picker.

'BorderBrush' property not found on 'Telerik.Maui.Controls.PickerDateSelector', target property: Telerik.Maui.Controls.RadBorder.BorderBrush'			

 

 This happens regardless of the settings or style applied (at least to my knowledge) and Android and iOS.  See below for example

<telerik:RadDatePicker HeightRequest="50" IsClearButtonVisible="True" Date="10,10,10" />

<telerik:RadTimePicker HeightRequest="50" IsClearButtonVisible="True" Time="10" />



1 Answer, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 12 May 2023, 07:35 AM

Hello Richard,

I have tested the scenario and on my side the controls work as expected. I have attached my sample project. 

Next Steps:

1. Modify the project with the exact implementation you have with all styles applied. Then send it back to me for further research.

2. What are the .NET Maui, .NET version and Telerik versions you use?

(I use .NET Maui version 7.0.59, .NET 7. Telerik 5.1.0)

3. Visual Studio version?

(I use VS for Windows 17.5.3)

Looking forward to your reply. 

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Richard
Top achievements
Rank 1
commented on 12 May 2023, 07:51 AM

Hi Didi

Thanks for checking. Apologies if I weren't clear. 

The controls work as expected, however, those errors and being registered in the background logs and detected as binding failures in Visual Studio during debugging.

The don't stop the controls from working, however they do raise errors in the background. I was hoping that I might be doing something wrong or that it is something that can be pushed to the dev team to fix as it adds a lot of noise to our logs.

Didi
Telerik team
commented on 12 May 2023, 08:35 AM

Hi Richards,

These errors are fake binding errors. Same errors occur on windows. I have logged this internally, so the team can review whether the errors can be skipped. Still this does not prevent you from using the controls. They work as expected.

Richard
Top achievements
Rank 1
commented on 12 May 2023, 09:18 AM

Appreciate it, thank you.
Michał
Top achievements
Rank 1
commented on 18 May 2023, 11:53 AM

Hi,

I understand "These errors are false binding errors" but this is very confusing and makes it hard to judge if the application is working correctly (too much logs like this and others). Does telerik throws this logs by itself or these are internal MAUI logs? If these logs are telerik internal one may be it's possible to not include them in release version or make them on lower level then "Warning" to filter them out.

I our case we have also many logs like this:

WARN|1|BindingDiagnostics|'Content' property not found on 'Telerik.Maui.Controls.BusyContentPresenter', target property: 'Microsoft.Maui.Controls.ContentPresenter.Content'

WARN|1|Element|Microsoft.Maui.Controls.SolidColorBrush is already a child of Telerik.Maui.Controls.RadBorder. Remove Microsoft.Maui.Controls.SolidColorBrush from Telerik.Maui.Controls.RadBorder before adding to Telerik.Maui.Controls.RadListPicker.

Lance | Senior Manager Technical Support
Telerik team
commented on 18 May 2023, 02:02 PM

Hi Michał, they're from Visual Studio's XAML Binding Diagnostic tool. That tool was originally developed for UWP, WPF and WinUI XAML and it's backing DependencyProperties. Microsoft just recently introduced support for Xamarin.Forms and MAUI flavored XAML's BindableProperties and class attributes, but it's not foolproof there yet.

To answer your question, yes you can filter the logs if you want. Here's a discussion on the topic => c# - log4net: Configure to ignore messages from a specific class - Stack Overflow.

Once you have that set up, in your logger filter out messages from Microsoft.Maui.Controls.Xaml.Diagnostics.BindingDiagnostics.

Michał
Top achievements
Rank 1
commented on 18 May 2023, 02:57 PM

Hi,

Now all is clear.

We will add filtering to our MAUI app in RELEASE to hide this class of Warnings using builder.Logging.AddFilter(...)

I hope it will not hide real important warnings from BindingDiagnostics. We will see.

Thx

Lance | Senior Manager Technical Support
Telerik team
commented on 18 May 2023, 03:45 PM

Hello Michał, that's a good plan, you can keep everything during your debug builds (where you spent 95% of your time anyways), and still have clearer release build output to see any meaningful errors.

As a side note, let me explain one of the warnings, to put your mind at easy why they occur in the first place.

When you define a ContentPresenter, you're supposed to use the ContentProperty attribute and point it at the property of the presenter that is to be used for the content View.

For example:

[ContentProperty(nameof(ContentOne))] // XAML Binding Diagnostics looks at this
public class MyContentPresenter : ContentPresenter
{
	public View ContentOne { get; set; }
}

but.. what if your custom presenter actually has two properties for content?

[ContentProperty(nameof(ContentOne))] 
public class MyContentPresenter : ContentPresenter
{
	public View ContentOne { get; set; } // do you use this one?

	public View ContentTwo { get; set; } // or do you use this one?.. both are equally important.
}

In the case of the RadBusyIndicator.. we actually do have two content properties.. one for the animation (AnimationContent) and one for the customizable text area (BusyContent).

public class BusyContentPresenter : TemplatedView
{
	public View BusyContent { get; set; } 

	public View AnimationContent { get; set; } 
}

We have chosen not to prioritize one over the other, and therefore do not set a single ContentProperty attributes, and thus why you get the warning:

WARN|1|BindingDiagnostics|'Content' property not found on 'Telerik.Maui.Controls.BusyContentPresenter', target property: 'Microsoft.Maui.Controls.ContentPresenter.Content'

Didi has raised this to the dev team again, and we could try setting one of the properties to be the designated content, but that's risky to anyone who has previously overridden the ControlTemplate. Current, we feel it is better to have an ignorable warning than to potentially break someone, but that may change depending on the priority of issue.

I hope this helps!

Michał
Top achievements
Rank 1
commented on 18 May 2023, 09:26 PM

Hi,

It's very interesting. I've tried to investigate this but I'm not competent enough to discuss at this level of details yet :-)

Indeed ContentPropertyAttribute has AllowMultiple=false so only one Content property can be pointed.

Maybe BusyContentPresenter should has [ContentProperty(nameof(BusyContent))] to "satisfy" BindingDiagnostics.

But if there is any risk, as You said, maybe there is other trick to make it optionally ("extension" that extends optionaly class with this attribute). I could try TypeDescriptor.AddAttributes but BusyContentPresenter is internal class.

TypeDescriptor.AddAttributes(typeof(Telerik.Maui.Controls.BusyContentPresenter), new ContentPropertyAttribute("BusyContent"));

Thx

Tags
DatePicker TimePicker
Asked by
Richard
Top achievements
Rank 1
Answers by
Didi
Telerik team
Share this question
or