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

TreeView File Explorer triggers XAML Binding Failures for root items #161

Open
7erra opened this issue Jun 8, 2021 · 0 comments
Open

TreeView File Explorer triggers XAML Binding Failures for root items #161

7erra opened this issue Jun 8, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@7erra
Copy link

7erra commented Jun 8, 2021

Describe the bug
Using Adonis UI leads to the following XAML Binding Error when using a custom TreeView to display files (project attached):

Severity Count Data Context Binding Path Target Target Type Description
Error 13 null IsExpanded TreeViewItem.NoTarget Object Cannot find source: RelativeSource FindAncestor, AncestorType='System.Windows.Controls.TreeViewItem', AncestorLevel='1'.

This error does not appear when removing Adonis from the project. It also does not break the application, it just logs this error.

To Reproduce
Steps to reproduce the behavior:

  1. Download the attached VS2019 project
  2. Open the solution file with Visual Studio 2019 Community Edition
  3. Change the target folder ("P:\BIKIUtils") to a valid directory in MainWindow.xaml.cs
  4. Debug the program
  5. The error appears when the DataContext is set in MainWindow.xaml.cs

Expected behavior
No error warning should appear, just like when running the program without Adonis.

Screenshots
image

Additional context
Minimal project: Testing.zip

The code is from this SO answer: https://stackoverflow.com/a/6560891/11370741

Note about myself: I am very new to C# and WPF, just fyi.
PS.: I love the functionality of Adonis, great looks and easy implementation 👍

@7erra 7erra added the bug Something isn't working label Jun 8, 2021
jessegood added a commit to jessegood/adonis-ui that referenced this issue Nov 7, 2021
This is a fix for [Issue benruehl#161](benruehl#161 (comment)).
The current condition causes a binding failure when the tree view is populated at runtime, so the fix is to wait for the element to be loaded first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant