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

Resolved identified XAML binding errors #1375

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

ergoxiv
Copy link
Contributor

@ergoxiv ergoxiv commented Aug 15, 2024

Note: This pull request will be marked as a draft until this XivToolsWpf PR is handled: Aether-Tools/AetherToolsWpf#1.

This pull request handles a handful of XAML binding errors that are currently present in Anamnesis:

System.Windows.Data Error: 40 : BindingExpression path error: 'IsNotChangingState' property not found on 'object' ''GposeService' (HashCode=10987981)'. BindingExpression:Path=GposeService.IsNotChangingState; DataItem='MainWindow' (Name=''); target element is 'Grid' (Name=''); target property is 'IsEnabled' (type 'Boolean')

  • Cause: IsNotChangingState is no longer part of the GposeService. It was removed in a previous commit.
  • Behavioural/visual changes: Previously, the main window was enabled at all times because "Enabled" property's default value is true. Now, the main window will be enabled only if the GPose service is initialized.

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Window', AncestorLevel='1''. BindingExpression:Path=SettingsService.Settings.UseExternalRefreshBrio; DataItem=null; target element is 'MenuItem' (Name=''); target property is 'Visibility' (type 'Visibility')

  • Cause: UseExternalRefreshBrio was inaccessible due to incorrect binding.
  • Behavioural/visual changes: Previously, the "Despawn" option in the pinned actor's context menu was visible regardless if Brio integration was enabled or not. Now, the menu item will only be visible if Brio integration is enabled.

