I currently have code that allows our users to style and add text as a markup to a silverlight application. It allows you to either add plain text or a callout via the InfoWindow control. Our users love the InfoWindow solution, but would like to be able to include the InfoWindow labels when they print the map. Currently, only the plain text (which is added to a graphics layer as opposed to the LayoutRoot Grid will print. Is there any way to print an InfoWindow or replicate the InfoWindow as a graphic?
Code Behind:
Dim _fontSize As Double = CType(TextSizeCB.SelectedValue, Double)
Dim brush As New SolidColorBrush() With {.Color = CType(App.Current.Resources("mySolidColorBrushText"), SolidColorBrush).Color}
Dim _textSymbol As New TextSymbol() With {.FontFamily = New FontFamily("Arial"), .Foreground = brush, .FontSize = _fontSize, .Text = TextInsertTB.Text}
Dim _graphicText As New Graphic() With {.Geometry = New MapPoint(e.Geometry.Extent.XMax, e.Geometry.Extent.YMax), .Symbol = _textSymbol}
_graphicText.Attributes("Label") = TextInsertTB.Text
If CalloutCB.IsChecked Then
Dim _callout As New InfoWindow() With {.Anchor = New MapPoint(e.Geometry.Extent.XMax, e.Geometry.Extent.YMax), .Map = MyMap, .IsOpen = True, .Content = _graphicText.Attributes("Label"), .BorderBrush = brush, .Foreground = brush, .FontSize = _fontSize}
AddHandler _callout.MouseLeftButtonUp, AddressOf Callout_MouseLeftButtonUp
LayoutRoot.Children.Add(_callout)
Else
Dim annotations As GraphicsLayer = TryCast(MyMap.Layers("TextGraphicsLayer"), GraphicsLayer)
annotations.Graphics.Add(_graphicText)
End If