public void AddPhoto(string n, WriteableBitmap photo)
        {
            LPhotoHeaderItem LP = new LPhotoHeaderItem();

            LP.TargetPhoto = photo;
            LP.TabName     = n;
            //CurrentPhoto = photo;
            TargetControl.setPhoto(photo);
            comboBoxControl.Items.Add(LP);
            comboBoxControl.SelectedItem = LP;
        }
        private void comboBoxControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            LPhotoHeaderItem ti = e.AddedItems[0] as LPhotoHeaderItem;

            if (ti != null)
            {
                if (ti.TargetPhoto != null)
                {
                    TargetControl.setPhoto(ti.TargetPhoto);
                }
            }
        }
        string getNextName()
        {
            string s = "UnNamed";

            for (int i = 0; i < 1000; i++)
            {
                LPhotoHeaderItem ti = getItem(s + i.ToString());
                if (ti == null)
                {
                    return(s + i.ToString());
                }
            }
            return(Guid.NewGuid().ToString());
        }
        public void RemovePhoto(string n)
        {
            LPhotoHeaderItem ti = getItem(n);

            if (ti != null)
            {
                comboBoxControl.Items.Remove(ti);
                comboBoxControl.SelectedItem = null;
                if (TargetControl.getPhoto() == ti.TargetPhoto)
                {
                    TargetControl.Clear();
                }
                ti.Clear();
            }
        }
        public void RemovePhoto(WriteableBitmap b)
        {
            if (b == null)
            {
                return;
            }
            LPhotoHeaderItem ti = getItem(b);

            if (ti != null)
            {
                comboBoxControl.Items.Remove(ti);
                comboBoxControl.SelectedItem = null;
                if (TargetControl.getPhoto() == ti.TargetPhoto)
                {
                    TargetControl.Clear();
                }
                ti.Clear();
            }
        }