コード例 #1
0
 private void Copy_Device_Click(object sender, RoutedEventArgs e)
 {
     if (sender is Button devBtn && devBtn.DataContext is ComputeDevice sourceDevice)
     {
         _deviceData.CopySettingsFromAnotherDevice(sourceDevice);
         if (this.TemplatedParent is ContextMenu parentContext)
         {
             parentContext.IsOpen = false;
         }
     }
 }