-
-
Notifications
You must be signed in to change notification settings - Fork 144
LabelledValue
canton7 edited this page Dec 4, 2014
·
2 revisions
Sometimes you want to display some object to the user, but you want to associate a custom (string) label with it, which will be displayed by your View. So you create a quick class to wrap up your object and attach this label.
Then you'll want to override ToString so that your View displays just the label, and Equals and GetHashCode so they work properly with things that have a SelectedItem
of some sort (e.g. ComboBox
). Finally, you'll want to implement INotifyPropertyChanged
so that changes to this can be picked up by the View.
This is all that LabelledValue<T>
is - a class with a string Label
property and a T
Value
property. Plus an overridden ToString
, GetHashCode
, Equals
, and implementing INotifyPropertyChanged
.
- Introduction
- Quick Start
- Bootstrapper
- ViewModel First
- Actions
- The WindowManager
- MessageBox
- The EventAggregator
- PropertyChangedBase
- Execute: Dispatching to the UI Thread
- Screens and Conductors
- BindableCollection
- Validation using ValidatingModelBase
- StyletIoC
- The ViewManager
- Listening to INotifyPropertyChanged
- Design Mode Support
- Logging
- Misc