Example #1
0
        private void BPList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            // update the info fields with the data from the selected index on BPList

            if (BPList.SelectedIndex >= 0)
            {
                Breakpoint selectedBreakpoint = BPList.SelectedItem as Breakpoint;

                textBPNumber.Text           = selectedBreakpoint.BPID.ToString();
                comboBPCell.SelectedIndex   = (BPManager._bpCells.ToList().Exists(x => x.CellID == selectedBreakpoint.BPCell)) ? (BPManager.ReturnIDFromDropDown(selectedBreakpoint.BPCellNumber)) : -1;
                textBPDescription.Text      = selectedBreakpoint.BPDescription;
                dateBPStarted.SelectedDate  = DateTime.Parse(selectedBreakpoint.BPStart);
                dateBPFinished.SelectedDate = DateTime.Parse(selectedBreakpoint.BPFinish);
            }
            else
            {
                // if none selected (usually after a breakpoint is deleted) then clear all values

                textBPDescription.Text      = String.Empty;
                textBPNumber.Text           = String.Empty;
                comboBPCell.SelectedIndex   = -1;
                dateBPStarted.SelectedDate  = null;
                dateBPFinished.SelectedDate = null;
            }
        }