0
私はContentPresenterを持っており、ContentTemplate
属性にDataTemplate
を割り当てました。今私は、以下に示すようなDataTemplateの子であるMapControl
でMapIcon
を追加したい:UWP C#でContentPresenter DataTemplateからMapControlを取得するには?
<DataTemplate x:Key="EWDetailsContentTemplate" x:DataType="viewModels:Task">
<Grid x:Name="ContentPanel"
Background="White"
Margin="0,5,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Maps:MapControl x:Name="LocationMapControl"
MapServiceToken="key"
Grid.Row="0"
Height="250"/>
//more controls
</Grid>
は、どのように私はC#のVisualTreeの概念を使用してのMapControlを得ることができますか?