Пример #1
0
        public void FindApp(AppGroup appGroup, string appNamePart)
        {
            if (_QuickSearchWnd == null)
            {
                _QuickSearchWnd       = new QuickSearch();
                _QuickSearchWnd.Owner = _WorkItem.MainWindow;
                _QuickSearchWnd.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                _QuickSearchWnd.SearchString          = appNamePart;
                _QuickSearchWnd.SerachStringChanged  += (s, e) => FindApp(appGroup, _QuickSearchWnd.SearchString);
                _QuickSearchWnd.Closed       += (s, e) => EndSearch();
                _QuickSearchWnd.ItemSelected += (s, e) => SearchSucceded();

                //_QuickSearchWnd.FoundItems = appGroup.FindApps(appNamePart);

                _QuickSearchWnd.Show();
                _SearchTimer.IsEnabled = true;
            }
            else
            {
                _SearchTimer.Stop();
                _SearchTimer.Start();

                //var apps = _QuickSearchWnd.FoundItems as AppInfoCollection;
                var apps = appGroup.FindApps(appNamePart);

                if (apps != null)
                {
                    _QuickSearchWnd.FoundItems = apps;
                }
            }
        }