Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Yoba
- {
- private readonly MainWindow _window;
- private Timer timer;
- public Yoba(MainWindow window)
- {
- _window = window;
- timer = new Timer(1000);
- timer.Elapsed += TimerOnElapsed;
- timer.Enabled = true;
- }
- private void TimerOnElapsed(object sender, ElapsedEventArgs elapsedEventArgs)
- {
- _window.Dispatcher.Invoke(UpdateTextBox);
- }
- private void UpdateTextBox()
- {
- _window.tb.Text += "yoba, eto ti?" + Environment.NewLine;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment