public FrameworkElement CreateFrameworkElement(IDeferredQuickInfoContent deferredContent, DeferredContentFrameworkElementFactory factory) { var symbolDeferredContent = (SymbolGlyphDeferredContent)deferredContent; var image = new CrispImage { Moniker = symbolDeferredContent.Glyph.GetImageMoniker(), }; // Inform the ImageService of the background color so that images have the correct background. var binding = new Binding("Background") { Converter = new BrushToColorConverter(), RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(QuickInfoDisplayPanel), 1) }; image.SetBinding(ImageThemingUtilities.ImageBackgroundColorProperty, binding); return(image); }
public FrameworkElement CreateFrameworkElement(IDeferredQuickInfoContent deferredContent, DeferredContentFrameworkElementFactory factory) { var quickInfoDisplay = (QuickInfoDisplayDeferredContent)deferredContent; FrameworkElement warningGlyphElement = null; if (quickInfoDisplay.WarningGlyph != null) { warningGlyphElement = factory.CreateElement(quickInfoDisplay.WarningGlyph); } FrameworkElement symbolGlyphElement = null; if (quickInfoDisplay.SymbolGlyph != null) { symbolGlyphElement = factory.CreateElement(quickInfoDisplay.SymbolGlyph); } return(new QuickInfoDisplayPanel( symbolGlyphElement, warningGlyphElement, factory.CreateElement(quickInfoDisplay.MainDescription), factory.CreateElement(quickInfoDisplay.Documentation), factory.CreateElement(quickInfoDisplay.TypeParameterMap), factory.CreateElement(quickInfoDisplay.AnonymousTypes), factory.CreateElement(quickInfoDisplay.UsageText), factory.CreateElement(quickInfoDisplay.ExceptionText))); }
public FrameworkElement CreateFrameworkElement(IDeferredQuickInfoContent deferredContent, DeferredContentFrameworkElementFactory factory) { var projectionBufferDeferredContent = (ProjectionBufferDeferredContent)deferredContent; return(new ViewHostingControl(buffer => CreateView(projectionBufferDeferredContent, buffer), () => CreateBuffer(projectionBufferDeferredContent))); }
public FrameworkElement CreateFrameworkElement(IDeferredQuickInfoContent deferredContent, DeferredContentFrameworkElementFactory factory) { var classifiableContent = (ClassifiableDeferredContent)deferredContent; var formatMap = _classificationFormatMapService.GetClassificationFormatMap("tooltip"); var classifiedTextBlock = classifiableContent.ClassifiableContent.ToTextBlock(formatMap, _typeMap); if (classifiedTextBlock.Inlines.Count == 0) { classifiedTextBlock.Visibility = Visibility.Collapsed; } return(classifiedTextBlock); }