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