2012-12-19 2 views

답변

7

XNA는 WP7 앱에서만 지원되므로 앱이 WP8에서 실행되는지 확인해야하며, 그렇다면 리플렉션을 사용하여 타일을 WP8 아이콘으로 업데이트해야합니다. 이 코드 조각이이 MSDN 기사에서 어떻게 보이는지에 대한 좋은 예가 있습니다. WP8과 비슷한 API가 내장 된 라이브러리를 사용하는 것이 더 쉬울 수도 있습니다. 여기에 WP8 API를 http://mangopollo.codeplex.com/SourceControl/changeset/view/100687#2023247

@ WP7에서 호출하는 랩 소스 코드는 그리고 여기 WP7 애플리케이션에 WP8 넓은 타일을 사용하는 Mangopollo 코드입니다 :

if (!Utils.CanUseLiveTiles) 
{ 
    MessageBox.Show("This feature needs Windows Phone 8"); 
    return; 
} 

try 
{ 
    var mytile = new FlipTileData 
    { 
     Title = "wide flip tile", 
     BackTitle = "created by", 
     BackContent = "Rudy Huyn", 
     Count = 9, 
     SmallBackgroundImage = new Uri("/Assets/logo159x159.png", UriKind.Relative), 
     BackgroundImage = new Uri("/Assets/Background336x336_1.png", UriKind.Relative), 
     BackBackgroundImage = new Uri("/Assets/Background336x336_2.png", UriKind.Relative), 
     WideBackContent = "This is a very long long text to demonstrate the back content of a wide flip tile", 
     WideBackgroundImage = new Uri("/Assets/Background691x336_1.png", UriKind.Relative), 
     WideBackBackgroundImage = new Uri("/Assets/Background691x336_2.png", UriKind.Relative) 
    }; 

#if ALTERNATIVE_SOLUTION 
    var mytile = Mangopollo.Tiles.TilesCreator.CreateFlipTile("flip tile", 
    "created by", "Rudy Huyn", 
    "This is a very long long text to demonstrate the back content of a wide flip tile", 
    9, new Uri("/Assets/logo159x159.png", UriKind.Relative), 
    new Uri("/Assets/Background336x336_1.png", UriKind.Relative), 
    new Uri("/Assets/Background336x336_2.png", UriKind.Relative), 
    new Uri("/Assets/Background691x336_1.png", UriKind.Relative), 
    new Uri("/Assets/Background691x336_2.png", UriKind.Relative)); 
#endif 
    ShellTileExt.Create(new Uri("/MainPage.xaml?msg=from%20wipe%20flip%20tile", 
     UriKind.Relative), mytile, true); 
} 
catch 
{ 
    MessageBox.Show("remove tile before create it again"); 
} 

기억해야 할 한 가지 더 다른 점이다 XNA 응용 프로그램이 WP7 응용 프로그램 인 경우에도 WP8 API는 XNA에서 직접 사용할 수 있습니다. 다음은 use WP8 in-app purhcase on WP7 apps (XNA 포함)에 대한 예입니다. 다음은 how to use new WP8 Launchers & Choosers in WP7 apps의 예입니다 (아래로 스크롤).

+0

위의 코드 스 니펫의 마지막 문장은 Mangopollo 예제 앱에서 Uri of MainPage.xaml을 사용하여 앱을 시작합니다. Uri이 XNA 게임에 사용되어야하는 것은 무엇입니까? –

관련 문제