/// <summary> /// Load text file /// </summary> /// <param name="path">Path to text file</param> private void LoadText(string path) { FileStream file = new FileStream(path, FileMode.Open, FileAccess.Read); StreamReader reader = new StreamReader(file, Encoding.GetEncoding("windows-1250"), true);//QSTN: Is the best solution for encoding problem? TextPreview tPreview = new TextPreview(); tPreview.Text = reader.ReadToEnd(); gContent.Children.Add(tPreview); }