using FLY.OBJComponents.IService; using FLY.Thick.Base.UI; using FLY.Weight.Common; using FLY.Weight.IService; using FLY.Weight.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.Weight.UI.Client { /// /// Page_Menu.xaml 的交互逻辑 /// public partial class PgMenuV4 : Page { IUnityContainer container; IWeightSystemService weightSystemService; public PgMenuV4() { 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_hopper_Click(object sender, RoutedEventArgs e) { if (!WdPassword.Authorize("Weighter")) return; PgHopper p = new PgHopper(); 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_rollmixtable_Click(object sender, RoutedEventArgs e) { WeighterC w = ((Button)sender).Tag as WeighterC; PgRollMixTable p = new PgRollMixTable(); container.BuildUp(p, new Unity.Resolution.ParameterOverride("w", w)); NavigationService.Navigate(p); } private void button_mixtable_Click(object sender, RoutedEventArgs e) { WeighterC w = ((Button)sender).Tag as WeighterC; PgMixTable p = new PgMixTable(); container.BuildUp(p, new Unity.Resolution.ParameterOverride("w", w)); 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); } private void btnReductClick(object sender, RoutedEventArgs e) { PgReduce p = new PgReduce(); container.BuildUp(p); NavigationService.Navigate(p); } } }