Esempio n. 1
0
        private void EnableSearch()
        {
            VideosSearchDataProvider searchDataProvider   = new VideosSearchDataProvider((IEnumerable <VideoHeader>) this.ViewModel.AllVideosVM.Collection);
            DataTemplate             dataTemplate         = (DataTemplate)((FrameworkElement)this).Resources["VideoTemplate2"];
            Action <object, object>  selectedItemCallback = new Action <object, object>(this.HandleSearchSelectedItem);
            Action <string>          textChangedCallback  = (Action <string>)(searchString =>
            {
                ((UIElement)this.mainPivot).Visibility = (searchString != "" ? Visibility.Collapsed : Visibility.Visible);
                this._searchQuery = searchString;
            });
            DataTemplate itemTemplate = dataTemplate;
            Thickness?   margin       = new Thickness?(new Thickness(0.0, 77.0, 0.0, 0.0));

            GenericSearchUC.CreatePopup <VKClient.Common.Backend.DataObjects.Video, VideoHeader>((ISearchDataProvider <VKClient.Common.Backend.DataObjects.Video, VideoHeader>)searchDataProvider, selectedItemCallback, textChangedCallback, itemTemplate, (Func <SearchParamsUCBase>)(() => (SearchParamsUCBase) new SearchParamsVideoUC()), margin).Show((UIElement)this.mainPivot);
        }
Esempio n. 2
0
        private void AppBarSearchButton_OnClicked(object sender, EventArgs e)
        {
            DocumentsSearchDataProvider searchDataProvider = new DocumentsSearchDataProvider((IEnumerable <DocumentHeader>) this.ViewModel.CurrentSection.Items.Collection);
            DataTemplate            dataTemplate           = (DataTemplate)base.Resources["ItemTemplate"];
            Action <object, object> selectedItemCallback   = (Action <object, object>)((p, f) => this.List_OnSelectionChanged(p, null));
            Action <string>         textChangedCallback    = (Action <string>)(searchString => ((UIElement)this.list).Visibility = (searchString != "" ? Visibility.Collapsed : Visibility.Visible));
            DataTemplate            itemTemplate           = dataTemplate;
            // ISSUE: variable of the null type

            Thickness?    margin       = new Thickness?(new Thickness(0.0, 77.0, 0.0, 0.0));
            DialogService popup        = GenericSearchUC.CreatePopup <Doc, DocumentHeader>((ISearchDataProvider <Doc, DocumentHeader>)searchDataProvider, selectedItemCallback, textChangedCallback, itemTemplate, null, margin);
            EventHandler  eventHandler = (EventHandler)((o, args) => ((UIElement)this.list).Visibility = Visibility.Visible);

            popup.Closing += eventHandler;
            Grid gridContent = this.gridContent;

            popup.Show((UIElement)gridContent);
        }