c# App.xaml

Automatically created with wpf, it is the starting point of the project. .Net first search in the App, find the window and then open the window, the real starting point of the project is in the App.

These two (xaml and cs files of App) are similar to the working mode of MainWindow.

One of the most commonly used functions of App.xaml is:

  define global resources (may be used in the entire App)

< p>

  StartupUri defines which window or page we want to see. The default is MainWindow, which can be changed or deleted. After deleting, we can customize the startup steps

We can make a progress bar or start the animation with software, cool

share picture< /p>

The figure below just shows how to give a title to the form before restarting the form. It is not cool enough, there are many ideas, and you can implement it by yourself

p>

share picture


The custom StartUp function can also be passed in parameter debugging, solution-attributes-debugging-command line parameters

share picture

Share pictures

The above picture is to pass in 3 parameters, (should use spaces Separate , wrongly written) Judge if the number of parameters is 1, a message box will pop up.

Leave a Comment

Your email address will not be published.