Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to eliminate Binding “Information” in WPF output window - cannot retrieve value using the binding
    text
    copied!<p>I am writing a WPF application, and performance is it is a bit slow, and so I am trying to solve it. When I run, I get roughly a gazillion of these types of messages:</p> <pre><code>System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=(0); DataItem=null; target element is 'Control' (Name=''); target property is 'Visibility' (type 'Visibility') System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=AreRowDetailsFrozen; DataItem=null; target element is 'DataGridDetailsPresenter' (Name=''); target property is 'SelectiveScrollingOrientation' (type 'SelectiveScrollingOrientation') System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=HeadersVisibility; DataItem=null; target element is 'DataGridRowHeader' (Name=''); target property is 'Visibility' (type 'Visibility') System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=ValidationErrorTemplate; DataItem=null; target element is 'Control' (Name=''); target property is 'Template' (type 'ControlTemplate') </code></pre> <p>If I make a little example application:</p> <pre><code>&lt;Window x:Class="bindingerrors.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:bindingerrors="clr-namespace:bindingerrors" Title="MainWindow"&gt; &lt;Window.Resources&gt; &lt;bindingerrors:Thinger x:Key="Thing" /&gt; &lt;/Window.Resources&gt; &lt;StackPanel&gt; &lt;DataGrid x:Name="TheGrid" ItemsSource="{Binding Stuff, Source={StaticResource Thing}}" AutoGenerateColumns="False" HeadersVisibility="Column"&gt; &lt;DataGrid.Columns&gt; &lt;DataGridTextColumn Header="!" Binding="{Binding A, FallbackValue=''}" /&gt; &lt;DataGridTextColumn Header="#" Binding="{Binding I, FallbackValue=''}" /&gt; &lt;/DataGrid.Columns&gt; &lt;/DataGrid&gt; &lt;/StackPanel&gt; &lt;/Window&gt; </code></pre> <p>And the following object definitions:</p> <pre><code>public class Thinger { public ObservableCollection&lt;ARow&gt; Stuff { get; private set; } public Thinger() { //Fill up some bogus data string letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int i = 0; Stuff = new ObservableCollection&lt;ARow&gt;(); foreach (var letter in letters) { Stuff.Add(new ARow(letter.ToString(),i)); i++; } } } public class ARow { public string A { get; private set; } public int I { get; set; } public ARow(string a, int i) { A = a; I = i; } } </code></pre> <p>Upon execution, I get mountains of those binding problems. Because many WPF performance articles claim that failed bindings can seriously hurt performance, I suspect this may be the source of many of my problems. </p> <p>What is going on? How can I eliminate these failed bindings? The example I provided is as simple as I could make it while still being symptomatic of the problem, but it should just work, shouldn't it? I'm building for .net 4.0, if that makes any difference.</p> <p><strong>edit:</strong> The errors may be suppressed if you try building the sample code. In visual studio options -> debugging -> output window -> databinding, see that it is set on "Information".</p> <p>I have seen <a href="https://stackoverflow.com/questions/3846823/getting-many-binding-information-in-wpf-output-window">Getting many Binding &quot;Information&quot; in WPF output window</a>, but there is no information on what to do about it in there.</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload