7.8 SDK 終于出了(下載:http://www.cnblogs.com/sun8134/archive/2013/01/23/2872562.html)
可惜一個api都木有…
唯一增加的就是tile的變化
詳細見MSDN文檔:http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj720574(v=vs.105).aspx
Supported features
?
A Windows Phone OS 7.1 app that runs on Windows Phone 8 or Windows Phone 7.8 supports the following Tile features:
For the default Tile, the flip Tile is the only supported template. For more information about this template, see Flip Tile template for Windows Phone 8.
For secondary Tiles, all Tile templates are supported: Flip Tile template for Windows Phone 8, Iconic Tile template for Windows Phone 8, and Cycle Tile template for Windows Phone 8.
Independently update the small and medium Tile sizes. You can also optionally support the wide Tile size.
You can use both push notifications and the ShellTile APIs to update Tiles.
默認的Tile只支持Flip Tile 我們來看看實現的效果吧:
?
首先要看下Flip Tile的結構,還是看MSDN文檔吧:http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206971(v=vs.105).aspx
?
下面準備需要的圖片,大小分別為159*159,336*336,691*336
還有一張對應wp7.5的173*173
?
然后開始code,第一步搖先判斷版本,是否為7.8
//設定版本 private static Version TargetedVersion = new Version(7, 10, 8858); ? //判斷是否滿足版本要求 public static bool isTargetedVersion { get { return Environment.OSVersion.Version >= TargetedVersion; } }?
如果大約等于7.8,則替換默認tile為Flip Tile:
ShellTile appTile = ShellTile.ActiveTiles.First(); // Get the new FlipTileData type. Type flipTileDataType = Type.GetType("Microsoft.Phone.Shell.FlipTileData, Microsoft.Phone"); ? // Get the ShellTile type so we can call the new version of "Update" that takes the new Tile templates. Type shellTileType = Type.GetType("Microsoft.Phone.Shell.ShellTile, Microsoft.Phone"); ? // Loop through any existing Tiles that are pinned to Start. //var tileToUpdate = ShellTile.ActiveTiles.First(); ? ? // Get the constructor for the new FlipTileData class and assign it to our variable to hold the Tile properties. var UpdateTileData = flipTileDataType.GetConstructor(new Type[] { }).Invoke(null); ? // Set the properties. SetProperty(UpdateTileData, "Title", "Main Tile Title"); SetProperty(UpdateTileData, "Count", 0); SetProperty(UpdateTileData, "BackTitle", "Back Tile Title"); SetProperty(UpdateTileData, "BackContent", "Content For back tile."); SetProperty(UpdateTileData, "SmallBackgroundImage", new Uri("Windows 8 59.png", UriKind.Relative)); SetProperty(UpdateTileData, "BackgroundImage", new Uri("Windows 8 336.png", UriKind.Relative)); SetProperty(UpdateTileData, "BackBackgroundImage", new Uri("", UriKind.Relative)); SetProperty(UpdateTileData, "WideBackgroundImage", new Uri("Windows 8 691.png", UriKind.Relative)); SetProperty(UpdateTileData, "WideBackBackgroundImage", new Uri("", UriKind.Relative)); SetProperty(UpdateTileData, "WideBackContent", "Content for Wide Back Tile. Lots more text here."); ? // Invoke the new version of ShellTile.Update. shellTileType.GetMethod("Update").Invoke(appTile, new Object[] { UpdateTileData });設定Flip Tile屬性的方法:
private static void SetProperty(object instance, string name, object value) { var setMethod = instance.GetType().GetProperty(name).GetSetMethod(); setMethod.Invoke(instance, new object[] { value }); }另外在英文的MSDN文檔(http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj720574(v=vs.105).aspx)里要求修改WMAppManifest.xml,添加AppExtra節點:
而且說明添加后在vs2010里會編譯報錯,只有VS2012才能順利通過,如果在vs2010中使用的話需要先編譯生成xap,然后解壓出WMAppManifest.xml,修改后再重新打包進去…
但是這段說明在中文版的MSDN文檔(http://msdn.microsoft.com/zh-cn/library/windowsphone/develop/jj720574(v=vs.105).aspx)里被刪除了
而且我在vs2010中測試那段代碼加和不加沒什么區別…難道是beta版的時候的要求么?
?
最后看看效果:
?
源碼:
?
?
參考:
http://msdn.microsoft.com/zh-cn/library/windowsphone/develop/jj720574(v=vs.105).aspx
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj720574(v=vs.105).aspx
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206971(v=vs.105).aspx
http://blogs.msdn.com/b/lmoroney/archive/2013/01/28/create-a-windows-phone-7-flip-tile-and-update-it-to-windows-phone-8-style-using-the-windows-phone-7-8-sdk.aspx
轉載于:https://www.cnblogs.com/sun8134/archive/2013/02/04/2892421.html
本文由 貴州做網站公司 整理發布,部分圖文來源于互聯網,如有侵權,請聯系我們刪除,謝謝!
c語言中正確的字符常量是用一對單引號將一個字符括起表示合法的字符常量。例如‘a’。數值包括整型、浮點型。整型可用十進制,八進制,十六進制。八進制前面要加0,后面...
2022年天津專場考試原定于3月19日舉行,受疫情影響確定延期,但目前延期后的考試時間推遲。 符合報名條件的考生,須在規定時間登錄招考資訊網(www.zha...
:喜歡聽,樂意看。指很受歡迎?!巴卣官Y料”喜聞樂見:[ xǐ wén lè jiàn ]詳細解釋1. 【解釋】:喜歡聽,樂意看。指很受歡迎。2. 【示例】:這是...
在股市中,尤其使一些老的股民,一定會發現有很多的k線圖,如果不了解,就會覺得無從下手,看的會有些眼花繚亂,只有很好的了解這些k線圖,才可以從中看出股市的發展趨勢和走向。那么什么是道指k線圖呢?道指k線圖又代表著什么呢?怎么看道指k線圖呢?下面就這些相關的問題給大家介紹一下吧。首先給大家介紹什么是道指k線圖呢?道指k線圖指的是股票在交易日的一天內的變化情況,從k線圖上可以了解股票的發展的趨勢和走向,...
周鴻祎不知道畢業生工資多少什么情況?周鴻祎不知道畢業生工資是來源于360公司的校招會上,周鴻祎表示已經不清楚應屆生的月工資了,甚至問有沒有幾萬塊錢。“幾萬塊錢?一個月?”現場的同學們只能用笑聲來回應。在校招會上還表示自己剛畢業的時候找工作也會對比哪一個工資比較高,之后就去找到這個工作。為了強調工資的重要性,周鴻祎舉了個例子,“你說你在我面前扔一張100塊錢的紙幣...
#標題創作挑戰#從2009年開始,安徽衛視引進了《天使之爭》、《愛在路上》、《一個承諾》、《丘比特的陷阱》、《鉆石之戰》、《愛的漣漪》、《愛的被告》、《旋轉的愛》、《真愛無價》等經典泰劇。,在國內引起了追劇熱潮,培養了大批忠實的泰劇粉絲。近年來,泰國腐劇發展迅速,但傳統泰劇在中國的影響力卻大不如前。不過最近有一部泰劇,是《虎玫瑰先生》?!痘⒚倒逑壬分约t,不是憑借精良的制作和精彩的劇情,而是先...