0
我为我的应用使用WP7'Mango'SDK和Phone Toolkit。我有一个控件,其中包含ExpanderView。我使用一个模板为ExpanderView的标题:WP7:按钮点击事件不会触发,为什么?
<toolkit:ExpanderView.HeaderTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}"/>
<Button Tap="ShowMoreTap">
<Button.Template>
<ControlTemplate>
<TextBlock Text="show more..."/>
</ControlTemplate>
</Button.Template>
</Button>
</StackPanel>
</DataTemplate>
</toolkit:ExpanderView.HeaderTemplate>
背后的代码:
private void ShowMoreTap(object sender, System.Windows.Input.GestureEventArgs e)
{
// Some logic here
}
我不想展开/折叠ExpanderView当用户点击该按钮时,我需要一些具体的行动在那里。问题是ShowMoreTap事件永远不会被触发。
任何想法?
由于
谢谢Erno!其实我不想拒绝从该控件的展开/折叠选项。点击此按钮将向ExpanderView添加更多项目。之后,它将完全起到标准控制的作用。将尝试制作定制版本。 –