Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello guys....

I am using a user control which has 2 labels and 1 button. And this user control I am displaying in my main page using listbox.Itemtemplet which makes my user control to show number of time my iteamsource contains ....in my case usercontrol is created for 6 times

But thing here is my button in user control should have events as many times as it loads in my listbox so that I can write some code in codebehind... I think there should be something close to this....
 public eventHandler  buttonclick;
        public  usercontrol()
        {
            
            InitializeComponent();
testButton.Click +=(s,e) =>
          {
         if(buttonclick != null )
          buttonclick(s,e);
         };


please help me I dint find any solution...
Posted
Updated 2-Dec-10 17:33pm
v2

1 solution

You can add an event handler to the button control in the xaml.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900