Arlodotexe / strix-music

Combine any music sources into a single library. It's your music. Play it your way.
http://www.strixmusic.com
139 stars 4 forks source link

ViewModels should implement IDelegatable<T> #241

Closed Arlodotexe closed 1 year ago

Arlodotexe commented 1 year ago

Background

Once we have top-level app infrastructure finished, we'll be able to start churning out plugins and new adding functionality.

Problem

The Strix Music SDK has models that operate in layers. The Plugin layer and ViewModel layer both implement IStrixDataRoot and can sit on top of anything that implements IStrixDataRoot.

Consumers of the SDK should be able to peel back these layers to access the underlying data. The plugin layer does this by implementing IDelegatable<T>, providing an Inner property that points to the original implementation.

The ViewModel layer, however, does not implement IDelegatable<T>, meaning the consumer cannot read from the backing object.

Tl;dr; If you feed the Plugin layer to a ViewModel layer, ViewModels don't allow you to access data on the plugins. In the Strix Music App, this makes plugins inaccessible from the UI.

Solution