Example #1
0
 private void TegakiCanvas_SelectionChanged(object sender, EventArgs e)
 {
     if (TegakiCanvas.GetSelectedElements().Count + TegakiCanvas.GetSelectedStrokes().Count != 0)
     {
         TegakiCanvas.ContextMenu = EditMenu;
     }
     else
     {
         TegakiCanvas.ContextMenu = NormalMenu;
     }
 }
Example #2
0
        //削除ボタン
        void Remove_Click(object sender, RoutedEventArgs e)
        {
            List <UIElement> UIEL = new List <UIElement>();
            List <Stroke>    SL   = TegakiCanvas.GetSelectedStrokes().ToList();

            foreach (UIElement UIE in TegakiCanvas.GetSelectedElements())
            {
                UIEL.Add(UIE);
            }
            foreach (UIElement UIE in UIEL)
            {
                TegakiCanvas.Children.Remove(UIE);
            }
            foreach (Stroke S in SL)
            {
                TegakiCanvas.Strokes.Remove(S);
            }
            TegakiCanvas.ContextMenu = NormalMenu;
        }