void OnSettingsWindowRequested(object sender, EventArgs args) { Window.IsSettingsButtonEnabled = false; var settings = new SettingsWindowModel(this); settings.Closing += (o, eventArgs) => Window.IsSettingsButtonEnabled = true; settings.Show(); }
public StartListeningWindowModel(SettingsWindowModel context) { Context = context; Context.Closing += OnContextClosing; Window = new StartListeningWindow(); Window.StartListeningRequested += OnStartListeningRequested; Window.PortTextUpdated += (sender, args) => Window.IsDoneButtonEnabled = int.TryParse(args.NewText, out _); Window.Closing += OnWindowClosing; }
public ConnectWindowModel(SettingsWindowModel context) { Context = context; Context.Closing += OnContextClosing; Window = new ConnectWindow(); Window.Closing += OnWindowClosing; Window.IpTextUpdated += OnIpTextUpdated; Window.PortTextUpdated += OnPortTextUpdated; Window.ConnectionRequested += OnConnectionRequested; }