0

ScatterViewテンプレートを使用して動的にアイテムを作成しています。

<s:ScatterView.ItemTemplate >
    <DataTemplate>
        <DockPanel LastChildFill="True" >
            <DockPanel.Background>
                <ImageBrush ImageSource="{Binding Type, Converter={StaticResource imgSelector}}"
                            Stretch="Fill" />
            </DockPanel.Background>
            <TextBox Background="Transparent" DockPanel.Dock="Top" Text="{Binding Path=Message}"
                     IsReadOnly="True" TextWrapping="Wrap" />
            <s:ElementMenu Name="emBallMenu" VerticalAlignment="Top"
                           ActivationMode="HostInteraction" ActivationHost="?????">
                <s:ElementMenuItem Header="Send back" x:Name="emiSendBack"
                                   Command="local:MainSurfaceWindow.MenuItemCommand"
                                   CommandParameter="{Binding Path=BallId}"/>
            </s:ElementMenu>
        </DockPanel>
    </DataTemplate>
</s:ScatterView.ItemTemplate>

親を指でタップするとメニューがアクティブになるようにActivationHost、のに何を設定する必要がありますか?emBallMenuScatterView.ItemTemplate

4

1 に答える 1

1

正しい応答は次のとおりです。

<s:ElementMenu Name="emBallMenu" 
    VerticalAlignment="Top" 
    ActivationMode="HostInteraction" 
    ActivationHost="{Binding RelativeSource=RelativeSource FindAncestor, 
                    AncestorType={x:Type s:ScatterViewItem}}}" 
/>

私はここでこれを見つけました

于 2009-11-25T14:16:36.810 に答える