Closed markolbert closed 3 years ago
Okay, I figured out the problems.
First, part of my code base is a general purpose library which uses System.Drawing.Color because it needs to support both console apps and Windows desktop apps. Because the ColorPickerLib uses System.Windows.Media.Color accessing my viewmodel property was throwing exceptions.
Second, I had a typo in the property binding for the numeric updown control.
Re-opening an earlier issue/question...
I am relatively new to WPF, and am using the pre-release Microsoft Community Toolkit MVVM library.
The issue I'm running into involves the UI not calling the property setters for what should be bound properties:
The RouteColor property is contained in an ObservableObject.
When I run the app and change the color the property setter is not called. Similarly, the getter isn't called, either, when the control initializes because the displayed/default color is not what I've assigned to RouteColor as an initial value.
The exact same problem -- the setters and getters not being called -- takes place with your companion NumericUpDown library, too.
I'm not sure where the difficulty is, but I did do a simple test using a simple string property bound to a TextBox, and its getter gets called when the TextBox's value is updated.