youngfan007 发表于 2015-5-9 09:10:24

Silverlight for Windows Phone 7--Popup

  在Windows Phone 7开发者我在不使用Progressbar的前提下又想告诉用户程序正在运行,显示一个进度对话框,这时我们就可以用Popup。
  
  前台
  
               
                  
                        
                           
                                 
                                    
                                          
                                    
                                                               
                                                      
                           
                        
                  
               
            
  
  后台
  public partial class MainPage : PhoneApplicationPage
    {
      Storyboard _timer = new Storyboard();
      
      int i=0;
      public MainPage()
      {
            InitializeComponent();
  _timer.Duration = TimeSpan.FromMilliseconds(10);
            _timer.Completed += new EventHandler(_timer_Completed);
            _timer.Begin();
             i = Convert.ToInt32(txt.Text);
      }
  private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
      {
            this.Dispatcher.BeginInvoke(new Action(() => ProgressPopup.IsOpen = true));
      }
  void _timer_Completed(object sender, EventArgs e)
      {
            
            if (i{ ProgressPopup.IsOpen = false; }));
      }
  }
页: [1]
查看完整版本: Silverlight for Windows Phone 7--Popup