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