XIVChat/XIVChat Desktop/ConnectDialog.xaml.cs

40 lines
975 B
C#
Raw Normal View History

using System.Windows;
2020-11-01 01:31:10 +00:00
namespace XIVChat_Desktop {
/// <summary>
/// Interaction logic for ConnectDialog.xaml
/// </summary>
public partial class ConnectDialog {
public App App => (App)Application.Current;
2020-11-14 20:09:23 +00:00
public ConnectDialog(Window owner) {
this.Owner = owner;
2020-11-01 01:31:10 +00:00
this.InitializeComponent();
this.DataContext = this;
}
private void Connect_Clicked(object? sender, RoutedEventArgs e) {
this.ConnectTo(this.Servers.SelectedServer);
}
private void Cancel_Click(object? sender, RoutedEventArgs e) {
this.Close();
}
private void Servers_ItemDoubleClick(SavedServer? server) {
this.ConnectTo(server);
}
private void ConnectTo(SavedServer? server) {
if (server == null) {
return;
}
2021-01-24 23:46:01 +00:00
this.App.Connect(server);
2020-11-01 01:31:10 +00:00
this.Close();
}
}
}