You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To summarize, I have a CollectionView that is bound to a list of Anomaly objects (line 206, ItemsSource="{Binding Anomalies}") and whose display depends on the content of an attribute of my Anomaly object.
The attribute in question is a list of Defaults (line 94 ItemsSource="{Binding Defaults}".
If the list is empty, I display a checkbox, otherwise I display a Picker to select a Default.
To manage this, I have a resource with a personal DataTemplateSelector, AlertTemplateSelector.
Now we come to the problem in question!
I've set up the following behavior: when the user checks a box or selects a Default, the Anomaly Label is italicized and bolded.
I therefore have Label.Triggers on lines 29-42 (for the CheckBox) and 78-86 (for the Picker).
No errors at compile time.
But when loading the view, I get a "System.Reflection.TargetInvocationException: 'Exception has been thrown by the target of an invocation.'"
After a few empirical tests, the problem comes solely from the Picker and more precisely from the Label.Triggers.
If I remove the Label.Triggers from the Picker, the View loads.
I've also tried modifying the Converter using a custom one instead of the Toolkit one, but it doesn't even fit.
I also tried binder on another Path. Instead of SelectedItem, I binded on Text.Length and Value at 0 without Converter.
For debugging and hot reloading, I changed the Picker's Title value in the XAML to "" (empty) and the View loads and the trigger works: the Label's text changes to bold italics when I empty the Title value.
The problem comes from the binding on the SelectedItem.
Does anyone have any idea what's going on?
Did I miss a note in the release about the bindings requirement?
The following code of the View worked with previous versions of Maui and the above-mentioned Nugets packages:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Actually :
Worked before with :
To summarize, I have a CollectionView that is bound to a list of Anomaly objects (line 206, ItemsSource="{Binding Anomalies}") and whose display depends on the content of an attribute of my Anomaly object.
The attribute in question is a list of Defaults (line 94 ItemsSource="{Binding Defaults}".
If the list is empty, I display a checkbox, otherwise I display a Picker to select a Default.
To manage this, I have a resource with a personal DataTemplateSelector, AlertTemplateSelector.
Now we come to the problem in question!
I've set up the following behavior: when the user checks a box or selects a Default, the Anomaly Label is italicized and bolded.
I therefore have Label.Triggers on lines 29-42 (for the CheckBox) and 78-86 (for the Picker).
No errors at compile time.
But when loading the view, I get a "System.Reflection.TargetInvocationException: 'Exception has been thrown by the target of an invocation.'"
After a few empirical tests, the problem comes solely from the Picker and more precisely from the Label.Triggers.
If I remove the Label.Triggers from the Picker, the View loads.
I've also tried modifying the Converter using a custom one instead of the Toolkit one, but it doesn't even fit.
I also tried binder on another Path. Instead of SelectedItem, I binded on Text.Length and Value at 0 without Converter.
For debugging and hot reloading, I changed the Picker's Title value in the XAML to "" (empty) and the View loads and the trigger works: the Label's text changes to bold italics when I empty the Title value.
The problem comes from the binding on the SelectedItem.
Does anyone have any idea what's going on?
Did I miss a note in the release about the bindings requirement?
The following code of the View worked with previous versions of Maui and the above-mentioned Nugets packages:
Beta Was this translation helpful? Give feedback.
All reactions