/// <summary> /// Alternative contructor. Creates the Form and also load it's data using table '' Primary key. /// </summary> public FormWPFCustomers(WPFConfig config, string CustomerID, Frame mainFrame) { this.config = config; this.FrameMainWindow = mainFrame; dataConnection = new WPFCustomersDB(config); string error = null; CustomersDataContext = dataConnection.GetDataContext(CustomerID, out error); DataContext = CustomersDataContext; InitializeComponent(); }
/// <summary> /// Default constructor. /// </summary> /// <param name="config">Default config object</param> public FormWPFCustomers(WPFConfig config) { this.config = config; dataConnection = new WPFCustomersDB(config); string error = null; CustomersDataContext = dataConnection.GetEmptyDataContext(out error); if (error != null) { MessageBox.Show(error); } DataContext = CustomersDataContext; InitializeComponent(); }
public ListWPFCustomers(WPFConfig config, bool loadGrid, Frame mainFrame) { this.config = config; this.FrameMainWindow = mainFrame; if (config.connectionType == WPFConfig.ConnectionType.REST) { dataConnection = new WPFCustomersRest(config); } else { dataConnection = new WPFCustomersDB(config); } InitializeComponent(); if (loadGrid) { LoadGrid(); } txtFilter.KeyDown += new KeyEventHandler(btnFilterKeyDown); }