0

I need a Method to restart my Program. I try to make a loop but in the partial class no Loop is allowed. How can i make a Method with a Loop that includes the Button?

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }

    public void button_Click(object sender, RoutedEventArgs e)
    {

I am open for every comment and help. Thanks Morwoi.

morwoi
  • 3
  • 2
  • 2
    What do you mean by restart? Why shoud a loop not be allowed? It's quite unclear what you want. – derpirscher Jul 16 '16 at 10:37
  • Related : http://stackoverflow.com/questions/779405/how-do-i-restart-my-c-sharp-winform-application –  Jul 16 '16 at 10:38

1 Answers1

0

If you want to restart your application, you can use the following code.

Application.Restart();

This can be used in any function or trigger.

SHW
  • 61
  • 7