/// ------------------------------------------------------------------------------------------------ /// ------------------------------------------------------------------------------------------------ #region Private Function private void ImageShow(object sender, EventArgs e) { try { var tappedData = (Grid)sender; FilterByRequestType data = (FilterByRequestType)tappedData.BindingContext; var filterControls = tappedData.Children.ToList(); var filterByType = (Label)filterControls[1]; if (AppContext.AppContext.GetListIndex == data.index && AppContext.AppContext.CheckFilterTickImage == false) { AppData.PropertyModel.FilterByType = null; AppContext.AppContext.GetListIndex = null; AppContext.AppContext.CheckFilterTickImage = true; } else { AppData.PropertyModel.FilterByType = filterByType.Text; AppContext.AppContext.CheckFilterTickImage = false; } Gl_RequestType.BindingContext = new { filterByType.Text, IsVisible = AppContext.AppContext.GetListIndex != data.index && AppContext.AppContext.CheckFilterTickImage }; AppContext.AppContext.GetListIndex = data.index; PopupLayout.DismisPopup(); } catch (Exception ex) { LogTracking.LogTrace(ex.ToString()); } }
/// ------------------------------------------------------------------------------------------------ /// ------------------------------------------------------------------------------------------------ #region Constructor public FilterByRequest(FilterByRequestType data, PopupLayouts popupLayouts) { try { InitializeComponent(); PopupLayout = popupLayouts; BindingContext = data; var itemTapped = new TapGestureRecognizer(); itemTapped.Tapped += ImageShow; Gl_RequestType.GestureRecognizers.Add(itemTapped); } catch (Exception ex) { LogTracking.LogTrace(ex.ToString()); } }
/// ------------------------------------------------------------------------------------------------ /// ------------------------------------------------------------------------------------------------ #region Public Constructor /// <summary> /// Initializes a new instance of the <see cref="T:FilterView{T}"/> class. /// </summary> public FilterView(PopupLayouts popupLayouts) { try { InitializeComponent(); PopupLayout = popupLayouts; ChangeButton(AppData.PropertyModel.Filter); ToggleSort(AppData.PropertyModel.Sort); int index = 0; btn_Incomplete.FontSize = FontSizeView.CustomFontSizeSmSmMi; btn_Complete.FontSize = FontSizeView.CustomFontSizeSmSmMi; btn_All.FontSize = FontSizeView.CustomFontSizeSmSmMi; foreach (var item in AppData.PropertyModel.FilterTypes) { if (!String.IsNullOrEmpty(item.Value)) { _filterByRequestType = new FilterByRequestType() { Text = item.Value, IsVisible = AppContext.AppContext.GetListIndex != null && AppContext.AppContext.GetListIndex.Value == index && !AppContext.AppContext.CheckFilterTickImage, index = index, Key = item.Key }; Sl_RequestTypeList.Children.Add(new FilterByRequest(_filterByRequestType, PopupLayout)); } index++; } _isExecute = true; TapGestures(); } catch (Exception ex) { LogTracking.LogTrace(ex.ToString()); } }