title: Embed XAML.CS into Powershell WPF Tool
body: <p>Im currently working on a little tool that has multiple tabs, one of these tabs is a Profile Reset Tool. This is the current GUI
  <a href="https://i.stack.imgur.com/OnpbQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OnpbQ.png" alt="GUI"></a></p>
  
  <p>The powershell fully functions as I want it to however I do not have suitable XAML Code to handle Click Events. I know I can do this easily through the XAML.CS in C# however do not know how I would transfer that code over to the PS Script</p>
  
  <p>The best solution would be to handle Click Events directly through the XAML but i'm not too sure what I would modify</p>
  
  <p>Restart Machine</p>
  
  <p><code>&lt;Button x:Name="NTRelease" Content="1) Restart Machine" HorizontalAlignment="Left" Margin="386,164,0,0" VerticalAlignment="Top" Width="180" Height="23"
                      IsEnabled="{Binding ElementName=ProfileSelect, Path=Text.Length, Mode=OneWay}" Click="NTRelease_Click"/&gt;</code>   </p>
  
  <p>Get Drives &amp; Printers</p>
  
  <p><code>&lt;Button x:Name="GetInfo" Content="2) Get Drives &amp;amp; Printers" HorizontalAlignment="Left" Margin="386,192,0,0" VerticalAlignment="Top" Width="180" Height="23" IsEnabled="False"/&gt;</code></p>
  
  <p>Thanks</p>