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