Skip to content

Refactor Redraw - Non-virtual with the right set of virtual OnXXX methods #2482

@tig

Description

@tig

In v2, i'd like us to revisit how Redraw and the related events are structured. I started this in my View2 PR...

* `Redraw` is mis-named. It should just be `Draw` (it also shouldn't take a `Bounds` because implementors can just use `this.Bounds`; this is a cause of a bunch of bugs BTW).

* `Draw` should simply call
  
  * `OnDraw`
  * `OnDrawFrames`
  * `OnDrawContent`
  * `OnDrawContentComplete`

Each of those invokes an event and each is cancellable (except OnDrawContentComplete).

@tig I agree with this scenario, but Draw mustn't be virtual to avoid derived class not calling the OnDraw, OnDrawFrames, OnDrawContent and OnDrawContentComplete. Maybe protected. What do you think?

Originally posted by @BDisp in #2479 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions