using FLY.OBJComponents.IService;
using FLY.Thick.Base.UI;
using FLY.Weight2.Common;
using FLY.Weight2.IService;
using FLY.Weight2.Server.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Unity;
namespace FLY.Weight2.UI.Client
{
///
/// Page_Menu.xaml 的交互逻辑
///
public partial class PgMenu : Page
{
IUnityContainer container;
IWeightSystemService weightSystemService;
public PgMenu()
{
InitializeComponent();
}
[InjectionMethod]
public void Init(IUnityContainer container,
IWeightSystemService weightSystemService)
{
this.container = container;
this.weightSystemService = weightSystemService;
wrappanel_root.DataContext = weightSystemService;
}
private void button_ingredient_Click(object sender, RoutedEventArgs e)
{
if (!WdPassword.Authorize("Weighter"))
return;
//PgIngredient p = new PgIngredient();
//container.BuildUp(p);
//NavigationService.Navigate(p);
}
private void button_screw_Click(object sender, RoutedEventArgs e)
{
if (!WdPassword.Authorize("Weighter"))
return;
PgScrew p = new PgScrew();
container.BuildUp(p);
NavigationService.Navigate(p);
}
private void button_error_Click(object sender, RoutedEventArgs e)
{
PgErrorTable2 p = new PgErrorTable2();
var warningReasonWindow = container.Resolve("weighterWarningReasonWindow");
var warningService = container.Resolve("weighterWarningService");
p.Init(container, warningService, warningReasonWindow);
NavigationService.Navigate(p);
}
private void button_thickness_Click(object sender, RoutedEventArgs e)
{
if (!WdPassword.Authorize("Weighter"))
return;
PgThickness p = new PgThickness();
container.BuildUp(p);
NavigationService.Navigate(p);
}
private void button_version_Click(object sender, RoutedEventArgs e)
{
}
private void button_flow_Click(object sender, RoutedEventArgs e)
{
PgFlowTable p = new PgFlowTable();
container.BuildUp(p);
NavigationService.Navigate(p);
}
}
}