Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit Put controls in another UserControl (hmm, strange subject, but read the message instead :-)
3 replies. Latest Post by hehrsson on July 6, 2009.
(0)
hehrsson
Member
26 points
71 Posts
06-29-2009 3:23 AM |
Hi.
In our business application we have several UserControls that displays different lists of data.The controls are basicly made up of a DataGrid and some filter controls and buttons.The design of these UserControls are pretty much the same, only the DatGrid columns and the data differs.So, I have created a UserControl which is used as a footer in the UserControls.The footer contains some standard buttons, status images and text messages.
Now to the question, some of the UserControls that implements this footer have their own special buttons that I want to add to the footers collection of buttons.How can I, in XAML add a button to another UserControl.I pretty much would like something similar to the DataGrid where you can add a collection of Columns for example.
My footer control have a StackPanel which contains the standard buttons that all grid controls use, I want to add another StackPanel that can host "extended buttons" that can be added from the control that hosts the footer.
Is there a better way to do this? The best solution for me would be to specify it in XAML in someway like my first example, just add one or several HyperlinkButtons.
Regards,Håkan
meykih
Participant
876 points
213 Posts
06-29-2009 3:54 AM |
Maybe you could try to declare your ExtendedButtons as an ObservableColletion just like the columns-property of a datagrid.
06-29-2009 4:42 AM |
Still the same parser error :-(
/Håkan
07-06-2009 2:21 AM |
No other solution for my problem?
Shortly described:I have a UserControl with a StackPanel.The UserControl is hosted within another UserControl. From this "host control" I want to add content (HyperlinkButtons) in the StackPanel of the "child control".Preferrably I would like to add it directly in XAML, kinda like you add columns to a DataGrid or RowDefinitions to a Grid.Second best would be to att it in the code behind.
See my first post at the top for a more detailed description.
RegardsHåkan