//---------------------------------------------------------------------------------------------
// This file was AUTO-GENERATED by "WPF Views" Xomega.Net generator.
//
// Manual CHANGES to this file WILL BE LOST when the code is regenerated.
//---------------------------------------------------------------------------------------------

using Microsoft.Extensions.DependencyInjection;
using System.Collections.Specialized;
using System.Windows.Controls;
using System.Windows.Input;
using Xomega.Framework.Views;
using AdventureWorks.Client.ViewModels;

namespace AdventureWorks.Client.Wpf
{
    public partial class MainMenu
    {
        public MainMenu()
        {
            InitializeComponent();
        }

        #region Sales Menu

        public static string M_Sales_Title = "_Sales";

        public static bool M_Sales_Visible = true;

        #region CustomerListView Command

        public static ICommand V_CustomerListView_Command = new RelayCommand<MenuItem>(CustomerListView_Execute);

        public static string V_CustomerListView_Title = "_Customer List";

        public static bool V_CustomerListView_Visible = true;

        public static void CustomerListView_Execute(MenuItem menuItem)
        {
            NameValueCollection query = new NameValueCollection()
            {
                { ViewParams.Mode.Param, ViewParams.Mode.Popup },
            };
            WPFView tgtView = App.Services.GetService<CustomerListView>();
            tgtView.Owner = menuItem;
            ViewModel.NavigateTo(App.Services.GetService<CustomerListViewModel>(), tgtView, query, null, null);
        }
        
        #endregion

        #region SalesOrderView Command

        public static ICommand V_SalesOrderView_Command = new RelayCommand<MenuItem>(SalesOrderView_Execute);

        public static string V_SalesOrderView_Title = "_New Sales Order";

        public static bool V_SalesOrderView_Visible = true;

        public static void SalesOrderView_Execute(MenuItem menuItem)
        {
            NameValueCollection query = new NameValueCollection()
            {
                { ViewParams.Mode.Param, ViewParams.Mode.Popup },
                { ViewParams.Action.Param, ViewParams.Action.Create },
            };
            WPFView tgtView = App.Services.GetService<SalesOrderView>();
            tgtView.Owner = menuItem;
            ViewModel.NavigateTo(App.Services.GetService<SalesOrderViewModel>(), tgtView, query, null, null);
        }
        
        #endregion

        #region SalesOrderListView Command

        public static ICommand V_SalesOrderListView_Command = new RelayCommand<MenuItem>(SalesOrderListView_Execute);

        public static string V_SalesOrderListView_Title = "_Sales Order List";

        public static bool V_SalesOrderListView_Visible = true;

        public static void SalesOrderListView_Execute(MenuItem menuItem)
        {
            NameValueCollection query = new NameValueCollection()
            {
                { ViewParams.Mode.Param, ViewParams.Mode.Popup },
            };
            WPFView tgtView = App.Services.GetService<SalesOrderListView>();
            tgtView.Owner = menuItem;
            ViewModel.NavigateTo(App.Services.GetService<SalesOrderListViewModel>(), tgtView, query, null, null);
        }
        
        #endregion

        #endregion
    }
}