2011-03-21 6 views
2

안녕하세요, 지도 위에 별도의 레이어에 여러 위치의 푸시 핀을 생성하고 싶습니다. 이 푸시 핀은이 바로 좌표에서 장소를 나타냅니다. 따라서 사용자가 압핀을 두드리거나 터치하면 볼 수있는 몇 가지 추가 정보가 표시되어야합니다.PushPin의 사용자 지정 템플릿

이 전체 솔루션은 코드 기반 (압핀 추가)입니다.

압정 뒤에 보이지 않는 버튼을 넣어야만하지만 여기서는 어떻게해야하는지 잘 모르겠습니다.

누군가 내게 앞으로 가져올 힌트가 있다면 좋을 것입니다!

감사

<DataTemplate x:Key="PushpinControlTemplate2"> 
    <Grid x:Name="ContentGrid"> 
     <StackPanel Orientation="Vertical"> 

      <Grid Background="{TemplateBinding Background}" 
             HorizontalAlignment="Left" 
             MinHeight="10" 
             MinWidth="29"> 
       <Hyperlinkbutton HorizontalAlignment="Center" Content="{binding}" Click="clicker" Margin="0"/> 
      </Grid> 

      <Polygon Fill="{TemplateBinding Background}" 
           Points="0,0 29,0 0,29" 
           Width="29"        
           Height="29" 
           HorizontalAlignment="Left"/> 
     </StackPanel> 
    </Grid> 
</DataTemplate> 

이것은, 지금까지, 기능 리모콘이 정의 사용하십시오 내 코드 그러나 나는 항상 오류 'AG_E_PARSER_BAD_PROPERTY_VALUE [선 : 5 순위 : 98]'

답변

6

Pushpin-Styles in Bing Maps for the Windows Phone 포스트는 스타일 고정 핀에 대해 알아야 할 모든 것을 알려줍니다.

+0

나머지 질문은 C# 코드의 'ContentTemplate'속성을 해당 DataTemplate으로 설정하는 방법이 될 것입니다. – theXs

+2

리소스로 설정 한 다음 여기에서로드하십시오. myPushPin.ContentTemplate = (ContentTemplate) Application.Current.Resources [ "TemplateKey"]; 또는 XAML에서이를 deserialize합니다. 'myPushPin.ContentTemplate = (ContentTemplate) XamlLoader.Load (templateString);' –

+0

첫 번째 게시물을 더 많은 쇠고기로 업데이트했습니다. – theXs

관련 문제