Archived
1
0

App UI development

Updated and enchanced MainPage
Updated Core
This commit is contained in:
Michael Gordeev
2020-05-12 01:32:41 +03:00
parent f89bf80018
commit a792132428
54 changed files with 2684 additions and 1479 deletions
+16
View File
@@ -6,7 +6,9 @@ using System.IO;
using System.Linq;
using System.Threading;
using System.Xml;
using Windows.Devices.PointOfService;
using Windows.UI;
using Windows.UI.Xaml.Media.Imaging;
namespace FoxTube
{
@@ -39,6 +41,9 @@ namespace FoxTube
public static bool Belongs<T>(this T obj, params T[] args) =>
args.Contains(obj);
public static bool Belongs(this int number, int lowerLimit, int upperLimit) =>
number >= lowerLimit && number <= upperLimit;
public static string ToHex(this Color color) =>
$"#{color.R:X}{color.G:X}{color.B:X}";
@@ -57,6 +62,17 @@ namespace FoxTube
};
}
public static BitmapImage LoadImage (this BitmapImage image, string source, int? height = null, int? width = null)
{
image.UriSource = source.ToUri();
if (height.HasValue)
image.DecodePixelHeight = height.Value;
if (width.HasValue)
image.DecodePixelWidth = width.Value;
return image;
}
public static TimeSpan GetDuration(this string rawDuration)
{
try