I'd typically go with the flow but i needed to force a different approach to
the bootstrap, in that I'm building a ChromeConsole for a customer at the
moment and i need to take over the way the first "MainPage" ignites but in a
way that's passive to their existing framework. Eg:
App.xaml.cs
private void Application_Startup(object sender, StartupEventArgs e)
{
MainPage mainpage = new MainPage();
this.RootVisual = new ConsoleWindow(mainpage);
}
Then in ConsoleWindow.cs
public ConsoleWindow(UserControl innerContent)
{
this.InnerContent = innerContent;
InitializeConsole();
CreateChildren();
}
private void CreateChildren()
{
// Inject the base plate (aka Chrome) for this Window.
this.chrome = new ConsoleWindowChrome();
// Inject the InnerContent into the Chrome.
Panel pnl = VisualTreeHelper.GetChild(chrome, 0) as Panel;
pnl.Children.Add(InnerContent);
}
This will ensure I can bootstrap a unique console window and then using a
ConsoleWindowHelper class can enable their developers to interact with various
moving parts of how the screen orchestration can flow.
From: [email protected]
[mailto:[email protected]] On Behalf Of
[email protected]
Sent: Wednesday, March 24, 2010 2:47 PM
To: [email protected]
Subject: RE: Create a child for a UserControl?
Hi Scott,
I did try this once, and while I still think it's possible I failed.
In the end I created a new UserControl using the template, and copied my code
across. It was relatively simple.
Carl.
From: [email protected]
[mailto:[email protected]] On Behalf Of Scott Barnes
<[email protected]>
Sent: Wednesday, 24 March 2010 12:40 PM
To: ozSilverlight <[email protected]>
Subject: Create a child for a UserControl?
Q. Does anyone know if you can instantiate a Control into a raw UserControl
class, in that if you File->New->MyClass and then inherit UserControl. How does
one new-up a Grid/Panel etc within the construct of that class? (Given it has
no MyClass.Children)
I know you can do it if do MyClass.xaml.cs via that approach, but interested to
know of an alternative approach?
Scott.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
_______________________________________________
ozsilverlight mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
_______________________________________________________________________________
Unencrypted electronic mail is not secure and may not be authentic.
If you have any doubts as to the contents please telephone to confirm.
This electronic transmission including any attachments is intended only
for those to whom it is addressed. It may contain copyright material or
information that is confidential, privileged or exempt from disclosure by law.
Any claim to privilege is not waived or lost by reason of mistaken transmission
of this information. If you are not the intended recipient you must not
distribute or copy this transmission and should please notify the sender.
Your costs for doing this will be reimbursed by the sender.
We do not accept liability in connection with computer virus, data corruption,
delay, interruption, unauthorised access or unauthorised amendment.
_______________________________________________________________________________
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
_______________________________________________
ozsilverlight mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight