Making UI Thread wait using Thread.sleep

前端 未结 2 1236
一向
一向 2021-01-21 15:10

I have written this code in C# for WP7 :

public void btn_handler(object sender, EventArgs args)
    {
        Button btn_Pressed = (Button)sender;
        Image         


        
2条回答
  •  遥遥无期
    2021-01-21 15:59

    You should never ever block the UI thread by calling Thread.Sleep.

    I think that the best solution is to create a storyboard in your XAML that will perform the required visual changes. Your button click event handler should then simply call Begin on the storyboard.

提交回复
热议问题