2011-07-04 52 views
0

我的手机应用程序还有另一个问题。windows phone 7,帮助后退按钮和页面,保存变量

我的问题是:“最爱”

在一个页面上我有图片的列表,并标记为一个按钮如果您想要收藏该行的特定图像,图像的边框将更改颜色以表示此情况。

但是,无论何时我将我的应用程序或命中后退按钮并返回到同一页面,图像的边界将恢复为其默认颜色。

现在,在你问之前,我不知道这是否是一个孤立的记忆问题。我刚开始研究隔离式存储,目前我很难掌握。

也许这是一个节能状态问题?

无论哪种方式,我想有我的应用程序还记得那些最喜欢的是每当用户退出应用程序或墓碑,或者点击后退按钮等

可能有人请提供一段代码为了帮助这个?

+0

你在哪里坚持喜好列表? IsolatedStorage? IsolatedSettings? –

+0

这就是它,我甚至不知道该选哪个。收藏列表的目标是通过是否收藏图片,然后在另一个页面上只显示可见的收藏项目。 – topcoderwannabe

+0

我试过看过孤立的存储电影,这里的问题,它只是让我更困惑。 – topcoderwannabe

回答

0

您需要保存您的数据,因为系统基本上正在终止您的应用程序。所以,你在你的app.xaml.cs需要写代码来保存和读取metods数据

// Code to execute when the application is launching (eg, from Start) 
    // This code will not execute when the application is reactivated 
    private void Application_Launching(object sender, LaunchingEventArgs e) 
    { 
    } 

    // Code to execute when the application is activated (brought to foreground) 
    // This code will not execute when the application is first launched 
    private void Application_Activated(object sender, ActivatedEventArgs e) 
    { 
    } 

    // Code to execute when the application is deactivated (sent to background) 
    // This code will not execute when the application is closing 
    private void Application_Deactivated(object sender, DeactivatedEventArgs e) 
    { 
    } 

    // Code to execute when the application is closing (eg, user hit Back) 
    // This code will not execute when the application is deactivated 
    private void Application_Closing(object sender, ClosingEventArgs e) 
    { 
    }