How bad are binding errors?
Posted: 30 Apr 2021, 16:45
Very simple question regarding the performance impact of binding errors. How bad are they really?
In my normal WPF development we're trying to avoid Binding errors but some we just ignore since they are just artifacts of something not yet being initialized or whatnot and not really worth avoiding.
this is an example
Since when the view is launched and when it's shut down TreeView.SelectedItem will be null, the ItemsSource Binding of the ListBox reports a failed Binding, since the nested Property Files cannot be reached. A circumvention via the ViewModel is also not possible since TreeView.SelectedItem is readonly and cannot receive a binding.
Now this works just fine.. but with verbose logging Noesis reports a Binding error here. One which from the top of my head I don't really know how to avoid since ListBox needs its regular DataContext for the SelectedItem Binding.
So does this sort of thing impact performance much in Noesis or is this safe to just ignore?
(Also if anybody knows hot to do this binding better I'm all ears. I've basically run into this in my WPF time so many times and nobody has any clue how else to do this pretty much.)
In my normal WPF development we're trying to avoid Binding errors but some we just ignore since they are just artifacts of something not yet being initialized or whatnot and not really worth avoiding.
this is an example
Code: Select all
<!-- ... -->
<TreeView
Background="Transparent"
ItemsSource="{Binding Root, Mode=OneWay}">
</TreeView>
<ListBox
Grid.Column="2"
ItemsSource="{Binding SelectedItem.Files, ElementName=TreeView, Mode=OneWay}"
SelectedItem="{Binding SelectedFile, Mode=TwoWay}" />
<!-- ... -->
Now this works just fine.. but with verbose logging Noesis reports a Binding error here. One which from the top of my head I don't really know how to avoid since ListBox needs its regular DataContext for the SelectedItem Binding.
So does this sort of thing impact performance much in Noesis or is this safe to just ignore?
(Also if anybody knows hot to do this binding better I'm all ears. I've basically run into this in my WPF time so many times and nobody has any clue how else to do this pretty much.)