Red Highlighted property without Databinding error

Mar 8, 2012 at 5:34 PM

Hello and thanks for your work. It's awesome. I don't know how I would debug xaml without SNOOP, a must have.

I'm facing a problem with a binding and the Output window of visual studio does not says anything. When I run snoop I see the property in red but without any databinding errors. If I right click and select Delve BindingExpression I get two exceptions. First an ArgumentException saying "Cannot set Expression. It is marked as 'NonShareable' and has already been used."  and then another one (InvalidOperationException) saying "ShowDialog can be called only on hidden windows."

The binding  is on a DataGridCollumnCell and is the following one:

<DataGridTemplateColumn>

    <DataGridTemplateColumn.CellTemplate>

        <DataTemplate>

            <DockPanel HorizontalAlignment="Right" >

                <TextBlock Margin="3,0,3,0" VerticalAlignment="Center" Text="{Binding Status.Value, TargetNullValue=---}" Background="{Binding Status.Value, Converter={StaticResource StatusToColorConverter}}" />

            </DockPanel>

        </DataTemplate>

    </DataGridTemplateColumn.CellTemplate>

</DataGridTemplateColumn>

Note that the binding on the Text property is working and the one on the Background is the one failing. I can provide you with screenshots or whatever can help you to debug the issue.

Keep up with the good work!

Apr 12, 2012 at 5:23 AM

Hello,

I had similar problem when my converter returned value or wrong type: instead of System.Windows.Media.SolidColorBrush it returned System.Drawing.SolidBrush.

Apr 12, 2012 at 8:42 AM

Ey, that could be the reason. I will check it. Thanks!

 

By the way, why this issue is not being investigated nor there is any feedback from the Snoop team?

Apr 12, 2012 at 9:52 PM

Crui3r, problem fixed. Thanks a lot man, I owe you one.

Developer
Apr 12, 2012 at 10:44 PM

Hi,

I somehow didn't notice this on the discussions panel, as I check periodically, and don't get notifications. I will be very happy to look into this. To make things easier on me, would it be possible to attach an repro app? 

And to make sure I understand the problem correctly, is it that it does not adequately say what the binding error is in Snoop?

Apr 13, 2012 at 9:12 AM

Right. It shows an error on the binding as the background is in red but not text at all.  If I right click on the binding error and select Delve BindingExpression I get two exceptions. First an ArgumentException saying "Cannot set Expression. It is marked as 'NonShareable' and has already been used."  and then another one (InvalidOperationException) saying "ShowDialog can be called only on hidden windows."

I will try to make a test application, right.

Coordinator
Apr 18, 2012 at 2:34 PM

Sorry ... I also missed this post. I am just now getting to a bunch of forum discussions ... since I was swamped in my day job.

Please do try and get a test harness together, create an issue, and attach it to the issue.

Apr 19, 2012 at 3:22 PM

The defect was found long time ago and fixed. Currently I'm at 120% in my own project and have no time to create a proof of concept of the defect, sorry. Anyway should be easy to recreate with the info on the posts.

Thanks for the good job!