Investigate generic-based approach instead of marker interfaces
- Dominant language
- C#
- Stars
- 719
- Forks
- 113
- Avg merge
- 6d 12h
- Merged PRs (30d)
- 1
Description
Since #327, we have several marker interfaces in our code, such as:
- `IBrush`
- `IFontTypeface`
They work in a similar way: an implementation (say, WPF) creates them from a platform-specific wrappers (say, `WpfBrush` that wraps a WPF `Brush` instance), and then an implementation-issued renderer casts them back to these types to unpack and use.
This involves a lot of unsafe casting, and it's possible to imagine this all getting messed up in a multiplatform application.
We could investigate using more generics instead. For example, it could be possible to parametrize the `IElementRenderer` with ``.
I'm not sure that storing and passing around a lot of generic parameters is such a good idea. But still, I'd like to investigate this approach.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.