BeginControl.xaml.cs
上传用户:lvyingde
上传日期:2018-04-24
资源大小:610k
文件大小:2k
源码类别:

SilverLight

开发平台:

C#

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Documents;
  8. using System.Windows.Input;
  9. using System.Windows.Media;
  10. using System.Windows.Media.Animation;
  11. using System.Windows.Shapes;
  12. namespace wxwinter.WFDesignerSl
  13. {
  14.     public partial class BeginControl : ActivityControl
  15.     {
  16.         public BeginControl()
  17.         {
  18.             InitializeComponent();
  19.         }
  20.         private void thumb_DragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e)
  21.         {
  22.             
  23.             
  24.             Canvas.SetLeft(this, Canvas.GetLeft(this) + e.HorizontalChange);
  25.             Canvas.SetTop(this, Canvas.GetTop(this) + e.VerticalChange);
  26.             On刷新事件();
  27.         }
  28.         private void link_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  29.         {
  30.             string v="";
  31.             if (sender is TextBlock)
  32.             {
  33.                 TextBlock ui = sender as TextBlock;
  34.                 v = this.Name + "," + ui.Text;
  35.                 
  36.            
  37.             }
  38.             if (sender is Image)
  39.             {
  40.                 Image ui = sender as Image;
  41.                 v = this.Name + "," + this.Name;
  42.           
  43.             }
  44.             myContext.mouseMove = true;
  45.             myContext.sourceName = v;
  46.         }
  47.         private void link_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
  48.         {
  49.             myContext.mouseMove = false;
  50.             myContext.sourceName = "";
  51.         }
  52.     }
  53. }