private void NewBitmapButton_Click(object sender, RoutedEventArgs e)
        {
            EditVisualization dlg = new EditVisualization(this, mProject, mFormatter, mOffset,
                                                          CreateEditedSetList(), null);

            if (dlg.ShowDialog() != true)
            {
                return;
            }
            VisualizationList.Add(dlg.NewVis);
            visualizationGrid.SelectedIndex = VisualizationList.Count - 1;

            okButton.Focus();
        }
        private void EditSelectedItem()
        {
            if (!IsEditEnabled)
            {
                // can get called here by a double-click
                return;
            }
            Visualization item = (Visualization)visualizationGrid.SelectedItem;
            Visualization newVis;

            if (item is VisualizationAnimation)
            {
                EditBitmapAnimation dlg = new EditBitmapAnimation(this, mOffset,
                                                                  CreateEditedSetList(), (VisualizationAnimation)item);
                if (dlg.ShowDialog() != true)
                {
                    return;
                }
                newVis = dlg.NewAnim;
            }
            else
            {
                EditVisualization dlg = new EditVisualization(this, mProject, mFormatter, mOffset,
                                                              CreateEditedSetList(), item);
                if (dlg.ShowDialog() != true)
                {
                    return;
                }
                newVis = dlg.NewVis;
            }

            int index = VisualizationList.IndexOf(item);

            VisualizationList.Remove(item);
            VisualizationList.Insert(index, newVis);
            visualizationGrid.SelectedIndex = index;

            okButton.Focus();
        }