本帖最后由 sloveb520 于 2011-11-08 16:26:50 编辑

解决方案 »

  1.   

    增加一个DispatcherTimer用来计时,然后到时间后判断按钮是否被点击过,没有的话,就跳转。
    using System.Windows.Threading;...
    DispatcherTimer tm = newDispatcherTimer();publicWindow1()      
    {
        InitializeComponent();
       
    }
           
    private voidWindow_Loaded(objectsender, RoutedEventArgse)
    {
         tm.Tick +=newEventHandler(tm_Tick);      
         tm.Interval = TimeSpan.FromSeconds(60);
         tm.Start();
    }void tm_Tick(objectsender, EventArgse)
    {
        if(Button1.IsPressed)
         {
              //被按过
              tm.Stop();
             //跳转到其他页面
            NavigationService.GetNavigationService(this).Navigate(new Uri("LoginWindow.xaml", UriKind.Relative));
         }         
    }
    ...