title: How to pass click button event to trigger another function in WPF main window?
body: <p>I am new to C#/WPF with very little expertise and finding difficulty with this task.</p>
  <p>I have a button :</p>
  <pre><code>private void scan_click(object sender,RoutedEventArgs e) {}
        
  </code></pre>
  <p>I have the main window in WPF :</p>
  <pre><code>public MainWindow()
  {
  InitializeComponent();
  devicewatcher.finddevices();
  }
  </code></pre>
  <p>I want the execution of devicewatcher.finddevices() to take place after the button is clicked. I have tried using an incremental counter but it did not work Any help with this issue would be immensely helpful.</p>