c# - Add Buttons and a Textblock With Each Binded Image -
i'm developing uwp app , i'm trying add 2 buttons , textblock each image binded.
i'm binding images in xaml this; (updated full code)
<gridview name="display" margin="30,100,30,5" foreground="#ffffff" isitemclickenabled="true" itemclick="display_itemclick" itemssource="{binding}"> <gridview.itemtemplate> <datatemplate> <stackpanel orientation="vertical"> <image width="240" height="240" source="{binding path=image}" /> <stackpanel name="buttonpanel" orientation="horizontal" margin="0,-45,10,0" horizontalalignment="center"> <button name="button_minus" content="-" width="40" height="30" click="eksi_click" fontweight="bold"> <button.background> <imagebrush imagesource="assets/btn2.png" stretch="fill" /> </button.background> </button> <border background="white" cornerradius="10" height="30"> <textblock x:name="popupnumber" width="50" height="25" margin="0,6,0,0" text="{binding path=numberofcopy}" textalignment="center"> </textblock> </border> <button name="button_plus" content="+" width="40" height="30" click="artı_click" fontweight="bold"> <button.background> <imagebrush imagesource="assets/btn2.png" stretch="fill" /> </button.background> </button> </stackpanel> </stackpanel> </datatemplate> </gridview.itemtemplate> </gridview>
i added stackpanel contains buton-textblock-button format in seciton of code commented out. when this, buttons not working , don't know best way task.
when launch program, buttons not available click. can see them in ui can't click them. awkward thing in specific area on ui, buttons unavailable.
my click events fine, have binding issues, wondering proper way to that. way using causes binding problem?
in in each textblock values should different each image , can't access buttons , textblocks in .cs file because in datatemplate. might doing in wrong way.
so have solutions adding buttons , textblocks each binded image in datatemplate? i'm not sure way best way.
any appreciated.
thanks.
Comments
Post a Comment