lfsaunders

lfsaunders
- Name: Larry Saunders
- Favorite Languages: C#
- Website: [not set]
- Location: San Diego, CA
- About Me: [not set]
-
WPF Snippet - Detecting Binding Errors
10/08/2009 - 17:39
I added a reference to this error tracer to the SOTC_DataGridExample tutorial, also on your site.
public Window1()
{
SOTC_BindingErrorTracer.BindingErrorTraceListener.SetTrace();
_GameData = new DataTable();
_GameData.Columns.Add(new DataColumn("Game Name", typeof(string)));
_GameData.Columns.Add(new DataColumn("Creator", typeof(string)));
_GameData.Columns.Add(new DataColumn("Publisher", typeof(string)));
_GameData.Columns.Add(new DataColumn("On Xbox", typeof(bool)));When I executed the project I get an exception.
InvalidOperationException:
Dispatcher processing has been suspended, but messages are still being processed.on line 54:
MessageBox.Show(final, "Binding Error", MessageBoxButton.OK, MessageBoxImage.Error);Here is the content of the "final" string:
System.Windows.Data Error: 39 : BindingExpression path error: 'Publisher' property not found on 'object' ''Object' (HashCode=27253481)'. BindingExpression:Path=Publisher; DataItem='Object' (HashCode=27253481); target element is 'TextBlockComboBox' (Name=''); target property is 'SelectedItem' (type 'Object')What do you suggest?
Recent Comments