本文介绍了应用程序应在Windows Phone 7上在后台运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好锥子..
我已经开发并通过Windows Phone 7平板电脑发送电子邮件的aap ...我想在屏幕背景上运行该应用程序...意味着用户应该看不到该应用程序正在运行
hello awl..
i ''ve developed and aap which sends email through the windows phone 7 plateform...i want to run that app on the background of the screen...means to say it should be invisible to the user that this app is running on his mobile so plz help me what should i do????
推荐答案
#region private members
bool runsUnderLock;
bool isRunningUnderLock;
bool hasUserAgreedToRunUnderLock;
bool isRestartRequired;
#endregion
#region public properties
public bool RunsUnderLock
{
get
{
return runsUnderLock;
}
set
{
if ( value != runsUnderLock )
{
runsUnderLock = value ;
if ( runsUnderLock )
{
PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;
PhoneApplicationFrame rootframe = App.Current.RootVisual as PhoneApplicationFrame ;
System.Diagnostics.Debug.Assert(rootframe != null, "This sample assumes RootVisual has been set");
if (rootframe != null)
{
rootframe.Obscured += new EventHandler<obscuredeventargs>(rootframe_Obscured);
rootframe.Unobscured += new EventHandler(rootframe_Unobscured);
}
}
else
{
IsRestartRequired = true;
// we can not set it; we have to restart app ...
// PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Enabled ;
EventHandler eh = RestartRequired;
if (eh != null)
eh(this, new EventArgs());
}
SaveSetting("RunsUnderLock", runsUnderLock);
OnPropertyChanged("RunsUnderLock");
}
}
}</obscuredeventargs>
您可以阅读以下内容:
解决方案
请评价是否对您有帮助:)
You can read this :
Solution
Please rate if a helped you :)
这篇关于应用程序应在Windows Phone 7上在后台运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!