c# - Get specific UIElemet from grid in Windows Phone with visual tree helper -
i have grid view in windows phone xaml page , grid contains many ui element buttons, checkboxes , textboxes. want search specific uielement name grid , want value of uielement , set new values well. how can uielement grid visual tree helper in code behind.
<grid x:name="contentpanel" grid.row="1" margin="12,0,12,0"> <grid.rowdefinitions> <rowdefinition height="120" /> <rowdefinition height="120" /> <rowdefinition height="120" /> <rowdefinition height="120" /> <rowdefinition height="120" /> </grid.rowdefinitions> <grid.columndefinitions> <columndefinition width="240" /> <columndefinition width="240" /> </grid.columndefinitions> <border borderthickness="2" horizontalalignment="left" grid.row="0" grid.column="0" name="border1"> <image width="110" height="110" stretch="fill" name="image1" tap="image1_tap" /> </border> <border borderthickness="2" borderbrush="transparent" horizontalalignment="left" grid.row="1" grid.column="0" name="border2"> <image width="110" height="110" stretch="fill" name="image2" tap="image2_tap" /> </border> <border borderthickness="2" horizontalalignment="left" grid.row="2" grid.column="0" name="border3"> <image width="110" height="110" stretch="fill" name="image3" tap="image3_tap" /> </border> <border borderthickness="2" horizontalalignment="left" grid.row="3" grid.column="0" name="border4"> <image width="110" height="110" stretch="fill" name="image4" tap="image4_tap" /> </border> <border borderthickness="2" horizontalalignment="left" grid.row="5" grid.column="0" name="border5"> <image width="110" height="110" stretch="fill" name="image5" tap="image5_tap" /> </border> <border borderthickness="2" horizontalalignment="right" grid.row="0" grid.column="1" name="border11"> <image width="110" height="110" stretch="fill" name="image11" tap="image11_tap" /> </border> <border borderthickness="2" horizontalalignment="right" grid.row="1" grid.column="1" name="border22"> <image width="110" height="110" stretch="fill" name="image22" tap="image22_tap" /> </border> <border borderthickness="2" horizontalalignment="right" grid.row="2" grid.column="1" name="border33"> <image width="110" height="110" stretch="fill" name="image33" tap="image33_tap" /> </border> <border borderthickness="2" horizontalalignment="right" grid.row="3" grid.column="1" name="border44"> <image width="110" height="110" stretch="fill" name="image44" tap="image44_tap" /> </border> <border borderthickness="2" horizontalalignment="right" grid.row="5" grid.column="1" name="border55"> <image width="110" height="110" stretch="fill" name="image55" tap="image55_tap" /> </border> </grid>
i want match options. lets left side images clicked , border changed , once on right side clicked option matched either left side have selection or not
can tell me want grid elements, because there borders , images inside. can find elements via generic coding. (contentpanel grid name), can border , image , other controls name , other properties on following procedure.
foreach (var child in contentpanel.children) { if (child border) { var bordername = (child border).name; // if wana image inside border, this. var getborderchlid = (item border).child; if (getborderchlid image) { var getimgname = (getborderchlid image).name; } } }
if , good, otherwise explain quest bit more, send exact code inshaallah.
Comments
Post a Comment