/// <summary> /// 長方形を追加する /// </summary> /// <param name="area">長方形を追加する領域を指定</param> public void AddRect(Rect area) { var element = new PlaceableElement { X = (int)area.X, Y = (int)area.Y, Width = (int)area.Width, Height = (int)area.Height, Fill = Brushes.Red, Stroke = Brushes.Black, IsSelected = false }; ElementCollection.Add(element); }
/// <summary> /// RaiseCanExecuteChangedを呼び出すためのSelectRectのラッパー /// </summary> private void SelectRect(PlaceableElement rect) { appContext.UIData.SelectRect(rect); RemoveRectCommand.RaiseCanExecuteChanged(); }
/// <summary> /// 指定した長方形を選択状態ににする /// </summary> /// <param name="rect">選択する長方形</param> public void SelectRect(PlaceableElement rect) { rect.IsSelected = true; }