I recently added a OneWayToSource binding in our code to a read-only property in a view model. At the time I did not know about the change in .Net 4, that this will cause an exception when there is no getter:
<Popup IsOpen="{Binding IsPopupOpen, Mode=OneWayToSource}" />
...
public bool IsPopupOpen
{
set
{
// do something with value
}
}
The problem is, this code works on my computer without throwing an exception. The exact same executable does not work on other machines - the popup does not open, and the expected exception gets thrown. I cannot figure out how this is possible? The project targets .Net FW 4.
I made sure to clear out my bin folder and rebuild, but it is still working without exception on my machine, and not on others.
I know how to "fix" this - simply add a getter to the property. However I need to figure out how the program is functioning differently on different machines, as this could cause other serious issues...
EDIT:
This is driving me mad! I look at my popup using Snoop WPF utility, and there appears to be no binding to IsOpen at all (the binding is a new addition to the XAML). However, if I attach the debugger to the app and set a breakpoint inside the setter of the bound property, it hits my breakpoint!!