示例#1
0
 protected override void OnMouseMove(MouseEventArgs e)
 {
     base.OnMouseMove(e);
     if (click && e.LeftButton == MouseButtonState.Pressed)
     {
         click                  = false;
         drag                   = true;
         Stroke.Stroke          = SBrushes.BlueM;
         Stroke.StrokeThickness = 3;
         PokemonBank.Current.DragIcon.Source     = VM.Icon;
         PokemonBank.Current.DragIcon.Visibility = Visibility.Visible;
         Cursor = Cursors.None;
         if (VM.Model != null)
         {
             DragDrop.DoDragDrop(this, this, DragDropEffects.All);
         }
         Cursor = Cursors.Hand;
         drag   = false;
         icon.ClearValue(Image.SourceProperty);
         icon.Visibility = System.Windows.Visibility.Visible;
         PokemonBank.Current.DragIcon.Visibility = Visibility.Collapsed;
         Stroke.ClearValue(Polygon.StrokeProperty);
         Stroke.ClearValue(Polygon.StrokeThicknessProperty);
     }
 }
示例#2
0
 protected override void OnMouseLeave(MouseEventArgs e)
 {
     base.OnMouseLeave(e);
     click = false;
     if (!drag)
     {
         Stroke.ClearValue(Polygon.StrokeThicknessProperty);
     }
 }