public CommonFilterDlg(IBaseWindow baseWin, IListManager listMan) : this() { if (baseWin == null) { throw new ArgumentNullException("baseWin"); } if (listMan == null) { throw new ArgumentNullException("listMan"); } fBase = baseWin; fListMan = listMan; fController = new CommonFilterDlgController(this, listMan); fController.Init(baseWin); filterView = new FilterGridView(fListMan); filterView.Height = 260; tsFieldsFilter.Content = filterView; SetLang(); fController.UpdateView(); this.KeyDown += Form_KeyDown; }
public CommonFilterDlg(IBaseWindow baseWin, IListManager listMan) : this() { if (baseWin == null) { throw new ArgumentNullException("baseWin"); } if (listMan == null) { throw new ArgumentNullException("listMan"); } fBase = baseWin; fListMan = listMan; fController = new CommonFilterDlgController(this, listMan); fController.Init(baseWin); filterView = new FilterGridView(fListMan); filterView.Dock = DockStyle.Fill; filterView.Name = "dataGridView1"; tsFieldsFilter.Controls.Add(filterView); SetLang(); fController.UpdateView(); }
/// <summary> /// The methods provided in this section are simply used to allow /// NavigationHelper to respond to the page's navigation methods. /// <para> /// Page specific logic should be placed in event handlers for the /// <see cref="NavigationHelper.LoadState"/> /// and <see cref="NavigationHelper.SaveState"/>. /// The navigation parameter is available in the LoadState method /// in addition to page state preserved during an earlier session. /// </para> /// </summary> /// <param name="e">Provides data for navigation methods and event /// handlers that cannot cancel the navigation request.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { _navigationHelper.OnNavigatedTo(e); FilterGridView.DataContext = FilterDefinitions.FilterItemList; if (_tempList == null || FilterGridView.Items == null) { return; } FilterGridView.SelectionChanged -= OnGridViewSelectionChanged; // Restore the previous selection of filters foreach (var listItem in from filter in _tempList.Cast <FilterItem>() from listItem in FilterGridView.Items.Cast <FilterItem>() where listItem.Name == filter.Name select listItem) { FilterGridView.SelectedItems.Add(listItem); } FilterGridView.SelectionChanged += OnGridViewSelectionChanged; if (_itemBeingEdited != null) { FilterGridView.ScrollIntoView(_itemBeingEdited); _itemBeingEdited = null; } CheckIfApplyButtonShouldBeEnabled(); #if WINDOWS_PHONE_APP HardwareButtons.BackPressed += OnBackPressed; #endif }