Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
How to work with Multiple XAML in WPF project
Rakesh Sharma
Feb 15 2010 11:22 PM
7.1k
Reply
Hi All,
I am testing WPF application for our product. I thought of using different xaml for different scenarios. But as in App.xaml we can only refrence one XAML so i googled it and reach at the following solution:
http://social.msdn.microsoft.com/forums/en-US/wpf/thread/c2484bcb-b321-4cf7-9328-90da7dbbd5d1/
That is:
1st- Remove the tag StartupUri from all the startup xaml's
2nd- Create a method in app.xamls.cs like this:
protected
override
void
OnStartup(
StartupEventArgs
e)
{
this
.StartupUri =
new
System.
Uri
(file, System.
UriKind
.Relative);
}
"file" is the name of the xaml that i want to set has starting application. like: window1.xaml or window2.xaml
I did the same but it is trowing error:
IOexception was handled "Cannot locate resource 'file'." and if i use direct xaml name
i.e.
this
.StartupUri =
new
System.
Uri
(
"Windows1.xaml"
, System.
UriKind
.Relative);
then again it is trwing same error:
IOexception was handled "Cannot locate resource
Windows1.xaml
."
Pleas help 1. How to make use of file in above i mean where i need to define those XAMl so that to refernce with file in :
this
.StartupUri =
new
System.
Uri
(file, System.
UriKind
.Relative);
2. When i am directly using XAML name what is the cause of error?
Thanks in advance
looking for you promt reply/suggestion.
Regards
~rakesh
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
purpose of wpf
WPF web application that run on a web server