private void LoadListBox() { var control = new CommandListControl { ItemsSource = ((ControllerViewModel)DataContext).CommandViews }; var binding = new Binding { Path = new PropertyPath(nameof(ControllerViewModel.SelectedCommandView)), Source = DataContext, Mode = BindingMode.TwoWay }; BindingOperations.SetBinding(control, CommandListControl.SelectedItemProperty, binding); BaseScrollViewer.Content = control; }
public AddProgramViewModel() { CommandAddViewModel = new CommandListViewModel(); CommandAddControl = new CommandListControl().AsProxy(); }