If I have two objects, one of which is a list of elements and the other having a property that saves the selected element of the other list, is it possible to update the selected element by binding in WPF?
Suppose I have these two data structures:
public class MyDataList { public ObservableCollection<Guid> Data { get; set; } } public class MyDataStructure { public Guid ChosenItem { get; set; } }
Is it possible to associate a Listbox with an instance of both objects so that the ChosenItem property is set by the selected ListBox?
EDIT. To make things clearer, there can be many instances of MyDataStructure, each of which has a selected item from MyDataList. The data list is common to all instances, and I need a way to select an item and save that selection to MyDataStructure.
source share