Exemplo n.º 1
0
        /// <summary>
        /// Creates a new secondary tile.
        /// </summary>
        /// <param name="navigationUri"><see cref="Uri"/> for the tile being created. The <see cref="Uri"/> can contain custom launch parameters.</param>
        /// <param name="initialTileData">Text and image information for the tile being created.</param>
        /// <param name="supportsWideTile">true if the wide tile size is supported; otherwise, false.</param>
        public override void Create(Uri navigationUri, IShellTileServiceTileData initialTileData, bool supportsWideTile)
        {
            var shellTileServiceTileDataBase = initialTileData as ShellTileServiceTileDataBase;

            if (shellTileServiceTileDataBase == null)
            {
                throw new ArgumentException("A ShellTileServiceTileDataBase instance is expected.", "initialTileData");
            }
            ShellTile.Create(navigationUri, shellTileServiceTileDataBase.ToShellTileData(), supportsWideTile);
        }
        /// <summary>
        /// Updates an Application Tile or secondary Tile.
        /// </summary>
        /// <param name="data">New text and image data for the tile.</param>
        public void Update(IShellTileServiceTileData data)
        {
            var shellTileServiceTileDataBase = data as ShellTileServiceTileDataBase;

            if (shellTileServiceTileDataBase == null)
            {
                throw new ArgumentException("A ShellTileServiceTileDataBase instance is expected.", "data");
            }

            _shellTile.Update(shellTileServiceTileDataBase.ToShellTileData());
        }
        /// <summary>
        /// Updates an Application Tile or secondary Tile.
        /// </summary>
        /// <param name="data">New text and image data for the tile.</param>
        public void Update(IShellTileServiceTileData data)
        {
            var shellTileServiceTileDataBase = data as ShellTileServiceTileDataBase;

            if (shellTileServiceTileDataBase == null)
            {
                throw new ArgumentException("A ShellTileServiceTileDataBase instance is expected.", "data");
            }

            _shellTile.Update(shellTileServiceTileDataBase.ToShellTileData());
        }
Exemplo n.º 4
0
        /// <summary>
        /// Creates a new secondary tile.
        /// </summary>
        /// <param name="navigationUri"><see cref="Uri"/> for the tile being created. The <see cref="Uri"/> can contain custom launch parameters.</param>
        /// <param name="initialTileData">Text and image information for the tile being created.</param>
        /// <param name="supportsWideTile">true if the wide tile size is supported; otherwise, false.</param>
        public override void Create(Uri navigationUri, IShellTileServiceTileData initialTileData, bool supportsWideTile)
        {
            var shellTileServiceTileDataBase = initialTileData as ShellTileServiceTileDataBase;

            if (shellTileServiceTileDataBase == null)
            {
                throw new ArgumentException("A ShellTileServiceTileDataBase instance is expected.", "initialTileData");
            }
#if WP8
            ShellTile.Create(navigationUri, shellTileServiceTileDataBase.ToShellTileData(), supportsWideTile);
#else
            if (LiveTilesSupported)
            {
                var shellTileType = Type.GetType("Microsoft.Phone.Shell.ShellTile, Microsoft.Phone");
                var createmethod  = shellTileType.GetMethod("Create", new[] { typeof(Uri), typeof(ShellTileData), typeof(bool) });

                createmethod.Invoke(null, new object[] { navigationUri, shellTileServiceTileDataBase.ToShellTileData(), supportsWideTile });
            }
            else
            {
                ShellTile.Create(navigationUri, shellTileServiceTileDataBase.ToShellTileData());
            }
#endif
        }
        /// <summary>
        /// Creates a new secondary tile.
        /// </summary>
        /// <param name="navigationUri"><see cref="Uri"/> for the tile being created. The <see cref="Uri"/> can contain custom launch parameters.</param>
        /// <param name="initialTileData">Text and image information for the tile being created.</param>
        /// <param name="supportsWideTile">true if the wide tile size is supported; otherwise, false.</param>
        public override void Create(Uri navigationUri, IShellTileServiceTileData initialTileData, bool supportsWideTile)
        {
            var shellTileServiceTileDataBase = initialTileData as ShellTileServiceTileDataBase;

            if (shellTileServiceTileDataBase == null)
            {
                throw new ArgumentException("A ShellTileServiceTileDataBase instance is expected.", "initialTileData");
            }
            #if WP8
            ShellTile.Create(navigationUri, shellTileServiceTileDataBase.ToShellTileData(), supportsWideTile);
            #else
            if (LiveTilesSupported)
            {
                var shellTileType = Type.GetType("Microsoft.Phone.Shell.ShellTile, Microsoft.Phone");
                var createmethod = shellTileType.GetMethod("Create", new[] { typeof(Uri), typeof(ShellTileData), typeof(bool) });

                createmethod.Invoke(null, new object[] { navigationUri, shellTileServiceTileDataBase.ToShellTileData(), supportsWideTile });
            }
            else
            {
                ShellTile.Create(navigationUri, shellTileServiceTileDataBase.ToShellTileData());
            }
            #endif
        }
 /// <summary>
 /// Creates a new secondary tile.
 /// </summary>
 /// <param name="navigationUri"><see cref="Uri"/> for the tile being created. The <see cref="Uri"/> can contain custom launch parameters.</param>
 /// <param name="initialTileData">Text and image information for the tile being created.</param>
 /// <param name="supportsWideTile">true if the wide tile size is supported; otherwise, false.</param>
 public virtual void Create(Uri navigationUri, IShellTileServiceTileData initialTileData, bool supportsWideTile)
 {
     throw new NotSupportedException("To use this method, add Cimbalino.Phone.Toolkit assembly to the project and use the ShellTileWithCreateService instead. This method can't be called from a Background Agent.");
 }
Exemplo n.º 7
0
        private static void UpdateTile(IShellTileServiceTileData shellData)
        {
            var primaryTile = ShellTileService.ActiveTiles.First();

            primaryTile.Update(shellData);
        }
 /// <summary>
 /// Creates a new secondary tile.
 /// </summary>
 /// <param name="navigationUri"><see cref="Uri"/> for the tile being created. The <see cref="Uri"/> can contain custom launch parameters.</param>
 /// <param name="initialTileData">Text and image information for the tile being created.</param>
 /// <param name="supportsWideTile">true if the wide tile size is supported; otherwise, false.</param>
 public virtual void Create(Uri navigationUri, IShellTileServiceTileData initialTileData, bool supportsWideTile)
 {
     throw new NotImplementedException("To use this method, add Cimbalino.Phone.Toolkit assembly to the project and use the ShellTileWithCreateService instead. This method can't be called from a Background Agent.");
 }