public void UpdateTextFromFile() { var text = string.Join(Environment.NewLine, File.ReadLines(Conf.timespentFile).Reverse()); Doc.Blocks.Clear(); Doc.Blocks.Add(new Paragraph(new Run(text))); MainText.Focus(); MainText.ScrollToHome(); }
public MainWindow() { InitializeComponent(); progSetting = Convert.ToInt32(txtProgTimer.Text); countSetting = Convert.ToInt32(txtCountdown.Text); progCurrent = progSetting; countCurrent = countSetting; RunningTimer = new DispatcherTimer { Interval = new TimeSpan(10_000_000) // 10 million ticks = 1 second }; RunningTimer.Tick += new EventHandler(OnTick); running = false; complete = false; SaveButton.IsEnabled = false; safetext = ""; MainText.Focus(); }