I have the following XAML code that used on hub application for windows 8.1:
<HubSection Width="780" Margin="0,0,80,0">
<HubSection.Background>
<ImageBrush ImageSource="Assets/MediumGray.png" Stretch="UniformToFill" />
</HubSection.Background>
<DataTemplate>
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<m:Map Credentials="YOUR_BING_MAPS_KEY">
<m:Map.Children>
<!-- Data Layer-->
<m:MapLayer Name="DataLayer"/>
<!--Common Infobox-->
<m:MapLayer>
<Grid x:Name="Infobox" Visibility="Collapsed" Margin="0,-115,-15,0">
<Border Width="300" Height="110" Background="Black" Opacity="0.8" BorderBrush="White" BorderThickness="2" CornerRadius="5"/>
</Grid>
</m:MapLayer>
</m:Map.Children>
</m:Map>
</Grid>
</DataTemplate>
</HubSection>
The problem is that I can't access to MapLayer
and to the Grid
controls in the c# page.
(The problem happens only whe the XAML is inside the DataTepmlate
control).
How can I get this access?