I'm using the ColorCanvas in my data template for a color selection view model. When I launch a window with this view model as the data context, the setter for the property bound to the color canvas's SelectedColor is called with a new value that is exactly 1 less than the initially bound value (the blue value is decremented). The call stack shows that the slider was moved, which triggered the property change. I never touched the slider, so it appears the slider is being moved from within the ColorCanvas. Any ideas why this is happening?
(To clarify, the property is set once by me in the view model, and then is immediately set again by the slider change, to a value 1 less than I had set it to.)
Comments: ** Comment from web user: nielw **
(To clarify, the property is set once by me in the view model, and then is immediately set again by the slider change, to a value 1 less than I had set it to.)
Comments: ** Comment from web user: nielw **
In the included sample project, you'll notice on line 56 of App.xaml.cs that I'm setting the SelectedColor to Bisque (FFFFE4C4). When the ColorCanvas displays, you'll notice it's displaying FFFFE4C3. The blue channel has been decremented.
The call stack is not nearly as informative as it was in my other project. It showed that a slider on the color canvas was responsible for the SelectedColor's setter being called with the decremented value. (I'm referring to my SelectedColor property on line 60 of App.xaml.cs, which is bound to the ColorCanvas's SelectedColor property.)