Hi,
I was wondering if there is a way of defining WPF components in the code behind, building a full UI inside a Grid, then inserting this into a global container (WPF or WinForms).
i.e. a textblock with 2 buttons --> added to -- > wrappanel --> inserted into a wpf window
all from code behind.
Thanks in advance.
Person.
Loading
Martin CookPosted Feb 10, 2010, 7:09 AM
I don't fully understand what you are trying to achieve but if you are talking about adding these controls repeatedly
Cheers,
Martin
personPosted Jan 11, 2010, 11:19 AM
No I mentioned WinForms as the parent container......no WPF is harder to build in code behind.
If anyone has any ideas please shout.
Thanks,
N Dean G.
naura paxPosted Jan 11, 2010, 6:34 AM
since you mentioned winforms, I would say yes you can do that.
In code you can instantiate each control as an object
DataGridView grdTest=new DataGridView();
and populate it with columns like wise (in fact if you observe winform there is a form.designer.cs file which contains control definitions and there relative position within the form in c#).
I haven't tried WPF till now but i'm sure its possible with it too :)