void FileStreamingCompleted(object sender, FileStreamingCompletedEventArgs e)
{
IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication();
FontSource objFontSource;
using (IsolatedStorageFileStream fs = new IsolatedStorageFileStream
("Font.ttf",System.IO.FileMode.Create, file))
{
fs.Write(e.Result.byteArray, 0, e.Result.byteArray.Length);
}
using (IsolatedStorageFileStream fileStream = file.OpenFile("Font.ttf",
FileMode.Open, FileAccess.Read))
{
StreamReader reader = new StreamReader(fileStream);
objFontSource = new FontSource(reader.BaseStream);
MyTextBlock.FontFamily = new FontFamily("Font Name");
MyTextBlock.FontSource = objFontSource;
}
MyTextBlock.Text = "Changed Font";
}
Comments
Post a Comment