BindableBase vs INotifyChanged

INotifyPropertyChanged The ViewModel should implement the INotifyPropertyChanged interface and should raise it whenever the propertychanges public class MyViewModel : INotifyPropertyChanged { private string _firstName; public event PropertyChangedEventHandler PropertyChanged; public string FirstName { get { return _firstName; } set { if (_firstName == value) return; _firstName = value; PropertyChanged(this, new PropertyChangedEventArgs(“FirstName”)); } } } } Problem … Read more

Prism Custom Confirmation Interaction

Main thing is, when you raise the interaction, provide a callback that is triggered when the interaction is finished. This callback gets the notification back and your interaction should have stored all potentially interesting return values there. Here’s an example… Relevant parts of the ViewModel: public InteractionRequest<SelectQuantityNotification> SelectQuantityRequest { get; } // in some handler … Read more

Region Manager can not find region inside of the custom popupwindow

Probably you need to set the region manager manually, in the popup view’s code behind (constructor), like this: RegionManager.SetRegionName( theNameOfTheContentControlInsideThePopup, WellKnownRegionNames.DataFeedRegion ); RegionManager.SetRegionManager( theNameOfTheContentControlInsideThePopup, theRegionManagerInstanceFromUnity ); You’ll have to assign a name to the content control hosting the region and somehow acquire the region manager (ServiceLocator.Current.GetInstance<IRegionManager>()).

MVVM: Binding to Model while keeping Model in sync with a server version

In the past I ‘ve written an application that supports “live” editing of data objects from multiple locations: many instances of the app can edit the same object at the same time, and when someone pushes changes to the server everyone else gets notified and (in the simplest scenario) sees those changes immediately. Here’s a … Read more

Sync SelectedItems in a muliselect listbox with a collection in ViewModel

So, assume you have a ViewModel with the following properties: public ObservableCollection<string> AllItems { get; private set; } public ObservableCollection<string> SelectedItems { get; private set; } You would start by binding your AllItems collection to the ListBox: <ListBox x:Name=”MyListBox” ItemsSource=”{Binding AllItems}” SelectionMode=”Multiple” /> The problem is that the SelectedItems property on ListBox is not a … Read more