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

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 WaitControl : ActivityControl
  15.     {
  16.         public WaitControl()
  17.         {
  18.             InitializeComponent();
  19.             显示分支选项();
  20.         }
  21.         public override string 标题
  22.         {
  23.             set
  24.             { this.title.Text = value; }
  25.             get
  26.             { return this.title.Text; }
  27.         }
  28.         public override string 说明
  29.         {
  30.             set
  31.             { this.description.Text = value; }
  32.             get
  33.             { return this.description.Text; }
  34.         }
  35.         public override void 显示分支选项()
  36.         {
  37.             submtOption.ItemsSource = null;
  38.             submtOption.ItemsSource = this.分支集合;
  39.         }
  40.         public override void 设为活动()
  41.         {
  42.             img_activite.Visibility = Visibility.Visible;
  43.         }
  44.         private void thumb_DragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e)
  45.         {
  46.             Canvas.SetLeft(this, Canvas.GetLeft(this) + e.HorizontalChange);
  47.             Canvas.SetTop(this, Canvas.GetTop(this) + e.VerticalChange);
  48.             On刷新事件();
  49.         }
  50.         private void Thumb_Link(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e)
  51.         {
  52.             System.Windows.UIElement ui = (System.Windows.UIElement)sender;
  53.             double x = Canvas.GetLeft(ui) + e.HorizontalChange; //移动的水平距离
  54.             double y = Canvas.GetTop(ui) + e.VerticalChange; //移动的坚直距离
  55.             Canvas.SetLeft(ui, x);
  56.             Canvas.SetTop(ui, y);
  57.         }
  58.  
  59.         private void del_MouseUp(object sender, MouseButtonEventArgs e)
  60.         {
  61.             var v = System.Windows.MessageBox.Show("删除" + this.标题 + "?", "", MessageBoxButton.OKCancel);
  62.             if (v == MessageBoxResult.OK)
  63.             {
  64.                 this.删除();
  65.             }
  66.         }
  67.         private void ActivityControl_MouseEnter(object sender, MouseEventArgs e)
  68.         {
  69.             if (myContext.mouseMove)
  70.             {
  71.                 object o = myContext.sourceName;
  72.                 On连接事件(o.ToString());
  73.                 On刷新事件();
  74.                 myContext.mouseMove = false;
  75.                 myContext.sourceName = "";
  76.             }
  77.         }
  78.         private void link_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
  79.         {
  80.             myContext.mouseMove = false;
  81.             myContext.sourceName = "";
  82.         }
  83.         private void link_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  84.         {
  85.             string v = "";
  86.             if (sender is TextBlock)
  87.             {
  88.                 TextBlock ui = sender as TextBlock;
  89.                 v = this.Name + "," + ui.Text;
  90.             }
  91.             if (sender is Image)
  92.             {
  93.                 Image ui = sender as Image;
  94.                 v = this.Name + "," + this.Name;
  95.             }
  96.             myContext.mouseMove = true;
  97.             myContext.sourceName = v;
  98.         }
  99.         private void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
  100.         {
  101.             SetWindowWaitControl swc = new SetWindowWaitControl(this);
  102.             myContext.root.Children.Add(swc);
  103.         }
  104.     }
  105. }