In Windows Phone 7 toolkit, when expanderview is clicked, a response is displayed at the edge of the unexpanded list item.

Source: Internet
Author: User

This problem occurs when the expanderview contains the age header and the item is clicked.ProgramThe response mouse clicks the message twice, that is, not only does the header receive the tap message, but after the response, the tap message is sent to the item for processing, so it appears. Click the blank area, the program first handed over the header to process the click message, and then handed over the item for message processing. Unexpected results will appear, specifically, you need to write the mouse message in The ListBox or in the header or item according to the project processing, or in some of them, according to your project program as follows, and the backgroundCodeThere are also associations. I will not repeat them here.

For example:

<Controls: effectitem name = "  Effect_phrase  " Header = "  Phrase Book  " >

<ListBox name = " Phraselist " Itemssource = " {Binding} " Verticalalignment = " Top "
Margin = " 12, 0, 0, 0 " >

<! -- <ListBox. itemcontainerstyle>
<Style targettype = " Listboxitem " >
<Setter property = " Horizontalcontentalignment " Value = " Stretch " />
</Style>
</ListBox. itemcontainerstyle> -->
<ListBox. itemtemplate>
<Datatemplate>
<Toolkit: expanderview margin =" 0, 0, 0, 8 "
Header = " {Binding} "
Itemssource = " {Binding} "
Nonexpandableheader = " {Binding} "
Isnonexpandable = " {Binding hassinglemessage} "
Tap = " Expanderview_tap "
>

<! -- The headertemplate describes the header For An expandable item.
In the sample, it ' S the textblock for "Anne Wallace". -->
<Toolkit: expanderview. headertemplate>
<Datatemplate>
<Stackpanel orientation = " Horizontal " >
<Textblock name = " Node " TEXT = " {Binding title} " Width = " 300 "
Foreground = " {Staticresource phoneforegroundbrush} "
Fontsize = " {Staticresource phonefontsizeextralarge} "
Fontfamily =" {Staticresource phonefontfamilysemilight} " />
<Image Source = " {Binding arrow} " > </Image>
</Stackpanel>
</Datatemplate>
</Toolkit: expanderview. headertemplate>
<Toolkit: expanderview. itemtemplate>
<Datatemplate>
<Listboxitem Toolkit: tilteffect. istiltenabled = " True " >
<Stackpanel>
<Textblock text = " {Binding sender} " Textwrapping = " Wrap "
Margin = " 0, 8, 0,-4 " Tap = " Phraselist_tap "
Foreground = " {Staticresource phoneforegroundbrush} "
Fontsize = " 27 " Width = " 400 "
Fontfamily = " {Staticresource phonefontfamilysemilight} " />
</Stackpanel>
</Listboxitem>
</Datatemplate>
</Toolkit: expanderview. itemtemplate>

<Toolkit: expanderview. nonexpandableheadertemplate>
<Datatemplate>
<Stackpanel orientation = " Horizontal " Toolkit: tilteffect. istiltenabled = " True " >
<Textblock text = " {Binding title} " Width = " 300 "
Foreground = " {Staticresource phoneforegroundbrush} "
Fontsize = " {Staticresource phonefontsizeextralarge} "
Fontfamily = " {Staticresource phonefontfamilysemilight} " />
</Stackpanel>
</Datatemplate>
</Toolkit: expanderview. nonexpandableheadertemplate>
</Toolkit: expanderview>
</Datatemplate>
</ListBox. itemtemplate>
</ListBox>
</Controls: effectitem>

In the image, each item will have a sub-menu and a plus sign (+) can be expanded. After verticalignment = "TOP" is added in the Code, the program can run normally without being expanded, click the area near the end of the last item, and the program will not be matched. If it is not added, the project will enter the status of one of the list items after the last item is clicked,

For the specific effect, see the PTA version of this project before January 1, January 10. Compared with those after January 11.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.