c# - Catch if own UserControl is clicked or not -


i writing wordsearch game windows phone 8.

screen http://kepfeltoltes.hu/130804/j_t_k_www.kepfeltoltes.hu_.png

this game window, , rectangles own usercontrols. here definition of rectangles, in xaml:

    <grid x:name="layoutroot" background="transparent">         <rectangle x:name="kitoltoszin" stroke="white" width="100" height="100" strokethickness="3" radiusx="10" radiusy="10" horizontalalignment="center" verticalalignment="center">             <rectangle.fill>                 <solidcolorbrush color="gray"/>                             </rectangle.fill>         </rectangle>         <textblock x:name="betu" width="70" height="70"                     fontweight="bold" fontsize="42" foreground="white"                     horizontalalignment="center" verticalalignment="center" textalignment="center" />     </grid> 

what want detect rectangle touched , it(for example make background blue). there simple way that? , how can refresh page in wp8?

so need consume mouseleftbuttonup event of rectangle, you'll add markup:

mouseleftbuttonup="kitoltoszin_mouseleftbuttonup" 

and in code-behind add handler:

private void kitoltoszin_mouseleftbuttonup(object sender, mousebuttoneventargs e) {     // want here } 

Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -