Questions tagged [app.xaml]

App.xaml is the declarative starting point of a WPF (Windows Presentation Foundation) application

App.xaml is the declarative starting point of a (Windows Presentation Foundation) application. automatically creates it when a new WPF project is created, including a code-behind file called App.xaml.cs. They work together to allow the developer to work in both markup () and code-behind.

App.xaml.cs extends the Application class, which is a central class in a WPF Windows application.

will refer to this class for starting instructions and then start the desired Window or Page from there. This is also the place to subscribe to important application events, like application start, unhandled exceptions and so on.

One of the most commonly used features of the App.xaml file is to define global resources that may be used and accessed from all over an application, for instance global styles.

Resources

199 questions
24
votes
4 answers

Set static resource in code

I have a few styles in my App.xaml file:
Arn Vanhoutte
  • 1,779
  • 4
  • 16
  • 28
21
votes
2 answers

datatemplate in app.xaml is not getting picked up without any styles?

I have a DataTemplate in app.xaml that binds a view to a viewmodel. the above template…
Ramki
  • 315
  • 3
  • 8
15
votes
6 answers

WPF - Shut-off autogen of Main in App.g.cs

I'm learning WPF. I want to provide my own Main method in my App.xaml.cs rather than getting one generated for me in App.g.cs. However I keep getting conflicts because I haven't found out how to stop an additional Main from being generated. Is there…
automatic
  • 2,727
  • 3
  • 34
  • 31
14
votes
4 answers

WPF: Changing Resources (colors) from the App.xaml during runtime

I am trying to make my application more customizable by allowing users to pick a color from a Color Picker dialog, and then changing the style of the application in real time (with DynamicResource) How do I go about in changing specific resources…
Andreas Grech
  • 105,982
  • 98
  • 297
  • 360
11
votes
2 answers

Why doesn't style-setting of the window background work?

Here is the App.xaml: