private void EditDestination(object sender, RoutedEventArgs e)
        {
            DestinationStop();
            PageEditor pe = new PageEditor(ExistsDestinationPage(DestinationSelector.SelectedIndex, DestinationPageSelector.SelectedIndex) ? GetDestinationPage(DestinationSelector.SelectedIndex, DestinationPageSelector.SelectedIndex) : null, true, new Int32Rect(Settings.Default.MessageLineWidth, 0, Settings.Default.DisplayWidth - Settings.Default.MessageLineWidth, Settings.Default.DisplayHeight), DestinationSelector.SelectedIndex, "destination", DestinationPageSelector.SelectedIndex, DestinationPageSelector.Items.Count);

            if (pe.ShowDialog() == true)
            {
                SetDestinationPage(DestinationSelector.SelectedIndex, DestinationPageSelector.SelectedIndex, pe.Page);
                RefreshPreview();
            }
        }
        private void EditStop(object sender, RoutedEventArgs e)
        {
            StopStop();
            PageEditor pe = new PageEditor(ExistsStopPage(StopSelector.SelectedIndex, StopPageSelector.SelectedIndex) ? GetStopPage(StopSelector.SelectedIndex, StopPageSelector.SelectedIndex) : null, true, new Int32Rect(0, 0, Settings.Default.DisplayWidth, Settings.Default.DisplayHeight), StopSelector.SelectedIndex, "stop", StopPageSelector.SelectedIndex, StopPageSelector.Items.Count);

            if (pe.ShowDialog() == true)
            {
                SetStopPage(StopSelector.SelectedIndex, StopPageSelector.SelectedIndex, pe.Page);
                RefreshPreview();
            }
        }
        private void EditLine(object sender, RoutedEventArgs e)
        {
            PageEditor pe = new PageEditor(Lines.Messages[LineSelector.SelectedIndex] != null ? Lines.Messages[LineSelector.SelectedIndex].Pages[0] : null, false, new Int32Rect(0, 0, Settings.Default.MessageLineWidth, Settings.Default.DisplayHeight), LineSelector.SelectedIndex, "line", 0, 1);

            if (pe.ShowDialog() == true)
            {
                MessageStorage tmpMessage = new MessageStorage(false, 1);
                tmpMessage.Pages[0] = pe.Page;
                Lines.Messages[LineSelector.SelectedIndex] = tmpMessage;
                ((ComboBoxItem)LineSelector.SelectedItem).Background = ItemExists;
                LineSelector.Background = ItemExists;
                RefreshPreview();
                UpdateLineText(LineSelector.SelectedIndex);
            }
        }