Exemplo n.º 1
0
        private void LoadTags()
        {
            foreach (string tag in material.Tags)
            {
                Run run = new Run(tag);


                Hyperlink hyperlink = new Hyperlink(run);
                hyperlink.FontSize = 16;
                hyperlink.Click   += delegate(object sender, RoutedEventArgs e)
                {
                    //run advanced shearch with the tag
                    Dictionary <Material, Double> searchResult = controler.RetreiveMaterialsAdvancedSearch(tag);
                    //open results window
                    PresentResultsWindow win = new PresentResultsWindow(controler, searchResult);
                    win.Show();
                    //close this window
                    this.Close();
                };
                TextBlock tb = new TextBlock();
                tb.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
                tb.Inlines.Add(hyperlink);

                tagsLinks.Children.Add(tb);
            }
        }