+ Reply to Thread
Results 1 to 2 of 2

Thread: Add Hyperlink Control into the MapTip programatically

  1. #1

    Join Date
    Jan 2012
    Posts
    1
    Points
    0
    Answers Provided
    0


    This post was helpful. Click to vote up
    0
    This post was not helpful. Click to vote down

    Default Add Hyperlink Control into the MapTip programatically

    Hi,
    I need to add a HyperlinkButton into a mapTip programtically. I have a collection of Graphics loaded by code in the GraphicLayer, and have the MaptTip defined into the Layer. I can set attrbitues and bind but can not add a HyperlinkButton into the StackPanel "MapTipSPImages" because it is null at run time (seems it is not loaded yet or something). How I can access to this stack panel so can add controls?
    Thanks.

    The XAML:
    Code:
    <esri:GraphicsLayer ID="Landmarks">
    				<esri:GraphicsLayer.MapTip>
    					<Border esri:GraphicsLayer.MapTipHideDelay="00:00:02" BorderBrush="DarkGray" CornerRadius="13" BorderThickness="1" Margin="0,0,15,15" Loaded="MapTipLoaded">
    						<Border.Effect>
    							<DropShadowEffect ShadowDepth="10" BlurRadius="14" Direction="300" />
    						</Border.Effect>
    						<Border CornerRadius="10" Background="#DDFFEEEE" BorderThickness="4" BorderBrush="#77FF0000" Name="MapTipBorder">
    							<StackPanel Orientation="Vertical" HorizontalAlignment="Center" Margin="10">
    								<StackPanel Orientation="Horizontal">
    									<TextBlock Text="{Binding Path=[Event]}" HorizontalAlignment="Left" VerticalAlignment="Center" />
    								</StackPanel>
    								<StackPanel Orientation="Horizontal">
    									<TextBlock Text="User: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="10" VerticalAlignment="Center"/>
    									<TextBlock Text="{Binding Path=[User]}" HorizontalAlignment="Left" VerticalAlignment="Center" />
    								</StackPanel>
    								<StackPanel Orientation="Horizontal">
    									<TextBlock Text="Date: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="10" VerticalAlignment="Center" />
    									<TextBlock Text="{Binding Path=[Date]}" HorizontalAlignment="Left" VerticalAlignment="Center" />
    								</StackPanel>
    								<StackPanel Orientation="Horizontal" Name="MapTipSPImages" >
    </StackPanel>
    							</StackPanel>
    						</Border>
    					</Border>
    					</esri:GraphicsLayer.MapTip>
    			</esri:GraphicsLayer>
    Last edited by elcapitanAndres; Today at 12:20 PM.

  2. #2
    J McNeil
    Join Date
    Apr 2010
    Posts
    125
    Points
    1
    Answers Provided
    0


    This post was helpful. Click to vote up
    0
    This post was not helpful. Click to vote down

    Default Re: Add Hyperlink Control into the MapTip programatically

    elcapitanAndres,

    This will work. It works for me but the thing is with a maptip is once you move the mouse away from the graphic and towards the hyperlink the maptip is gone....so I can never click on the hyperlink but I tested this in a simple stagnate grid and it works. It also shows up in my maptips.

    Code:
    XML
    
    
     <StackPanel>
    
    <TextBlock Name="HyperlinkString" Visibility="Collapsed" Text="{Binding [HyperLinkIDField]}" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                                    <HyperlinkButton TargetName="_blank" Content="Click Me I'm a HyperLink" HorizontalAlignment="Center" Foreground="RED" NavigateUri="{Binding Text, ElementName=HyperLinkString, Mode=OneWay}"/>
    
                                                </StackPanel>

    Jay

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts