Hi Imp014,
Gizmox's support can't share those sources without the permission of Luca, and as the request was processed quite some time ago, I doubt that we still have it. Let's hope Luca is watching and will respond to your request.
In case it helps, we did have some code in a sample once that was something in that direction. In that very simple sample, we had forms instead of UserControls and we switched context between the forms, but similar idea can be used for usercontrols. The "menu" form picked up all the existing forms runtime, and the code that picked up the forms and created their instance was the following:
private void Form1_Load(object sender, EventArgs e)
{
LinkLabel objLinkLabel = null;
int intLinkLabelTop = 20;
foreach(Type objType in Assembly.GetExecutingAssembly().GetTypes())
{
if (objType.Name.EndsWith("Form") && !(objType.Name.Equals("Form1")))
{
objLinkLabel = new LinkLabel(objType.Name);
objLinkLabel.LinkClicked += new LinkLabelLinkClickedEventHandler(LinkLabel_LinkClicked);
objLinkLabel.Location = new Point(20, intLinkLabelTop);
intLinkLabelTop += 37;
this.Controls.Add(objLinkLabel);
}
}
}
protected virtual void LinkLabel_LinkClicked(object sender, EventArgs e)
{
LinkLabel objLinkLabel = sender as LinkLabel;
if (objLinkLabel == null)
{
return;
}
Gizmox.WebGUI.Forms.Form objForm = Activator.CreateInstance(Type.GetType("WrapperExample." + objLinkLabel.Text + ", WrapperExample")) as Form;
if (objForm != null)
{
this.Context.Transfer(objForm);
}
}
Hope this helps,
Palli