This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ToastService | |
{ | |
public static void ShowToastNotification(String message) | |
{ | |
ToastTemplateType toastTemplate = ToastTemplateType.ToastImageAndText01; | |
XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate); | |
// Set Text | |
XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text"); | |
toastTextElements[0].AppendChild(toastXml.CreateTextNode(message)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<StackPanel Margin="12" VerticalAlignment="Center"> | |
<TextBox x:Name="MyTextBox"/> | |
<Button Content="Toast" HorizontalAlignment="Stretch" Click="ButtonBase_OnClick"/> | |
</StackPanel> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async void SaveThumbnail(StorageFile videofile, string thumbnailfilename) | |
{ | |
var thumbnail = await videofile.GetThumbnailAsync(ThumbnailMode.VideosView); | |
var saveFile = await ApplicationData.Current.LocalFolder.CreateFileAsync(thumbnailfilename, CreationCollisionOption.GenerateUniqueName); | |
var inputBuffer = new Windows.Storage.Streams.Buffer(2048); | |
using (var destFileStream = await saveFile.OpenAsync(FileAccessMode.ReadWrite)) | |
{ | |
IBuffer buf; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<BitmapImage> FetchThumbnail(StorageFile videofile) | |
{ | |
//Fetching the thumbnail in form of StorageItemThumbnail | |
var thumbnail = await videofile.GetThumbnailAsync(ThumbnailMode.VideosView); | |
var inputBuffer = new Windows.Storage.Streams.Buffer(2048); | |
IBuffer buf; | |
IRandomAccessStream stream=new InMemoryRandomAccessStream(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async void CopyFileToFolder(StorageFile filetoCopy, StorageFolder folder) | |
{ | |
await filetoCopy.CopyAsync(folder); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async void CopyFile(StorageFile fileToCopy,StorageFile filetoReplace) | |
{ | |
await fileToCopy.CopyAndReplaceAsync(filetoReplace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<string> GetFileSize(StorageFile file) | |
{ | |
var basicProperties = await file.GetBasicPropertiesAsync(); | |
var length = basicProperties.Size; | |
return Calculatesize(length); | |
} | |
public string Calculatesize(double sizeInBytes) | |
{ | |
const double terabyte = 1099511627776; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Windows.Storage; | |
using SQLite; |