public ProgrammerView(FpgaBoard device, MemoryWord[] program) { InitializeComponent(); this.DataContext = new ViewModels.ProgrammerViewModel(device, program); // subscribe to events whenever an item is added/removed from the collection bound to the log list view ((INotifyCollectionChanged)logList.Items).CollectionChanged += OnListViewCollectionChanged; }
public ProgrammerViewModel(FpgaBoard device, MemoryWord[] program) { this.device = device; this.program = program; Log = new ObservableCollection <string>(); // as we will access the log from other threads, we need to synchronize with the main thread BindingOperations.EnableCollectionSynchronization(Log, logLock); CmdCloseWindow = new RelayCommand <Window>((x) => OnCommand_CloseWindow(x), (x) => !isBusy); CmdProgram = new RelayCommand(() => OnCommand_Program(), () => !isBusy); }