System.Windows.Data Error: 23 : Cannot convert '' from type '' to type 'System.Windows.Media.ImageSource' for 'en-US' culture with default conversions; consider using Converter property of Binding. NotSupportedException:'System.NotSupportedException: ImageSourceConverter cannot convert from (null).
at System.ComponentModel.TypeConverter.GetConvertFromException(Object value)
at System.Windows.Media.ImageSourceConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
at MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, Boolean isForward)'

  • Cause: Caused by the Gallery
  • Behavioural/visual changes: None. The Gallery will no longer freak out whenever the image paths stay null (which is the case for Curated and None gallery modes.

System.Windows.Data Error: 1 : Cannot create default converter to perform 'two-way' conversions between types 'Anamnesis.Memory.ExtendedWeaponMemory' and 'Anamnesis.Memory.WeaponSubModelMemory'. Consider using Converter property of Binding.

  • Cause: EquipmentEditor.
  • Behavioural/visual changes: Not sure on this one.

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'ListBoxItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'ListBoxItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')

  • Cause: EquipmentSelector and FacialFeaturesControl were missing the HorizontalContentAlignment and VerticalContentAlignment properties, which are expected by the MaterialDesignListBoxItem style.
  • Behavioural/visual changes: No visual changes for FacialFeaturesControl. EquipmentSelector's items will now take up the entire horizontal space. Otherwise, some of the items end up smaller than others, leading to alignment issues (see image below).

image

System.Windows.Data Error: 40 : BindingExpression path error: 'IsValidWeapon' property not found on 'object' ''PosePage' (Name='')'. BindingExpression:Path=IsValidWeapon; DataItem='PosePage' (Name=''); target element is 'CheckBox' (Name=''); target property is 'Visibility' (type 'Visibility')

System.Windows.Data Error: 40 : BindingExpression path error: 'IsValidWeapon' property not found on 'object' ''ActionPage' (Name='')'. BindingExpression:Path=IsValidWeapon; DataItem='ActionPage' (Name=''); target element is 'ToggleButton' (Name=''); target property is 'Visibility' (type 'Visibility')

System.Windows.Data Error: 40 : BindingExpression path error: 'IsValidWeapon' property not found on 'object' ''ActionPage' (Name='')'. BindingExpression:Path=IsValidWeapon; DataItem='ActionPage' (Name=''); target element is 'ToggleButton' (Name=''); target property is 'Visibility' (type 'Visibility')

  • Cause: IsValidWeapon is not part of the data context and seemingly hasn't been for a long time. Perhaps it was part of ActorMemory at some point but now the only IsValidWeapon definition is in the ItemView view model.
  • Behavioural/visual changes: None

System.Windows.Data Error: 40 : BindingExpression path error: 'File' property not found on 'object' ''SkeletonVisual3d' (HashCode=66961361)'. BindingExpression:Path=Skeleton.File.AllowPoseGui; DataItem='PosePage' (Name=''); target element is 'ListBoxItem' (Name=''); target property is 'Visibility' (type 'Visibility')

System.Windows.Data Error: 40 : BindingExpression path error: 'File' property not found on 'object' ''SkeletonVisual3d' (HashCode=66961361)'. BindingExpression:Path=Skeleton.File.AllowPoseMatrix; DataItem='PosePage' (Name=''); target element is 'ListBoxItem' (Name=''); target property is 'Visibility' (type 'Visibility')


System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property. Double:'NaN' BindingExpression:Path=ItemWidth; DataItem='WrapPanel' (Name=''); target element is 'WrapPanel' (Name=''); target property is 'MinWidth' (type 'Double')

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ListView', AncestorLevel='1''. BindingExpression:Path=(ListView.View).ItemWidth; DataItem=null; target element is 'WrapPanel' (Name=''); target property is 'ItemWidth' (type 'Double')

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ListView', AncestorLevel='1''. BindingExpression:Path=(ListView.View).ItemHeight; DataItem=null; target element is 'WrapPanel' (Name=''); target property is 'ItemHeight' (type 'Double')

  • Cause: Outdated WrapPanel bindings in MatrixPoseView.
  • Behavioural/visual changes: None

System.Windows.Data Error: 40 : BindingExpression path error: 'BlendLocked' property not found on 'object' ''AnimationService' (HashCode=54572879)'. BindingExpression:Path=AnimationService.BlendLocked; DataItem='ActionPage' (Name=''); target element is 'Button' (Name=''); target property is 'IsEnabled' (type 'Boolean')

  • Cause: Outdated binding to BlendLocked.
  • Behavioural/visual changes: The button should now be disabled whenever BlendLocked is true.

There are 2 XAML binding errors that I did not attempt to fix as their scope is beyond this pull request:

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.DataGridCell', AncestorLevel='1''. BindingExpression:(no path); DataItem=null; target element is 'Popup' (Name='PART_Popup'); target property is 'PlacementTarget' (type 'UIElement')

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.DataGridCell', AncestorLevel='1''. BindingExpression:Path=ActualWidth; DataItem=null; target element is 'Border' (Name='dropDownBorder'); target property is 'MinWidth' (type 'Double')

  • Cause: The ComboBox (the one for item sorting options) in EquipmentSelector uses the MaterialDesignDataGridComboBox style, which expects the component to be inside a DataGridCell. However, this is not the case.
  • Possible solution: Creating a custom ComboBox style.

@StoiaCode StoiaCode added Bug Something isn't working UI labels Aug 16, 2024
@StoiaCode
Copy link
Contributor

StoiaCode commented Aug 24, 2024

Same question I have here, curious what made you trip over these haha.

Changes themselve look good to me.

@ergoxiv
Copy link
Contributor Author

ergoxiv commented Aug 24, 2024

Most of these (except for the equipment selector) are observable by simply opening their corresponding view/tab:

Opening the application (i.e. the MainWindow):

  • BindingExpression path error: 'IsNotChangingState' property....
  • BindingExpression:Path=SettingsService.Settings.UseExternalRefreshBrio...
  • Cannot convert '' from type '' to type 'System.Windows.Media.ImageSource (caused by the Gallery, which is part of MainWindow)

Opening the equipment editor (part of the Actor tab):

  • Cannot create default converter to perform 'two-way' conversions between types 'Anamnesis.Memory.ExtendedWeaponMemory' and ... (caused by the weapon item view)
  • The facial features user control throws a horizontal and vertical alignment XAML binding error.

Opening the pose page:

  • BindingExpression path error: 'IsValidWeapon' property not found...
  • BindingExpression path error: 'File' property not found on 'object' ''SkeletonVisual3d'...

Opening the matrix pose view:

  • The wrap panel related binding errors.

Opening the action/animation page:

  • BindingExpression path error: 'BlendLocked' property not found...

As to how to reproduce the equipment selector issue, I shared in the other pull request.

@StoiaCode StoiaCode marked this pull request as ready for review September 3, 2024 13:24
@StoiaCode
Copy link
Contributor

Would you be so kind to resolve the conflict now :D
Id be ready for a merge.

@ergoxiv
Copy link
Contributor Author

ergoxiv commented Sep 3, 2024

Done ^^

@StoiaCode StoiaCode merged commit ceb77d0 into imchillin:master Sep 3, 2024
@ergoxiv ergoxiv deleted the hotfix/xaml-binding-errors branch September 4, 2024 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants