using Aurora;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
namespace WeldingCommon.Views
{
///
/// Interaction logic for UCPowerCalibration.xaml
///
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 lsOutputControl = new List { "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 e)
{
_Viewmodel.SlinderValueChanged(comboOutputControl.SelectedIndex);
}
private void ControlValueChanged(object sender, TextChangedEventArgs e)
{
_Viewmodel.ControlValueChanged(comboOutputControl.SelectedIndex);
}
}
}