0
私はListViewを持っています、その個々の各ListViewItemは同じ名前のMenuFlyOutItemを持っています。しかし、ListViewItemにあるMenuFlyOutItemのその名前をクリックすると、ListViewItemのMenuFlyouItemからその選択された項目と共に次のページに移動する必要があります。 添付したファイルを見つけてください。MenuFlyoutItemの選択した項目値を別のページにバインドするにはどうすればいいですか?
XAMLコード:MenuFlyoutItem_ClickInspesため
<Button Grid.Row="0" Margin="0,0,15,0" Grid.RowSpan="4" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Background="Blue" Height="50" Width="15">
<Button.Flyout>
<MenuFlyout>
<MenuFlyoutItem >
<MenuFlyoutItem.Template>
<ControlTemplate TargetType="MenuFlyoutItem">
<StackPanel Orientation="Horizontal">
<SymbolIcon Margin="10,10,10,10" Symbol="Map"></SymbolIcon>
<TextBlock Margin="10,10,10,10" Text="Geo Tag" FontSize="20" ></TextBlock>
</StackPanel>
</ControlTemplate>
</MenuFlyoutItem.Template>
</MenuFlyoutItem>
<MenuFlyoutItem Text="Create Notification" Foreground="Black" FontSize="20" Background="Transparent" Click="MenuFlyoutItem_Click"></MenuFlyoutItem>
<MenuFlyoutItem Text="Statistics" Foreground="Black" FontSize="20" Background="Transparent"></MenuFlyoutItem>
<MenuFlyoutItem Text="History" Foreground="Black" FontSize="20" Background="Transparent"></MenuFlyoutItem>
<MenuFlyoutItem Text="Orders" Foreground="Black" FontSize="20" Background="Transparent"></MenuFlyoutItem>
<MenuFlyoutItem Text="Inspection Checklist" Foreground="Black" FontSize="20" Background="Transparent" CommandParameter="{Binding Path=InspectionCommand, Mode=TwoWay}" Click="MenuFlyoutItem_ClickInspes">
<!--<I:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Tapped">
<core:InvokeCommandAction Command="{Binding Path=InspectionCommand, Mode=TwoWay}"></core:InvokeCommandAction>
</core:EventTriggerBehavior>
</I:Interaction.Behaviors>-->
</MenuFlyoutItem>
<MenuFlyoutItem Text="Maintainence Plan" Foreground="Black" FontSize="20" Background="Transparent"></MenuFlyoutItem>
</MenuFlyout>
</Button.Flyout>
</Button>
Xaml.csコード:
private void MenuFlyoutItem_ClickInspes(object sender, RoutedEventArgs e)
{
this.Frame.Navigate(typeof(InpectionCheckListEquipmentPage));
}