46 lines
1.6 KiB
C#
46 lines
1.6 KiB
C#
using Aurora;
|
|
using System.Collections.Generic;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
|
|
namespace WeldingCommon.Views
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for UCPowerCalibration.xaml
|
|
/// </summary>
|
|
public partial class UCPowerCalibration : UserControl
|
|
{
|
|
private readonly UCPowerCalibrationViewModel _Viewmodel;
|
|
|
|
public UCPowerCalibration(IAuroraEnvironment aurora)
|
|
{
|
|
InitializeComponent();
|
|
_Viewmodel = new UCPowerCalibrationViewModel(aurora);
|
|
DataContext = _Viewmodel;
|
|
|
|
#region Initailize UI Control Properties
|
|
// combobox
|
|
List<string> lsOutputControl = new List<string> { "Index Percentage", "Analog Voltage", "Power Watt" };
|
|
comboOutputControl.Items.Clear();
|
|
foreach (string s in lsOutputControl) comboOutputControl.Items.Add(s);
|
|
_Viewmodel.cbOutputControl = comboOutputControl.Items[0] as string;
|
|
#endregion
|
|
}
|
|
|
|
private void comboOutputControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
_Viewmodel.ComboBoxIndexChanged(comboOutputControl.SelectedIndex);
|
|
}
|
|
|
|
private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
|
{
|
|
_Viewmodel.SlinderValueChanged(comboOutputControl.SelectedIndex);
|
|
}
|
|
|
|
private void ControlValueChanged(object sender, TextChangedEventArgs e)
|
|
{
|
|
_Viewmodel.ControlValueChanged(comboOutputControl.SelectedIndex);
|
|
}
|
|
}
|
|
}
|