kinaye

Apply a MapTip style in codebehind

Discussion created by kinaye on Jan 9, 2012
Latest reply on Jan 9, 2012 by JNery-esristaff
Greetings ???

How can I style a MapTip in a Resource file and apply it to codebehind?
Example in XAML that I???d like to convert:

            <esri:GraphicsLayer ID="MyLayer">
                <esri:GraphicsLayer.MapTip>
                    <Grid Background="LightYellow">
                        <StackPanel Orientation="Vertical" Margin="5">
                            <TextBlock Text="{Binding [Info], Mode=OneWay}" HorizontalAlignment="Left" Foreground="Black" />
                        </StackPanel>
                        <Border BorderBrush="Black" BorderThickness="1" />
                    </Grid>
                </esri:GraphicsLayer.MapTip>-->
            </esri:GraphicsLayer>


In codebehind, GraphicsLayer could be referenced as:

GraphicsLayer graphicsLayer = MapPart.Layers["MyLayer"] as GraphicsLayer;


The question is, do I apply this as:

graphicsLayer.MapTip.Style = App.Current.FindResource("MaptTipStyle") as Style;


All I ask is for a basic example; a boot in the correct direction! :)

Thanks, K

Outcomes