|
// Author: Brian Kircher
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.ComponentModel;
using com.infobright.utility.BrighthouseCompressionViewer.ViewModel;
namespace com.infobright.utility.BrighthouseCompressionViewer.Controls
{
/// <summary>
/// Interaction logic for ConnectDialog.xaml
/// </summary>
public partial class ConnectDialog : Window
{
private DatabaseConnectionViewModel _viewModel = null;
public ConnectDialog()
{
InitializeComponent();
}
/// <summary>
/// Handles the window load event.
/// </summary>
/// <param name="sender">the sender</param>
/// <param name="e">the argument</param>
private void Window_Loaded(object sender, RoutedEventArgs e)
{
if (DesignerProperties.GetIsInDesignMode(this))
{
return;
}
else
{
_viewModel = new DatabaseConnectionViewModel();
this.DataContext = _viewModel;
}
}
/// <summary>
/// Handles a connection button click.
/// </summary>
/// <param name="sender">the sender</param>
/// <param name="e">the arguments</param>
private void btnConnect_Click(object sender, RoutedEventArgs e)
{
_viewModel.Connect(null);
if (_viewModel.IsConnected)
{
DialogResult = true;
this.Close();
}
else
{
MessageBox.Show(this, _viewModel.ConnectionError, "Connection Error");
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.