App UI development
Updated and enchanced MainPage Updated Core
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user