Пример #1
0
        private void Path_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 2)
            {
                if (lv.SelectedItem != null)
                {
                    if (((System.Windows.FrameworkElement)sender).DataContext is Space)
                    {
                        Space        sp = (Space)((System.Windows.FrameworkElement)sender).DataContext;
                        BallastSpace tt = null;
                        if (lv.SelectedValue is BallastSpace)
                        {
                            tt = (BallastSpace)lv.SelectedValue;
                        }
                        else if (lv.SelectedValue is SpaceChild)
                        {
                            tt = ((SpaceChild)lv.SelectedValue).Parent;
                        }
                        else
                        {
                            return;
                        }

                        sp.IsSelected = !sp.IsSelected;

                        tt.AddChild(new SpaceChild(tt, sp));
                    }
                }
                else
                {
                    MessageBox.Show("You have not selected a space");
                }
            }
        }
Пример #2
0
        public object Convert(object value, Type type, object parameter, CultureInfo culture)
        {
            int lvl = 0;

            if (value is BallastSpace)
            {
                BallastSpace curBS = (BallastSpace)value;
                while (curBS.Parent != null)
                {
                    // curBS = curBS.Parent;
                    lvl++;
                }
            }
            return(new Thickness(lvl * indentSize, 0, 0, 0));
        }
Пример #3
0
 public void RemoveBallastSpace(BallastSpace ballastSpace)
 {
     _ballastSpaces.Remove(ballastSpace);
     NotifyPropertyChanged("BallastSpaces");
 }
Пример #4
0
 public void AddBallastSpace(BallastSpace ballastSpace)
 {
     _ballastSpaces.Add(ballastSpace);
     NotifyPropertyChanged("BallastSpaces");
 }
Пример #5
0
 public SpaceChild(BallastSpace ballastSpace, Space space)
 {
     Parent = ballastSpace;
     Space = space;
 }
Пример #6
0
 public void RemoveBallastSpace(BallastSpace ballastSpace)
 {
     _ballastSpaces.Remove(ballastSpace);
     NotifyPropertyChanged("BallastSpaces");
 }
Пример #7
0
 public void AddBallastSpace(BallastSpace ballastSpace)
 {
     _ballastSpaces.Add(ballastSpace);
     NotifyPropertyChanged("BallastSpaces");
 }
Пример #8
0
 public SpaceChild(BallastSpace ballastSpace, Space space)
 {
     Parent = ballastSpace;
     Space  = space;
 }