Tech Off Thread

1 post

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

WPF how to rise the custom event handler in user contorl in a list.

Back to Forum: Tech Off
  • User profile image

    I have a user control called (ProfileControl) which has a image with two textblock and a button. What I want is to show the data from the SQL Server in the main page of my application view each control next to each other horizontally. And respond when I press the button in the control.

    <ListBox Name="profileList" ItemsSource="{Binding}">
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top"/>

    From Code behind I did [code]this.profileList.ItemsSource = dbObj.GetDbData();[/code] and it is working properly.

    The only thing missing is I need to enable the event handle of the user control (which is a button) which is I need to write in the xmal (OnClickUserControl="UC_OutButton" // which is the event handler and the target method).

    But I don't know how to do.. Please advise me.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.