1
0
mirror of synced 2024-11-15 01:33:51 +00:00
PettingZoo/View/ConnectionWindow.xaml.cs

36 lines
870 B
C#
Raw Normal View History

2016-06-18 14:50:32 +00:00
using System.Windows;
using PettingZoo.Model;
using PettingZoo.ViewModel;
namespace PettingZoo.View
{
public class WindowConnectionInfoBuilder : IConnectionInfoBuilder
{
public ConnectionInfo Build()
{
2016-06-18 18:30:12 +00:00
var viewModel = new ConnectionViewModel();
2016-06-18 14:50:32 +00:00
var dialog = new ConnectionWindow(viewModel)
{
Owner = Application.Current.MainWindow
};
if (!dialog.ShowDialog().GetValueOrDefault())
return null;
return viewModel.ConnectionInfo;
}
}
public partial class ConnectionWindow : Window
{
2016-06-18 18:30:12 +00:00
public ConnectionWindow(ConnectionViewModel viewModel)
2016-06-18 14:50:32 +00:00
{
2016-06-18 18:30:12 +00:00
WindowStartupLocation = WindowStartupLocation.CenterOwner;
2016-06-18 14:50:32 +00:00
InitializeComponent();
DataContext = viewModel;
}
}
}