views:

75

answers:

3

I am new in WPF. Created a new WPF UserControl. See that some people uses an app.xaml file in order to set inside application level ressources.

My solution consists of a WinForm and a WPF UserControl. I don't see somewhere any app.xaml file.

How to proceed?

+3  A: 

You need to create a WPF or Silverlight application to get that file You are actually hosting a WPF control in a Winforms application

vc 74
So, without a fully WPF application I have no acces at app.xaml, am I right?
serhio
If it's for a demo application, do you really really need it?
vc 74
the scope of that demo is to demonstrate how a WinForm can host WPF controls. So in principle I can't change it to WPF one.
serhio
I did not mean to change the type of your application, but just to do without app.xaml
vc 74
+3  A: 

App.xaml is associated with a WPF application. If you've only got a UserControl, there's no application for it to be part of, is there?

Create a WPF application and you'll have an App.xaml to put application-level resources in.

Out of interest, why do you have WinForm if you're using a WPF user control?

EDIT: To repeat my comment: you're not going to get WPF Application resources when you're not creating a WPF application. So you won't be able to use techniques you'd normally associate with application level resources.

Jon Skeet
because we think to fill an existing big WinForms application with WPF elements. We can't chage all the logic directly to WPF right now.
serhio
I'm actually hosting WPF user controls in a big winforms app which hopefully will become a full fledge WPF app. But if this is a new project, I fully agree with Jon Skeet
vc 74
this is a demo application. But the scope of that demo is to demonstrate how a WinForm can host WPF controls. So in principle I can't change it to WPF one.
serhio
@serhio: In that case, you don't have a WPF application, so you don't have WPF-Application-level resources.
Jon Skeet
@Jon. Ok, I'll use UserControl.Ressources instead of Application.Ressources.
serhio
+3  A: 

If you created a WinForm project, it will not have a app.xaml.

Create a WPF project instead.

Martin
I need that a Winform hots WPF.
serhio