嵌套控件的绑定事件

时间:2013-09-01 12:39:25

标签: c# xaml mvvm windows-phone-8

我正在windows phone 8中编写应用程序并且绑定有问题。 这是我的xaml代码与我的页面结构

<phone:Pivot Grid.Row="1" SelectedIndex="{Binding SelectedPivotElement, Mode=TwoWay}" x:Name="SymbolsPivot" Title="Symbols" ItemsSource="{Binding CategoriesWithSymbols}">
        <phone:Pivot.HeaderTemplate>
            <DataTemplate>
                <ContentControl Content="{Binding Name}"/>
            </DataTemplate>
        </phone:Pivot.HeaderTemplate>
        <phone:Pivot.ItemTemplate>
            <DataTemplate>
                <telerikData:RadJumpList x:Name="SymbolsControl"  ItemsSource="{Binding Path=Symbols}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
                    <telerikData:RadJumpList.GroupDescriptors>
                        <data:PropertyGroupDescriptor PropertyName="GroupName"
                              SortMode="Ascending" />
                    </telerikData:RadJumpList.GroupDescriptors>
                    <telerikPrimitives:RadDataBoundListBox.VirtualizationStrategyDefinition>
                        <telerikPrimitives:WrapVirtualizationStrategyDefinition Orientation="Horizontal"/>
                    </telerikPrimitives:RadDataBoundListBox.VirtualizationStrategyDefinition>
                    <telerikData:RadJumpList.GroupHeaderTemplate>
                        <DataTemplate>
                            <Grid Margin="0,-8,0,12" Width="480">
                                <TextBlock FontWeight="Bold" FontSize="{StaticResource PhoneFontSizeMedium}" Text="{Binding}" TextWrapping="Wrap"/>
                            </Grid>
                        </DataTemplate>
                    </telerikData:RadJumpList.GroupHeaderTemplate>

                    <telerikData:RadJumpList.ItemTemplate>
                        <DataTemplate>
                            <Grid Width="300">
                                <TextBlock Text="{Binding Symbol}"/>
                            </Grid>
                        </DataTemplate>
                    </telerikData:RadJumpList.ItemTemplate>
                </telerikData:RadJumpList>


            </DataTemplate>
        </phone:Pivot.ItemTemplate>
    </phone:Pivot>
    <i:Interaction.Triggers>
            <i:EventTrigger EventName="ItemTap" SourceName="SymbolsControl"  >
                <cmd:EventToCommand Command="{Binding TapCommand}"
                                        />
            </i:EventTrigger>
    </i:Interaction.Triggers>  

所以我有枢轴控制和内部枢轴我有一个列表。 现在问题是应用程序将项目点击事件绑定到我的中继命令,但从不调用此事件/命令。如果我将列表移到枢轴外,一切都有效。如何解决这个问题?

0 个答案:

没有答案