// ===== Commands ===== public void SelectBlock(BlockViewModel block, CompositionMode compositionMode) { Debug.WriteLine("single select (mode: {0}, block: {1})", compositionMode, block); switch (compositionMode) { case CompositionMode.None: SelectedBlocks.Clear(); if (block != null && !SelectedBlocks.Contains(block)) { SelectedBlocks.Add(block); } break; case CompositionMode.Additive: if (block != null && !SelectedBlocks.Contains(block)) { SelectedBlocks.Add(block); } break; case CompositionMode.Subtractive: if (block != null) { SelectedBlocks.Remove(block); } break; } }
public void SelectAllBlocks() { SelectedBlocks.Clear(); foreach (BlockViewModel b in AllBlocks) { SelectedBlocks.Add(b); } }
private void AddButton_Click(object sender, RoutedEventArgs e) { if (blockList.SelectedItem != null) { var item = (Block)blockList.SelectedItem; SelectedBlocks.Add(item.WithCount(int.Parse(countBox.Text))); UpdateString(); } }
private void AddDrop(object sender, DragEventArgs e) { var source = (Block)e.Data.GetData(typeof(Block)); if (source.Count == 0) { SelectedBlocks.Add(source.WithCount(int.Parse(countBox.Text))); UpdateString(); } }
private void SelectUnselectedBlock(TimetableBlock block) { var timetableBlock = Timetable.Blocks.SingleOrDefault(b => b.StartDate == block.StartDate); if (CheckSelection(block)) { SelectedBlocks.Remove(block); timetableBlock.WorkItem = null; } else { SelectedBlocks.Add(block); } }