How to use IActivatableViewModel and ObservableCollections #3766
Unanswered
glen-nicol
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I imagine I am just naive coming from other frameworks. But I would like to limit a subscription to a service in a viewmodel that will modify a list of items to only when the viewmodel is loaded in the UI. So I figure I need to hook up
IActivatableViewModel
but when I do that thethis.WhenActivated
callback does not have the constructor function scope to set readonlyObservableCollection<>
member variables that are backingReadonlyObservableCollection<>
properties bound to the ListBox.So then the options seems to be
EDIT: replaced OAPH with RW property when I remembered OAPH has constructor limitation too.
PS: kinda unrelated but is there a better way to do reactiveUI bindings for items in an Itemssource besides
IViewFor<>
? Creating ReactiveUserControls for list items with a couple properties is verbose/painful. I am aware I can still just put a datatemplate in theItemTemplate
property but then I lose strongly typed bindings.Beta Was this translation helpful? Give feedback.
All reactions