Skip to main content

Timeline for Winforms Circular Checkbox

Current License: CC BY-SA 3.0

10 events
when toggle format what by license comment
Dec 20, 2014 at 3:58 vote accept Shadow
Dec 17, 2014 at 16:50 comment added Heslacher Right, but then it should use property changed event.
Dec 17, 2014 at 16:48 comment added Anthony Even if it is internal (which this class currently is defaulting to), it means it can be changed by other code within your own assembly. When building a Form within the same assembly, you can place a CircularCheckbox in the form and then set the value from within your custom Form. Without invalidating in the property setter, all of the sudden your Form needs to know to call Invalidate after setting the property. It is the responsibility of the CircularCheckbox to know when it needs to redraw itself, which is the moment the IsChecked property is changed.
Dec 17, 2014 at 16:43 comment added Heslacher If you see this from the point as a public avaiable assembly, then you are right, but then the class should be public, shouldn' it.
Dec 17, 2014 at 16:34 comment added Anthony My point still stands though, if some outside code calls myCustomCheckBox.IsChecked = true it will set the property but not repaint the graphics. If you want to get rid of the Invalidate in the IsChecked public setter you need to make the property setter private - or maybe protected with a good comment explaining that the caller must Invalidate the control after setting the value.
Dec 17, 2014 at 16:29 comment added Heslacher I wrote this comment without looking at the code ;-) corrected comment.
Dec 17, 2014 at 16:23 comment added Heslacher +1 good points especially using. For the properties I agree but not with the IsChecked because it is handled by override void OnClick(). But maybe it would be better to put the call to Invalidate() inside each property setter
Dec 17, 2014 at 14:09 history edited Anthony CC BY-SA 3.0
added 569 characters in body
Dec 17, 2014 at 13:59 history edited Anthony CC BY-SA 3.0
added 494 characters in body
Dec 17, 2014 at 13:54 history answered Anthony CC BY-SA 3.0