Example #1
0
        private Hyperlink CreateHyperLinkByShapedWord(IShapedWord shapedWord)
        {
            var link = new SandoQueryHyperLink(new Run(shapedWord.Word),
                                               searchBox.Text + " " + shapedWord.Word, 0)
            {
                FontSize        = shapedWord.FontSize,
                Foreground      = shapedWord.Color,
                IsEnabled       = true,
                TextDecorations = null,
            };

            link.Click += (sender, args) => LogEvents.AddWordFromTagCloud(searchBox.Text,
                                                                          "TOFIXTHE", shapedWord.Word);
            link.Click += StartSearchAfterClick;
            link.Click += (sender, args) => TagCloudPopUpWindow.IsOpen = false;
            return(link);
        }
Example #2
0
        private void InternalUpdateRecommendedQueries(IEnumerable <string> quries)
        {
            quries = quries.ToList();
            RecommendedQueryTextBlock.Inlines.Clear();
            RecommendedQueryTextBlock.Inlines.Add(quries.Any() ? "Search instead for: " : "");
            var toRemoveList = new List <string>();

            toRemoveList.AddRange(searchBox.Text.Split());
            int index = 0;

            foreach (string query in quries)
            {
                var hyperlink = new SandoQueryHyperLink(new Run(RemoveDuplicateTerms(query,
                                                                                     toRemoveList)), query, index++);
                hyperlink.Click += RecommendedQueryOnClick;
                RecommendedQueryTextBlock.Inlines.Add(hyperlink);
                RecommendedQueryTextBlock.Inlines.Add("  ");
            }
        }