public frmCostSheetSearch(UserInformation userInformation, WPF.MDI.MdiChild mdi)
        {
            InitializeComponent();
            //ltbRmCode.Focus();
            CostSheetSearchViewModel vm = new CostSheetSearchViewModel(userInformation, mdi, CostSheetSearch, OperationMode.View);

            this.DataContext = vm;
            mdi.Closing     += vm.CloseMethod;

            if (vm.CloseAction == null)
            {
                vm.CloseAction = new Action(() => mdi.Close());
            }
            //this.Title = vm.ApplicationTitle + " - " + "Cost Sheet Search";
        }
        public frmCostSheetSearch(UserInformation userInformation, WPF.MDI.MdiChild mdiChild, int entityPrimaryKey,
                                  OperationMode operationMode, string calledfromparentform = "MainWindow")
        {
            InitializeComponent();
            //ltbRmCode.Focus();
            this.mdiChild             = mdiChild;
            this.calledfromparentform = calledfromparentform.IsNotNullOrEmpty() ? calledfromparentform : "MainWindow";

            CostSheetSearchViewModel vm = new CostSheetSearchViewModel(userInformation, mdiChild, entityPrimaryKey, operationMode, calledfromparentform);

            this.DataContext  = vm;
            mdiChild.Closing += vm.CloseMethod;
            if (vm.CloseAction == null)
            {
                vm.CloseAction = new Action(() => mdiChild.Close());
            }
            //this.Title = vm.ApplicationTitle + " - " + "Cost Sheet Search";
        }