1

我有一个 MouseLeave 事件要管理。它适用于模拟器,但不适用于 Windows Phone 设备,代码如下:

 private void sun_MouseLeave(object sender, MouseEventArgs e)
        {
            Point punto = e.GetPosition(sun);
            Point punto1 = new Point(-361, 448);
            double X1 = Math.Abs(punto.X - punto1.X);
            if (X1 < 100)
            {
                tmr.Start();
            }                  
        }

它应该激活另一个事件,并打开计时器。但它不起作用!这是另一个事件:

void OnTimerTick(object sender, EventArgs e)
      {
        tmr.Stop();
        double lol = cube.Margin.Left;
        double lol2 = cube.Margin.Top;
        cube.Height -= 50;
        cube.Width -= 50;
        cube.Margin = new Thickness(lol + 20, lol - 50, 0, 0);

        pozza.Height += 50;
        pozza.Height += 50;

        if(cube.Height <= 0 )
             NavigationService.Navigate(new Uri("/lvlSet2/s2lvl21.xaml", UriKind.Relative));
        else
            tmr.Start();
    }
4

0 回答 0