private float GetForegroundWidth() { if (ForegroundText.Length <= 0) { return(0); } int seperator = (ForegroundText.Length) * 1; return(ForegroundText.Sum(FormatFront.GetCharWidth) + seperator); }
/// <summary> /// Creates a tile and pins it to the users screen /// </summary> /// <param name="tileId">The ID for the tile</param> /// <param name="tileTitle">The title that will appear on the tile</param> /// <param name="tileParam">Any params that will be passed to the app on launch</param> /// <param name="tileImage">Uri to image for the background</param> /// <param name="tileForeground">Text to display on tile</param> /// <returns></returns> public static async Task <bool> CreateTileAsync(string tileId, string tileTitle, string tileParam, Uri tileImage, ForegroundText tileForeground) { // Check if the tile already exists if (IsTilePinned(tileId)) { return(false); } await new PinTileDialog(tileId, tileTitle, tileParam, tileImage).ShowAsync(); return(true); }
/// <summary> /// Creates a tile and pins it to the users screen /// </summary> /// <param name="tileId">The ID for the tile</param> /// <param name="tileTitle">The title that will appear on the tile</param> /// <param name="tileParam">Any params that will be passed to the app on launch</param> /// <param name="tileImage">Uri to image for the background</param> /// <param name="tileForeground">Text to display on tile</param> /// <returns></returns> public static async Task <bool> CreateTileAsync(string tileId, string tileTitle, string tileParam, Uri tileImage, ForegroundText tileForeground) { // Check if the tile already exists if (IsTilePinned(tileId)) { return(false); } await NavigationService.Current.CallDialogAsync <PinTileDialog>(tileId, tileTitle, tileParam, tileImage); return(true); }
public TileProperties( Color background, Color foreground, ForegroundText foregroundText ) { Background = background; Foreground = new SolidColorBrush( foreground ); ForegroundText = foregroundText; }