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.