1
在後臺代理中,我創建(或更新)應用程序實時磁貼之一,並按預期工作。
問題是,當我點擊這個活瓷磚屏幕閃爍但我的應用程序沒有「重新啓動」,也沒有「顯示」。
有什麼問題?
我附上一小部分的代碼,但要求更多是你需要的。點擊LiveTile不會顯示/運行我的應用程序
MAIN PAGE
public partial class MainPage : PhoneApplicationPage
{
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
}
public MainPage()
{
InitializeComponent();
// Runs background agent: code is simplified
StartAgent();
}
}
後臺代理
public class TileAgent : ScheduledTaskAgent
{
protected override void OnInvoke(ScheduledTask task)
{
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
Vars.UpdateTiles();
});
NotifyComplete();
}
}
靜態類
public class Vars
{
private static Uri uri = new Uri(
"/MainPage.xaml?tile",
UriKind.RelativeOrAbsolute);
private static RadExtendedTileData ExtendedData
{
get
{
return new RadExtendedTileData()
{
VisualElement = frontTile,
BackVisualElement = backTile,
};
}
}
public static void UpdateTiles()
{
// I perform some task here
// Then I create/update live tile
Telerik.Windows.Controls.LiveTileHelper.CreateOrUpdateTile(
ExtendedData, uri);
}
}
您是否嘗試過使用標準磁貼信息而不是Telerik? – 2012-07-05 15:49:34
我沒有看到你開始你的應用程序的位置。 – 2012-07-05 15:53:04
@ShawnKendrot:不,我需要Telerik,因爲它可以讓我創建自定義圖塊。 – Marco 2012-07-05 15:55:02