public TextFile() { //ScrollOffset = -1d; IncFontWhenPrinting = 0; Watermark = new Watermark { Size = new Size(1, 1), Opacity = 1d }; PageCountElement = new PageCountElement { FontFamily = MainWindow.Global.FindResource("defaultFont") as FontFamily, ForgroundBrush = Brushes.Black, UseLeadingZero = false }; SpellCheckEnabled = true; Styles = new ComplexStyles(); OpeningQuote = ClosingQuote = "\u0022"; SingleOpeningQuote = SingleClosingQuote = "\u0027"; ReadOnly = false; Characters = new ObservableCollection <Character>(); Characters.CollectionChanged += CharactersCollectionChanged; }
private void LoadPageCount(SerializationInfo info) { try { PageCountElement = new PageCountElement(); var name = info.GetString("FontFamilyName"); PageCountElement.FontFamily = Utilities.PossibleFonts.FirstOrDefault(f => f.Family.FamilyNames.Any(fn => fn.Value.Equals(name)))?.Family; var brush = info.GetString("ResultBrush"); PageCountElement.ForgroundBrush = (Brush)XamlReader.Parse(brush); PageCountElement.UseLeadingZero = info.GetBoolean("UseZero"); PageCountElement.FontSize = info.GetDouble("FontSize"); } catch { PageCountElement = new PageCountElement { FontFamily = Utilities.PossibleFonts[0].Family, ForgroundBrush = Brushes.Black, FontSize = 15 }; } }