コード例 #1
0
        private async void Filter_Click(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
        {
            fly.Hide();
            int index = 0;

            foreach (var subject in StudentData.subjects)
            {
                if (subject.Name == StudentData.SelectedSubject.Name)
                {
                    break;
                }
                index += 1;
            }

            var dialog = new FilterDialog(StudentData.subjects[index].CatagoryList, StudentData.subjects[index].Peroids);
            await dialog.ShowAsync();

            StudentData.AssignmentFilterParam = dialog.Result;
            if (StudentData.AssignmentFilterParam == null)
            {
                StudentData.AssignmentFilterParam = new Dictionary <string, string> {
                    { "time", null },
                    { "cata", null }
                };
            }
            Init();

            // InitializeComponent();
        }
コード例 #2
0
        internal void CallFilterDialog(View anchor, Activity context)
        {
            FilterDialog d = tableModel.GetFilterView(context, anchor);

            PopupWindow w = d.GetView();

            w.ShowAsDropDown(anchor);
            w.OutsideTouchable = true;
            w.Touchable        = true;
            w.SetBackgroundDrawable(new BitmapDrawable());
        }
コード例 #3
0
    private async Task <FilterOptions?> GetOptionsAsync()
    {
        IHierarchyProvider hierarchyProvider;
        IExtensionSettings settings;
        TextFilterFactory  textFilterFactory;
        Func <Task <IEnumerable <IHierarchyNode> > > hierarchyFactory;


        await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

        hierarchyProvider = await VS.GetRequiredServiceAsync <IHierarchyProvider, IHierarchyProvider>();

        settings = await VS.GetRequiredServiceAsync <IExtensionSettings, IExtensionSettings>();

        textFilterFactory = await CreateTextFilterFactoryAsync();

        hierarchyFactory = async() => await hierarchyProvider.GetHierarchyAsync();

        using (var vm = new FilterDialogViewModel(hierarchyFactory, Debouncer.Create, textFilterFactory, Package.JoinableTaskFactory)) {
            FilterDialog dialog;
            bool         result;


            await settings.LoadAsync();

            vm.LoadProjectDependencies = settings.LoadProjectDependencies;
            vm.UseRegularExpressions   = settings.UseRegularExpressions;

            dialog = new FilterDialog {
                DataContext = vm
            };

            result = dialog.ShowModal().GetValueOrDefault();

            settings.LoadProjectDependencies = vm.LoadProjectDependencies;
            settings.UseRegularExpressions   = vm.UseRegularExpressions;
            await settings.SaveAsync();

            if (result)
            {
                return(vm.Result);
            }
        }

        return(null);
    }
コード例 #4
0
        /// <summary>
        /// Event handler when the user clicks the "filter" button.
        /// Opens a <see cref="Dialogs.FilterDialog"/> and applies filtering changes as necessary.
        /// </summary>
        /// <param name="sender">the sender of this event</param>
        /// <param name="e">the event arguments of this event</param>
        private void FilterButton_OnClick(object sender, RoutedEventArgs e)
        {
            var filterDialog = new FilterDialog(filter)
            {
                Owner = this
            };
            var dialogResult = filterDialog.ShowDialog();

            // Throw exception now if debugging was detected at login
            if (isDebugged)
            {
                throw new InvalidCastException();
            }

            if (dialogResult == true)
            {
                ClearFilterButtonActive = true;

                UpdateData();
            }
        }
コード例 #5
0
 public void HookView(FilterDialog f)
 {
     f.Init(tableModel.Filters, tableModel.Columns);
 }