48 lines
1.2 KiB
C#
48 lines
1.2 KiB
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using ProductionUiCordonelLegacy.Model;
|
|
using MessageBox = System.Windows.Forms.MessageBox;
|
|
|
|
namespace ProductionUiCordonelLegacy.ctls
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for ctlMultiModeMarriage.xaml
|
|
/// </summary>
|
|
public partial class ctlMultiModeMarriage : UserControl
|
|
{
|
|
private MarriageMultiModeViewModel ViewModel;
|
|
public ctlMultiModeMarriage()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void setViewModel(MarriageMultiModeViewModel viewModel)
|
|
{
|
|
ViewModel = viewModel;
|
|
//ViewModel.Store();
|
|
}
|
|
|
|
private void btnMarry_Click(Object sender, RoutedEventArgs e)
|
|
{
|
|
Task<Boolean>.Run(() =>
|
|
{
|
|
return ViewModel.Store();
|
|
}).ContinueWith(a =>
|
|
{
|
|
if (a.Result)
|
|
{
|
|
MessageBox.Show("Meter has passed");
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("Meter not has passed");
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
}
|
|
}
|