public double Speed { get; set; }
private int width; private int height;
public int Control_Width { get { return 100; } set { width = value; } }
public int Control_Height { get { return 100; } set { height = value; } }
使用线程,为用户控件作转动效果:
public loading()
{
InitializeComponent();
this.Width = Control_Width;
this.Height = Control_Height;
timer = new DispatcherTimer();
timer.Interval = TimeSpan.FromMilliseconds(Speed);
timer.Tick += new EventHandler(timer_Tick);
textBlock1.MouseLeftButtonDown += new MouseButtonEventHandler(textBlock1_MouseLeftButtonDown);
}
void timer_Tick(object sender, EventArgs e)
{
this.image1.Source = new BitmapImage(new Uri("Assets/loading00" + Count + ".png", UriKind.Relative));