Windows phone 7 如何在windows phone 7应用程序中包含所有3种大小的磁贴

Windows phone 7 如何在windows phone 7应用程序中包含所有3种大小的磁贴,windows-phone-7,windows-phone-8,windows-phone,Windows Phone 7,Windows Phone 8,Windows Phone,我正在开发一款windows phone。中小型手机已经包括在内。我想把宽尺寸的瓷砖加进去。我如何才能做到这一点?您可以在wp7.8中包含大型互动程序,如下所示: public class CheckOSVersion { private static Version TargetedVersion; public static bool IsTargetedVersion { get { return E

我正在开发一款windows phone。中小型手机已经包括在内。我想把宽尺寸的瓷砖加进去。我如何才能做到这一点?

您可以在wp7.8中包含大型互动程序,如下所示:

   public class CheckOSVersion
    {

        private static Version TargetedVersion;

        public static bool IsTargetedVersion
        {
            get { return Environment.OSVersion.Version >= CheckOSVersion.TargetedVersion; }
        }

        static CheckOSVersion() { CheckOSVersion.TargetedVersion = new Version(7, 10, 8858); }

        private static void SetProperty(object instance, string name, object value)
        {
            MethodInfo setMethod = instance.GetType().GetProperty(name).GetSetMethod();
            object[] objArray = new object[1];
            objArray[0] = value;
            setMethod.Invoke(instance, objArray);
        }

        public static void UpdateFlipTile(string title, string backTitle, string backContent, string wideBackContent, int count, Uri tileId, Uri smallBackgroundImage, Uri backgroundImage, Uri backBackgroundImage, Uri wideBackgroundImage, Uri wideBackBackgroundImage)
        {
            try
            {
                if (CheckOSVersion.IsTargetedVersion)
                {
                    Type type = Type.GetType("Microsoft.Phone.Shell.FlipTileData, Microsoft.Phone");
                    Type type1 = Type.GetType("Microsoft.Phone.Shell.ShellTile, Microsoft.Phone");
                    foreach (ShellTile activeTile in ShellTile.ActiveTiles)
                    {
                        if (activeTile.NavigationUri.ToString() != tileId.ToString() && !activeTile.NavigationUri.ToString().Equals("/Login.xaml?flag=0"))
                        {
                            continue;
                        }
                        object obj = type.GetConstructor(new Type[0]).Invoke(null);
                        CheckOSVersion.SetProperty(obj, "Title", title);
                        CheckOSVersion.SetProperty(obj, "Count", count);
                        CheckOSVersion.SetProperty(obj, "BackTitle", backTitle);
                        CheckOSVersion.SetProperty(obj, "BackContent", backContent);
                        CheckOSVersion.SetProperty(obj, "SmallBackgroundImage", smallBackgroundImage);
                        CheckOSVersion.SetProperty(obj, "BackgroundImage", backgroundImage);
                        CheckOSVersion.SetProperty(obj, "BackBackgroundImage", backBackgroundImage);
                        CheckOSVersion.SetProperty(obj, "WideBackgroundImage", wideBackgroundImage);
                        CheckOSVersion.SetProperty(obj, "WideBackBackgroundImage", wideBackBackgroundImage);
                        CheckOSVersion.SetProperty(obj, "WideBackContent", wideBackContent);

                        object[] objArray = new object[1];
                        objArray[0] = obj;
                        type1.GetMethod("Update").Invoke(activeTile, objArray);
                        //break;
                    }
                }
            }
            catch { }
        }

        public static void CreateFlipTile(string title, string backTitle, string backContent, string wideBackContent, int count, Uri tileId, Uri smallBackgroundImage, Uri backgroundImage, Uri backBackgroundImage, Uri wideBackgroundImage, Uri wideBackBackgroundImage)
        {
            try
            {
                if (CheckOSVersion.IsTargetedVersion)
                {
                    Type type = Type.GetType("Microsoft.Phone.Shell.FlipTileData, Microsoft.Phone");
                    Type type1 = Type.GetType("Microsoft.Phone.Shell.ShellTile, Microsoft.Phone");
                    object obj = type.GetConstructor(new Type[0]).Invoke(null);
                    CheckOSVersion.SetProperty(obj, "Title", title);
                    CheckOSVersion.SetProperty(obj, "Count", count);
                    CheckOSVersion.SetProperty(obj, "BackTitle", backTitle);
                    CheckOSVersion.SetProperty(obj, "BackContent", backContent);
                    CheckOSVersion.SetProperty(obj, "SmallBackgroundImage", smallBackgroundImage);
                    CheckOSVersion.SetProperty(obj, "BackgroundImage", backgroundImage);
                    CheckOSVersion.SetProperty(obj, "BackBackgroundImage", backBackgroundImage);
                    CheckOSVersion.SetProperty(obj, "WideBackgroundImage", wideBackgroundImage);
                    CheckOSVersion.SetProperty(obj, "WideBackBackgroundImage", wideBackBackgroundImage);
                    CheckOSVersion.SetProperty(obj, "WideBackContent", wideBackContent);


                    object[] objArray = new object[1];
                    objArray[0] = obj;
                    MethodInfo createmethod = type1.GetMethod("Create", new[] { typeof(Uri), typeof(ShellTileData), typeof(bool) });
                    createmethod.Invoke(null, new object[] { tileId, obj, true });
                }
            }
            catch { }
        }
    }
Windows Phone OS 7.1和Windows Phone 8之间的关键区别 Tiles是指Windows Phone OS 7.1仅提供一个Tile模板。这 该模板称为TileTemplate5,并映射到中的翻转模板 Windows Phone 8.TileTemplate5仅提供一种尺寸,即 映射到Windows Phone 8中的中等大小

请查看此以了解更多信息

我认为您将在Windows Phone 8应用程序中添加宽磁贴。请执行以下操作。
1.打开
WMManifest.xml
文件
2.勾选对大瓷砖的支持
3.为
大[宽]磁贴选择正确的图像。