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