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"); } } }
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)); }
public void RemoveBallastSpace(BallastSpace ballastSpace) { _ballastSpaces.Remove(ballastSpace); NotifyPropertyChanged("BallastSpaces"); }
public void AddBallastSpace(BallastSpace ballastSpace) { _ballastSpaces.Add(ballastSpace); NotifyPropertyChanged("BallastSpaces"); }
public SpaceChild(BallastSpace ballastSpace, Space space) { Parent = ballastSpace; Space = space; }