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;
        }
Beispiel #2
0
 public AddProgramViewModel()
 {
     CommandAddViewModel = new CommandListViewModel();
     CommandAddControl   = new CommandListControl().AsProxy();
 }