Click here to Skip to main content
15,880,543 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Morning all,

I want to create a custom control in WPF that has two list boxes and allow a user to bind directly to the ItemsSources of these list boxes in xaml.

Can anyone make any suggestions as to a possible approaches?

My intende usage would be as follows

<ControlLib:DualListControl LeftItemsSource={Binding SomeSource} RightItemsSource={Binding SomeOtherSource}/>


Be gentle, I am new to WPF custom controls

Ta
Posted
Updated 6-Dec-10 0:51am
v2

1 solution

Well, the simplest way to do this would be to name the controls inside your control (using x:Name="...") and just expose the ItemsSources as properties, e.g.:
C#
public IEnumerable MasterListView
{
  get { return MasterList.ItemsSource; }
  set { MasterList.ItemsSource = value; }
}
 
Share this answer
 
Comments
PaulPrice 6-Dec-10 6:49am    
Pete, thanks for the answer. ot quite what I want, but then I guess if I make myself clear it would help ;-)

I will edit the question

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