views:

20

answers:

1

Ok I feel like I am just missing something small here, but it has taken me too long to figure this one out.

I have a custom UserControl that has a drop shadow. This UserControl is then used as the view to create a ModelUIElement3D. The drop shadow works perfectly when first displaying. The trick here is that I want to be able to change the direction of the shadow programmatically.

I have set up a binding to the ShadowDirection property that I know is working correctly, so I am left to believe that the problem lies in my view not updating. I have tried to invalidate the ModelUIElement3D, the UserControl, and the Window they all sit in, but have had no success.

Anyone know where I might be going wrong?

Thanks in advance.

Rick

A: 

Does the object to which ShadowDirection is bound implement INotifyPropertyChanged?

If not, the UI will never pick up changes from the bound object.

Jay
Yes, check whether the property changed is getting fired. Also, check binding mode you are using.
Avatar
Making sure I was implementing INotifyPropertyChanged and ensuring the event was firing was the first thing I double checked, so it isn't that. However, it may involve the binding mode as I never specify it. Unfortunately, I have had to move on to different aspects of the project but may be able to make another attempt at this this afternoon and will try specifying the binding mode. Thanks guys.
The_Rick_14
@The_Rick_14 Hmmm… unfortunately, I doubt explicitly set the binding mode will make a difference; the default should be fine. All I can suggest is that you break down the problem. See if you can get the binding working with just the flat UserControl, or a ModelIUIElement created from a simpler control, etc.
Jay