-2
我在頁面的最後一行的值的錯誤。程序所做的是計算您點擊屏幕上的點擊次數。在Windows Phone應用程序中的值錯誤
請幫幫我。
我試圖通過添加女貞爲整數,我認爲我解決它以這種方式來增加價值作爲整數和一切,但什麼也沒發生前值有一個與SAVECOUNT問題,那麼我解決它。
你,我要與使用的東西添加一些東西?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.Windows.Navigation;
using System.Windows.Threading;
namespace TapToCount
{
public partial class MainPage : PhoneApplicationPage
{
private int count;
private int savedCount;
// Constructor
public MainPage()
{
InitializeComponent();
}
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
{
base.OnMouseLeftButtonDown(e);
this.count++;
this.CountTextBlock.Text = this.count.ToString("N0");
}
private void ResetButton_Click(object sender, RoutedEventArgs e)
{
this.count = 0;
this.CountTextBlock.Text = this.count.ToString("N0");
}
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
base.OnNavigatedFrom(e);
// Persist state when leaving for any reason (Deactivated or Closing):
this.savedCount.value= this.count;
}
}
}
那麼你有什麼異常?你如何保存savedCount字段? – gbanfill 2012-04-09 12:11:41
savedCount具有任何名爲value的屬性? – TutuGeorge 2012-04-09 12:18:45
我想要的所有想法是統計你點擊屏幕的應用程序的數量 – 2012-04-09 13:01:31