简体   繁体   English

WP7中处于全模式的带按钮选择器

[英]Listpicker with button in full mode in WP7

I put one button in listpicker full mode template. 我在listpicker全模式模板中放了一个按钮。 I want when this button is pressed. 我想要什么时候按下此按钮。 It Just invoke my defined event. 它只是调用我定义的事件。 Not act as normal tap on listpicker And closes the full mode of listpicker. 不能在列表选择器上正常单击,并关闭列表选择器的完整模式。

Please see screenshot below. 请看下面的截图。

在此处输入图片说明

To include the button in the listPicker full mode , you have to define the data template as such. 要将按钮包括在listPicker full mode ,您必须这样定义data template Go through the listPicker given here 通过给予listPicker转到这里

        <DataTemplate x:Name="PickerFullModeItemTemplate"> 
            <StackPanel Orientation="Horizontal" Margin="16 21 0 20"> 
                <Button Click="event">
                    <Button.Content>
                         <StackPanel>
                              <Image Source="myImg.png"/>
                              <TextBlock Text="test"/>
                         </StackPanel>
                    </Button.Content>
                </Button>
            </StackPanel> 
        </DataTemplate> 

For the behavior you require. 对于您要求的行为。 Try and test by handling event function on click event in the button. 通过处理按钮中click event事件功能进行尝试和测试。 I guess it should work. 我想应该可以。 If not then you have to use popUp instead of listPicker. 如果不是,则必须使用popUp而不是listPicker。 Or you would have to define your own UserControl in the worst case. 否则,您将不得不在最坏的​​情况下定义自己的UserControl

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM