コード例 #1
0
        /// <summary>
        /// The populate data for location grid.
        /// </summary>
        /// <param name="selectedRegister">
        /// The selected register.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        private async Task PopulateDataForLocationGrid(AssetRegister selectedRegister)
        {
            bool isCanAdd = true;
            bool isCanDelete = true;
            this.Locations = await AssetRegisterFunction.GetLocationsFromSystemParam();

            // Load List locations
            List<AssetRegisterLocationRowItem> assetLocations =
                await AssetRegisterFunction.GetLocationsForRegister(selectedRegister.ID);

            // this.OldRegisterLocations = assetLocations;
            this.AssetRegisterLocations = new ObservableCollection<AssetRegisterLocationRowItem>(assetLocations);
            
            this.OldRegisterLocations = new List<AssetRegisterLocationRowItem>();

            // set data for OldRegisterLocations
            this.AssetRegisterLocations.ForEach(a => this.OldRegisterLocations.Add(new AssetRegisterLocationRowItem
                                                                                       {
                                                                                          AssetRegisterLocationID  = a.AssetRegisterLocationID,
                                                                                          Enabled = a.Enabled,
                                                                                          GuidId = a.GuidId,
                                                                                          AssetRegisterID = a.AssetRegisterID,
                                                                                          Found = a.Found,
                                                                                          IsNewRecord = a.IsNewRecord,
                                                                                          LocationName = a.LocationName,
                                                                                          IsUpdated = a.IsUpdated,
                                                                                          IsExpandDetail = a.IsExpandDetail,
                                                                                          IsSelected = a.IsSelected,
                                                                                          IsRadioSelected = a.IsRadioSelected,
                                                                                          ListLocations = a.ListLocations,
                                                                                       }));
            foreach (var a in this.AssetRegisterLocations)
            {
                a.PropertyChanged += this.AssetRegisterDetailViewModel_PropertyChanged;
            }

            // Check to handle Add and Delete toolbar button
            if (this.AssetRegisterLocations.Count() == this.Locations.Count())
            {
                isCanAdd = false;
            }

            if (!this.AssetRegisterLocations.Any())
            {
                isCanDelete = false;
            }

            // Load Toolbar Command Grid
            // Handle visibility Toolbar Command Grid
            this.DynamicRegisterLocationViewModel.ToolbarCommandGridViewModel = new ToolbarCommandGridViewModel();
            List<CustomToolbarCommand> toolbarCommandCustoms = new List<CustomToolbarCommand>
                                                         {
                                                             new CustomToolbarCommand
                                                                 {
                                                                     SourceImage = SourceImageAdd,
                                                                     Key = EnumToolbarAction.Add,
                                                                     ToolbarCommandName = "Add New Record",
                                                                     ToolbarCommandVisibilityChange = isCanAdd ? Visibility.Visible : Visibility.Collapsed
                                                                 },
                                                             new CustomToolbarCommand
                                                                 {
                                                                     SourceImage = SourceImageDelete,
                                                                     Key = EnumToolbarAction.Delete,
                                                                     ToolbarCommandName = "Delete",
                                                                     ToolbarCommandVisibilityChange = isCanDelete ? Visibility.Visible : Visibility.Collapsed
                                                                 }
                                                       };
            this.DynamicRegisterLocationViewModel.ToolbarCommandGridViewModel.CustomToolbarCommands =
                toolbarCommandCustoms;
            this.DynamicRegisterLocationViewModel.ToolbarVisibilityChanged = Visibility.Collapsed;

            // Load Locations Grid
            this.DynamicRegisterLocationViewModel.IsEnableHoverRow = false;
            this.DynamicRegisterLocationViewModel.IsShowGroupPanel = false;
            this.DynamicRegisterLocationViewModel.RowDetailTemplateKey = "DetailLocationRowTemplate";
            this.DynamicRegisterLocationViewModel.GridColumns = new List<DynamicColumn>
                                                                                             {
                                                                                                 new DynamicColumn { ColumnName = "AssetRegisterLocationID", Header = "ID", MinWidth = 30, TextAlignment = TextAlignment.Center, HeaderTextAlignment = TextAlignment.Center, Width = 100 },
                                                                                                 new DynamicColumn { ColumnName = "LocationName", Header = "LOCATION NAME", MinWidth = 100, ColumnTemplate = ViewModels.Common.Enums.RadGridViewEnum.ColumnEditDelSelectedHoverTemplate, IsSelectedColumn = true, Width = 350, HeaderTextAlignment = TextAlignment.Left },
                                                                                                 new DynamicColumn { ColumnName = "Enabled",  Header = "ENABLED", MinWidth = 100, ColumnTemplate = ViewModels.Common.Enums.RadGridViewEnum.ColumnCheckedTemplate, HeaderTextAlignment = TextAlignment.Center }
                                                                                             };

            this.DynamicRegisterLocationViewModel.GridDataRows = this.AssetRegisterLocations.ToList<object>();
            this.DynamicRegisterLocationViewModel.LoadRadGridView();
            this.DynamicRegisterLocationViewModel.DeletedItemChanged -= this.DeleteItemChange;
            this.DynamicRegisterLocationViewModel.DeletedItemChanged += this.DeleteItemChange;

            this.DynamicRegisterLocationViewModel.UpdatedItemChanged -= this.UpdateItemChange;
            this.DynamicRegisterLocationViewModel.UpdatedItemChanged += this.UpdateItemChange;

            this.DynamicRegisterLocationViewModel.CanceledItemChanged -= this.CancelItemChange;
            this.DynamicRegisterLocationViewModel.CanceledItemChanged += this.CancelItemChange;

            this.DynamicRegisterLocationViewModel.RowDetailLoading -= this.DynamicRegisterLocationViewModelRowDetailLoading;
            this.DynamicRegisterLocationViewModel.RowDetailLoading += this.DynamicRegisterLocationViewModelRowDetailLoading;

            this.RaiseClickedToolbarCommandGrid();
            this.DynamicRegisterLocationViewModel.ValidateRow = this.ValidateLocationRecord;

            this.DynamicRegisterLocationViewModel.AddedNewItem -= this.AddNewItem;
            this.DynamicRegisterLocationViewModel.AddedNewItem += this.AddNewItem;
        }
コード例 #2
0
 /// <summary>
 /// The load data for location grid.
 /// </summary>
 /// <param name="selectedRegister">
 /// The selected register.
 /// </param>
 public async void LoadDataForLocationGrid(AssetRegister selectedRegister)
 {
     await this.PopulateDataForLocationGrid(selectedRegister);
     this.DynamicRegisterLocationViewModel.ToolbarVisibilityChanged =
                Visibility.Visible;
     this.DynamicRegisterLocationViewModel.IsEnableHoverRow = true;
 }
コード例 #3
0
        /// <summary>
        /// Process actions or steps were raised on content
        /// </summary>
        /// <param name="e">
        /// The e.
        /// </param>
        /// <param name="_params">
        /// The _params.
        /// </param>
        /// <param name="item">
        /// The id.
        /// </param>
        public void ProcessingStepsOnChild(EnumScreen e, object _params, object item)
        {
            Screen = e;

            // handle behavior for step on content
            EnumSteps currentStep = (EnumSteps)Enum.Parse(typeof(EnumSteps), _params.ToString());
            object firstSelectedItem = null;
            if (FormBarMenuViewModel != null)
            {
                switch (currentStep)
                {
                    case EnumSteps.Edit:
                    case EnumSteps.Transfer:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Collapsed;
                        return;
                    case EnumSteps.EditBulkUpdate:
                        switch (Screen)
                        {
                            case EnumScreen.AssetCollateralClasses:
                            case EnumScreen.AssetFeatures:
                                var assetFeatureVm = this.ScreenDetailViewModel as MainWindowDetailsViewModel;
                                if (assetFeatureVm != null)
                                {
                                    assetFeatureVm.ChangedVisibilityHyperlink = Visibility.Hidden;
                                }
                                FormBarMenuViewModel.ChangedVisibility = Visibility.Collapsed;
                                return;
                        }
                        break;                       
                    case EnumSteps.Cancel:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        return;
                    case EnumSteps.CancelBulkUpdate:
                        switch (Screen)
                        {
                            case EnumScreen.AssetCollateralClasses:
                            case EnumScreen.AssetFeatures:
                                var assetFeatureVm = this.ScreenDetailViewModel as MainWindowDetailsViewModel;
                                if (assetFeatureVm != null)
                                {
                                    assetFeatureVm.ChangedVisibilityHyperlink = Visibility.Hidden;
                                }
                                FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                                return;
                        }
                        break;
                    case EnumSteps.CancelAssignFeature:
                        switch (Screen)
                        {
                            case EnumScreen.AssetCollateralClasses:
                                FormBarMenuViewModel.FormMenuContent = "Asset Collateral Classes";
                                var assetFeatureVm = this.ScreenDetailViewModel as MainWindowDetailsViewModel;
                                if (assetFeatureVm != null)
                                {
                                    assetFeatureVm.ChangedVisibilityHyperlink = Visibility.Hidden;
                                }
                                FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                                return;
                            case EnumScreen.AssetFeatures:
                                FormBarMenuViewModel.FormMenuContent = "Asset Features";
                                assetFeatureVm = this.ScreenDetailViewModel as MainWindowDetailsViewModel;
                                if (assetFeatureVm != null)
                                {
                                    assetFeatureVm.ChangedVisibilityHyperlink = Visibility.Hidden;
                                }
                                FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                                return;
                            case EnumScreen.AssetClassesCategory:
                                FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                                return;
                            case EnumScreen.AssetClassesType:
                                FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                                return;
                        }
                        break;
                    case EnumSteps.CancelAssignMake:
                        switch (Screen)
                        {
                            case EnumScreen.AssetClassesType:
                                FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                                return;
                        }
                        break;
                    case EnumSteps.ItemLocked:
                        if (item != null)
                        {
                            FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                            switch (Screen)
                            {
                                case EnumScreen.CollectionAssignment:
                                    CollectionAssignmentModel selectedQueue = item as CollectionAssignmentModel;
                                    this.ToggleViewModel.SetSelectedItem(selectedQueue);
                                    break;
                            }
                        }
                        return;
                    case EnumSteps.Add:
                        var toggleViewModel = this.ToggleViewModel.GridDynamicViewModel;
                        if (toggleViewModel != null && toggleViewModel.SelectedItem != null)
                        {
                            toggleViewModel.SelectedItem = null;
                        }
                        if (Screen == EnumScreen.AssetClassesMake)
                        {
                            FormBarMenuViewModel.ChangedVisibility = Visibility.Collapsed;
                        }
                        break;
                    case EnumSteps.Delete:
                        if (item != null)
                        {
                            switch (Screen)
                            {
                                case EnumScreen.AssetFeatures:
                                    this.ContentViewModel_OnPropertyChanged(currentStep, item);
                                    FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                                    return;
                            }
                        }
                        var mainWindowDetailsViewModelFundingSummary = this.ScreenDetailViewModel as MainWindowDetailsViewModel;
                        if (mainWindowDetailsViewModelFundingSummary != null)
                        {
                            mainWindowDetailsViewModelFundingSummary.ChangedVisibilityHyperlink = Visibility.Hidden;
                        }
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Collapsed;
                        ContentViewModel_OnPropertyChanged(currentStep, item);
                        return;
                    case EnumSteps.Save:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        ContentViewModel_OnPropertyChanged(currentStep, item);
                        return;
                    //Asset classes Category step change for mode bulk update
                    case EnumSteps.AssetClassesCategoryAssignFeaturesState:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Collapsed;
                        FormBarMenuViewModel.FormBarContent = "Assign Features";
                        FormBarMenuViewModel.FormMenuContent = "Asset Category";
                        return;
                    case EnumSteps.AssetClassesCategoryAssignTypesState:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Collapsed;
                        FormBarMenuViewModel.FormBarContent = "Assign Types";
                        FormBarMenuViewModel.FormMenuContent = "Asset Category";
                        return;
                    case EnumSteps.AssetClassesCategoryUpdateDepreciationState:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Collapsed;
                        FormBarMenuViewModel.FormBarContent = "Update Depreciation";
                        FormBarMenuViewModel.FormMenuContent = "Asset Category";
                        return;
                    //Asset classes Type step change for mode bulk update
                    case EnumSteps.AssetClassesTypeAssignFeaturesState:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Collapsed;
                        FormBarMenuViewModel.FormBarContent = "Assign Features";
                        FormBarMenuViewModel.FormMenuContent = "Asset Type";
                        return;
                    case EnumSteps.AssetClassesTypeAssignMakeState:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Collapsed;
                        FormBarMenuViewModel.FormBarContent = "Assign Make";
                        FormBarMenuViewModel.FormMenuContent = "Asset Type";
                        return;
                    case EnumSteps.AssetClassesTypeUpdateDepreciationState:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Collapsed;
                        FormBarMenuViewModel.FormBarContent = "Update Depreciation";
                        FormBarMenuViewModel.FormMenuContent = "Asset Type";
                        return;
                    case EnumSteps.SaveAssignFeature:
                        switch (Screen)
                        {
                            case EnumScreen.AssetCollateralClasses:
                            case EnumScreen.AssetFeatures:
                                var assetFeatureVm = this.ScreenDetailViewModel as MainWindowDetailsViewModel;
                                if (assetFeatureVm != null)
                                {
                                    assetFeatureVm.ChangedVisibilityHyperlink = Visibility.Hidden;
                                }
                                FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                                return;
                            case EnumScreen.AssetClassesCategory:
                                FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                                return;
                            case EnumScreen.AssetClassesType:
                                FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                                return;
                        }
                        break;
                    case EnumSteps.SaveAssignTypes:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        switch (Screen)
                        {
                            case EnumScreen.AssetCollateralClasses:
                                var collateralVm = this.ScreenDetailViewModel as MainWindowDetailsViewModel;
                                if (collateralVm != null)
                                {
                                    collateralVm.ChangedVisibilityHyperlink = Visibility.Hidden;
                                }
                                return;
                        }
                        return;
                    case EnumSteps.SaveAssignMake:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        return;
                    case EnumSteps.SaveUpdateDepreciation:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        return;
                    case EnumSteps.CancelAssignTypes:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        return;
                    case EnumSteps.CancelUpdateDepreciation:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        return;
                    case EnumSteps.BulkUpdate:
                        switch (Screen)
                        {
                            case EnumScreen.AssetCollateralClasses:
                                var collateralVm = this.ScreenDetailViewModel as MainWindowDetailsViewModel;
                                if (collateralVm != null)
                                {
                                    collateralVm.ChangedVisibilityHyperlink = Visibility.Hidden;
                                }
                                return;
                            case EnumScreen.AssetFeatures:
                                var assetFeatureVm = this.ScreenDetailViewModel as MainWindowDetailsViewModel;
                                if (assetFeatureVm != null)
                                {
                                    assetFeatureVm.ChangedVisibilityHyperlink = Visibility.Hidden;
                                }
                                return;
                        }
                        break;
                    case EnumSteps.SelectOldTabHyperlink:
                        return;
                    //case EnumSteps.AssignModel:
                    //    if (Screen == EnumScreen.AssetClassesMake)
                    //    {
                    //        var assetMakeVm = this.ScreenDetailViewModel as MainAssetClassesViewModel;
                    //        if (assetMakeVm != null)
                    //        {
                    //            assetMakeVm.ChangedVisibility = Visibility.Collapsed;
                    //        }
                    //        return;
                    //    }
                    //    break;
                    case EnumSteps.SaveAssignModel:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        return;
                    case EnumSteps.AssignModel:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Collapsed;
                        FormBarMenuViewModel.FormBarContent = "Asset Make";
                        FormBarMenuViewModel.FormMenuContent = "Asset Make";
                        return;
                    case EnumSteps.CancelAssignModel:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        return;
                    case EnumSteps.SaveRegisterSummary:
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        FormBarMenuViewModel.FormBarContent = "Asset Registers";
                        FormBarMenuViewModel.FormMenuContent = "Menu";
                        return;
                    //case EnumSteps.SelectRegisteredAsset:
                    //    FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                    //    FormBarMenuViewModel.FormBarContent = "Assets Detail";
                    //    FormBarMenuViewModel.FormMenuContent = "Assets";
                    //    return;
                }

                // handle behavior for screens when select item
                switch (Screen)
                {
                    #region users
                    case EnumScreen.Users:
                        var mainWindowDetailsTabControlViewModel = this.ScreenDetailViewModel as MainWindowDetailsTabControlViewModel;
                        if (mainWindowDetailsTabControlViewModel != null)
                        {
                            var usersViewModel = mainWindowDetailsTabControlViewModel.UsersMainWindowDetailsVm.ScreenDetailViewModel as UsersViewModel;
                            if (usersViewModel != null)
                            {
                                if (usersViewModel.AllUsers != null)
                                {
                                    // load data for right hand grid
                                    if (this.ToggleViewModel.GridDynamicViewModel == null || this.ToggleViewModel.Screen != Screen)
                                    {
                                        var userCredentials = usersViewModel.AllUsers.Select(x => x.UserCredentials).ToList();
                                        var userMappings = from d in userCredentials
                                                           select new UserMapping
                                                                           {
                                                                               UserEntityId = d.UserEntityId,
                                                                               LoginName = d.LoginName,
                                                                               IsEnabled = d.IsEnabled,
                                                                           };

                                        // create column and data for dynamic grid
                                        this.ToggleViewModel.GridDynamicViewModel = null;
                                        this.ToggleViewModel.GridDynamicViewModel = new DynamicGridViewModel(typeof(UserMapping));
                                        this.ToggleViewModel.GridDynamicViewModel.GridColumns = new List<DynamicColumn>
                                                                                         {
                                                                                             new DynamicColumn { ColumnName = "LoginName", Header = "Login Name" },
                                                                                             new DynamicColumn { ColumnName = "IsEnabled",  Header = "Enabled" },
                                                                                         };
                                        this.ToggleViewModel.GridDynamicViewModel.GridDataRows = userMappings.ToList<object>();
                                        this.ToggleViewModel.GridDynamicViewModel.LoadRadGridView();
                                        this.ToggleViewModel.Header = "User List";
                                        this.ToggleViewModel.Screen = Screen;
                                    }
                                    firstSelectedItem = usersViewModel.SelectedUser;
                                }
                            }
                        }

                        // change behavior form bar menu
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        FormBarMenuViewModel.FormMenuContent = "Users";
                        if (this._formBarCurrent != string.Empty)
                        {
                            FormBarMenuViewModel.FormBarContent = this._formBarCurrent;
                        }
                        else
                        {
                            if (FormBarMenuViewModel.FormBarContent == "Users")
                            {
                                FormBarMenuViewModel.FormBarContent = "User Detail";
                            }
                        }

                        this._formBarCurrent = FormBarMenuViewModel.FormBarContent;

                        // Visible right hand grid
                        ChangedVisibility = Visibility.Visible;
                        break;
                    #endregion

                    #region groups
                    case EnumScreen.Groups:
                        var mainWindowDetailsTabControlViewModel1 = this.ScreenDetailViewModel as MainWindowDetailsTabControlViewModel;
                        if (mainWindowDetailsTabControlViewModel1 != null)
                        {
                            var groupsViewModel = mainWindowDetailsTabControlViewModel1.GroupsMainWindowDetailsVm.ScreenDetailViewModel as GroupsViewModel;
                            if (groupsViewModel != null)
                            {
                                if (groupsViewModel.Groups != null)
                                {
                                    // load data for right hand grid
                                    if (this.ToggleViewModel.GridDynamicViewModel == null || this.ToggleViewModel.Screen != Screen)
                                    {
                                        var lxmGroup = groupsViewModel.Groups.Select(x => x.LXMGroup).ToList();

                                        var groupMappings = from d in lxmGroup
                                                            select new GroupMapping
                                                            {
                                                                UserEntityId = d.UserEntityId,
                                                                GroupName = d.GroupName,
                                                            };

                                        // create column and data for dynamic grid
                                        this.ToggleViewModel.GridDynamicViewModel = null;
                                        this.ToggleViewModel.GridDynamicViewModel = new DynamicGridViewModel(typeof(GroupMapping));
                                        this.ToggleViewModel.GridDynamicViewModel.GridColumns = new List<DynamicColumn>
                                                                                                    {
                                                                                                        new DynamicColumn
                                                                                                            {
                                                                                                                ColumnName
                                                                                                                    =
                                                                                                                    "GroupName",
                                                                                                                Header
                                                                                                                    =
                                                                                                                    "Group Name"
                                                                                                            }
                                                                                                    };
                                        this.ToggleViewModel.GridDynamicViewModel.GridDataRows = groupMappings.ToList<object>();
                                        this.ToggleViewModel.GridDynamicViewModel.LoadRadGridView();
                                        this.ToggleViewModel.Header = "Group List";
                                        this.ToggleViewModel.Screen = Screen;
                                    }
                                    firstSelectedItem = groupsViewModel.SelectedGroup;
                                }

                            }
                        }

                        // change behavior form bar menu
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        FormBarMenuViewModel.FormMenuContent = "Groups";
                        if (this._formGroupBarCurrent != string.Empty)
                        {
                            FormBarMenuViewModel.FormBarContent = this._formGroupBarCurrent;
                        }
                        else
                        {
                            if (FormBarMenuViewModel.FormBarContent == "Groups")
                            {
                                FormBarMenuViewModel.FormBarContent = "Group Detail";
                            }
                            else
                            {
                                FormBarMenuViewModel.FormBarContent = "Groups";
                            }
                        }

                        this._formGroupBarCurrent = FormBarMenuViewModel.FormBarContent;

                        // Visible right hand grid
                        ChangedVisibility = Visibility.Visible;
                        break;
                    #endregion

                    #region collectionAssignment
                    case EnumScreen.CollectionAssignment:
                        var mainWindowDetailsViewModel = this.ScreenDetailViewModel as MainWindowDetailsViewModel;

                        if (mainWindowDetailsViewModel != null)
                        {
                            var collectionAssignmentViewModel = mainWindowDetailsViewModel.ScreenDetailViewModel as CollectionsAssignmentViewModel;
                            if (collectionAssignmentViewModel != null)
                            {
                                // load data for right hand grid
                                var collectionAssignmentMappings = from d in collectionAssignmentViewModel.FilteredItems
                                                                   select new CollectionAssignmentMapping
                                                                   {
                                                                       QueueID = d.QueueID,
                                                                       FollowUpDate = d.FollowUpDate,
                                                                       ContractId = d.ContractId
                                                                   };

                                // create column and data for dynamic grid
                                this.ToggleViewModel.GridDynamicViewModel = null;
                                this.ToggleViewModel.GridDynamicViewModel = new DynamicGridViewModel(typeof(CollectionAssignmentMapping));
                                this.ToggleViewModel.GridDynamicViewModel.GridColumns = new List<DynamicColumn>
                                                                                         {
                                                                                             new DynamicColumn { ColumnName = "QueueID", Header = "Q#" },
                                                                                             new DynamicColumn { ColumnName = "FollowUpDate",  Header = "Follow-Up", DataFormatString = "{0:g}" },
                                                                                             new DynamicColumn { ColumnName = "ContractId",  Header = "Contract" },
                                                                                         };
                                this.ToggleViewModel.GridDynamicViewModel.GridDataRows = collectionAssignmentMappings.ToList<object>();
                                this.ToggleViewModel.GridDynamicViewModel.LoadRadGridView();
                                this.ToggleViewModel.Header = "Assignment List";
                                this.ToggleViewModel.Screen = Screen;
                                collectionAssignmentViewModel.SelectedItemChanged = this.ToggleViewModel.SetSelectedItem;
                                firstSelectedItem = collectionAssignmentViewModel.SelectedQueue;
                            }
                        }

                        // change behavior form bar menu
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        FormBarMenuViewModel.FormMenuContent = "Assignments";

                        if (this._formBarCurrent != string.Empty)
                        {
                            FormBarMenuViewModel.FormBarContent = this._formBarCurrent;
                        }
                        else
                        {
                            if (FormBarMenuViewModel.FormBarContent == "Assignments")
                            {
                                FormBarMenuViewModel.FormBarContent = "Assignment Detail";
                            }
                        }
                        this._formBarCurrent = FormBarMenuViewModel.FormBarContent;

                        // Visible right hand grid
                        ChangedVisibility = Visibility.Visible;
                        break;
                    #endregion

                    #region collectionQueues
                    case EnumScreen.ColletionQueues:
                        this.FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        this.FormBarMenuViewModel.FormMenuContent = "Menu";
                        var viewModel = this.ScreenDetailViewModel as MainWindowDetailsTabControlCollectionQueueViewModel;

                        if (viewModel != null)
                        {
                            var list = viewModel.ListMainWindowDetailsVm.ScreenDetailViewModel as CollectionsManagementViewModel;
                            if (list != null)
                            {
                                if (list.AllQueueManagementDetails != null)
                                {
                                    // load data for right hand grid
                                    if (this.ToggleViewModel.GridDynamicViewModel == null || this.ToggleViewModel.Screen != Screen)
                                    {
                                        var collectionQueue =
                                            list.AllQueueManagementDetails.Select(x => x.CollectionQueue)
                                                .OrderBy(c => c.AssignmentOrder)
                                                .ToList();

                                        var collectionsManagementMappings = from d in collectionQueue
                                                                            select new CollectionsManagementMapping
                                                                           {
                                                                               Enabled = d.Enabled,
                                                                               ID = d.ID,
                                                                               QueueName = d.QueueName,
                                                                               AssignmentOrder = d.AssignmentOrder
                                                                           };

                                        // create column and data for dynamic grid
                                        this.ToggleViewModel.GridDynamicViewModel = null;
                                        this.ToggleViewModel.GridDynamicViewModel = new DynamicGridViewModel(typeof(CollectionsManagementMapping));
                                        this.ToggleViewModel.GridDynamicViewModel.GridColumns = new List<DynamicColumn>
                                                                                         {
                                                                                             new DynamicColumn { ColumnName = "Enabled", Header = "Enabled" },
                                                                                             new DynamicColumn { ColumnName = "AssignmentOrder", Header = "Order#" },
                                                                                             new DynamicColumn { ColumnName = "QueueName", Header = "Queue Name" },                                                                                            
                                                                                         };
                                        this.ToggleViewModel.GridDynamicViewModel.GridDataRows = collectionsManagementMappings.ToList<object>();
                                        this.ToggleViewModel.GridDynamicViewModel.LoadRadGridView();
                                        this.ToggleViewModel.Header = "Queue List";
                                        this.ToggleViewModel.Screen = Screen;
                                    }
                                    firstSelectedItem = list.SelectedQueue;
                                }
                            }
                        }

                        // change behavior form bar menu
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        FormBarMenuViewModel.FormMenuContent = "Queues";
                        if (this._formBarCurrent != string.Empty)
                        {
                            FormBarMenuViewModel.FormBarContent = this._formBarCurrent;
                        }
                        else
                        {
                            if (FormBarMenuViewModel.FormBarContent == "Collection Queues")
                            {
                                FormBarMenuViewModel.FormBarContent = "Collection Queue Detail";
                            }
                        }
                        this._formBarCurrent = FormBarMenuViewModel.FormBarContent;

                        // Visible right hand grid
                        ChangedVisibility = Visibility.Visible;
                        break;
                    #endregion

                    #region fundingSummary
                    case EnumScreen.FundingSummary:
                        var mainWindowDetailsViewModelFundingSummary = this.ScreenDetailViewModel as MainWindowDetailsViewModel;

                        if (mainWindowDetailsViewModelFundingSummary != null)
                        {
                            var fundingSummaryViewModel = mainWindowDetailsViewModelFundingSummary.ScreenDetailViewModel as FundingSummaryViewModel;
                            if (fundingSummaryViewModel != null)
                            {
                                if (fundingSummaryViewModel.TrancheSummary != null)
                                {
                                    // load data for right hand grid
                                    if (this.ToggleViewModel.GridDynamicViewModel == null || this.ToggleViewModel.Screen != Screen)
                                    {
                                        var fundingSummaryMappings = from d in fundingSummaryViewModel.TrancheSummary
                                                                     select new FundingSummaryMaping
                                                                            {
                                                                                TrancheId = d.TrancheId,
                                                                                FunderName = d.FunderName,
                                                                            };

                                        // create column and data for dynamic grid
                                        this.ToggleViewModel.GridDynamicViewModel = null;
                                        this.ToggleViewModel.GridDynamicViewModel = new DynamicGridViewModel(typeof(FundingSummaryMaping));
                                        this.ToggleViewModel.GridDynamicViewModel.GridColumns = new List<DynamicColumn>
                                                                                         {
                                                                                             new DynamicColumn { ColumnName = "FunderName",  Header = "Funder Name" },
                                                                                             new DynamicColumn { ColumnName = "TrancheId", Header = "Tranche ID" },
                                                                                         };
                                        this.ToggleViewModel.GridDynamicViewModel.GridDataRows = fundingSummaryMappings.ToList<object>();
                                        this.ToggleViewModel.GridDynamicViewModel.LoadRadGridView();
                                        this.ToggleViewModel.Header = "Tranche List";
                                        this.ToggleViewModel.Screen = Screen;

                                    }
                                    firstSelectedItem = fundingSummaryViewModel.SelectedTranche;
                                }
                            }
                        }

                        // change behavior form bar menu
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        FormBarMenuViewModel.FormMenuContent = "Tranches";
                        FormBarMenuViewModel.FormBarContent = "Funding Detail";
                        this._formBarCurrent = FormBarMenuViewModel.FormBarContent;

                        // Visible right hand grid
                        ChangedVisibility = Visibility.Visible;
                        break;
                    #endregion

                    #region asset classes category
                    case EnumScreen.AssetClassesCategory:
                        var mainDetailModel = this.ScreenDetailViewModel as MainAssetClassesViewModel;

                        if (mainDetailModel != null)
                        {
                            var assetClassesCategoryViewModel = mainDetailModel.AssetCategoryViewModel.ScreenDetailViewModel as AssetClassesCategoryViewModel;
                            if (assetClassesCategoryViewModel != null)
                            {
                                // load data for right hand grid
                                if (this.ToggleViewModel.GridDynamicViewModel == null
                                    || this.ToggleViewModel.Screen != Screen)
                                {
                                    // create column and data for dynamic grid
                                    this.ToggleViewModel.GridDynamicViewModel = null;
                                    this.ToggleViewModel.GridDynamicViewModel =
                                        new DynamicGridViewModel(typeof(AssetClassesCategoryRowItem));
                                    this.ToggleViewModel.GridDynamicViewModel.GridColumns = new List<DynamicColumn> 
                                                                                                { 
                                                                                                    new DynamicColumn { ColumnName="Category",Header="CATEGORY NAME", MinWidth = 90},
                                                                                                    new DynamicColumn { ColumnName="Enabled",Header="ENABLED", MinWidth = 80, ColumnTemplate = RadGridViewEnum.ColumnCheckedTemplate },
                                                                                                };
                                    this.ToggleViewModel.GridDynamicViewModel.GridDataRows =
                                        assetClassesCategoryViewModel.ListDataGridItem.ToList<object>();
                                    this.ToggleViewModel.GridDynamicViewModel.LoadRadGridView();
                                    this.ToggleViewModel.Header = "Asset Category List";
                                    this.ToggleViewModel.Screen = Screen;
                                }
                                firstSelectedItem = new EquipCategory
                                {
                                    EquipCatId = assetClassesCategoryViewModel.SelectedCategoryItem.EquipCategoryId
                                };
                            }
                        }

                        // change behavior form bar menu
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        FormBarMenuViewModel.FormMenuContent = "Asset Category";

                        if (this._formBarCurrent != string.Empty)
                        {
                            FormBarMenuViewModel.FormBarContent = this._formBarCurrent;
                        }
                        else
                        {
                            if (FormBarMenuViewModel.FormBarContent == "Asset Features")
                            {
                                FormBarMenuViewModel.FormBarContent = "Asset Features";
                            }
                        }
                        this._formBarCurrent = FormBarMenuViewModel.FormBarContent;

                        // Visible right hand grid
                        ChangedVisibility = Visibility.Visible;
                        break;
                    #endregion

                    #region asset classes type
                    case EnumScreen.AssetClassesType:
                        var mainDetailModelType = this.ScreenDetailViewModel as MainAssetClassesViewModel;

                        if (mainDetailModelType != null)
                        {
                            var assetClassesTypeViewModel = mainDetailModelType.AssetClassesTypeViewModel.ScreenDetailViewModel as AssetClassesTypeViewModel;
                            if (assetClassesTypeViewModel != null)
                            {
                                // load data for right hand grid
                                if (this.ToggleViewModel.GridDynamicViewModel == null
                                    || this.ToggleViewModel.Screen != Screen)
                                {
                                    // create column and data for dynamic grid
                                    this.ToggleViewModel.GridDynamicViewModel = null;
                                    this.ToggleViewModel.GridDynamicViewModel =
                                        new DynamicGridViewModel(typeof(AssetClassesTypeRowItem));
                                    this.ToggleViewModel.GridDynamicViewModel.GridColumns = new List<DynamicColumn> 
                                                                                                { 
                                                                                                    new DynamicColumn { ColumnName="TypeDescription",Header="TYPE", MinWidth = 65 },
                                                                                                    new DynamicColumn { ColumnName="Enabled",Header="ENABLED", MinWidth= 80, ColumnTemplate = RadGridViewEnum.ColumnCheckedTemplate },
                                                                                                };
                                    this.ToggleViewModel.GridDynamicViewModel.GridDataRows = assetClassesTypeViewModel.ListDataGridItem.ToList<object>();
                                    this.ToggleViewModel.GridDynamicViewModel.LoadRadGridView();
                                    this.ToggleViewModel.Header = "Asset Type List";
                                    this.ToggleViewModel.Screen = Screen;
                                }
                                firstSelectedItem = new EquipType
                                {
                                    EquipTypeId = assetClassesTypeViewModel.SelectedTypeItem.EquipTypeId
                                };
                            }
                        }

                        // change behavior form bar menu
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        FormBarMenuViewModel.FormMenuContent = "Asset Type";

                        if (this._formBarCurrent != string.Empty)
                        {
                            FormBarMenuViewModel.FormBarContent = this._formBarCurrent;
                        }
                        else
                        {
                            if (FormBarMenuViewModel.FormBarContent == "Asset Type")
                            {
                                FormBarMenuViewModel.FormBarContent = "Asset Type";
                            }
                        }
                        this._formBarCurrent = FormBarMenuViewModel.FormBarContent;

                        // Visible right hand grid
                        ChangedVisibility = Visibility.Visible;
                        break;
                    #endregion

                    #region asset feature
                    case EnumScreen.AssetFeatures:
                        var model = this.ScreenDetailViewModel as MainWindowDetailsViewModel;

                        if (model != null)
                        {
                            var assetFeaturesViewModel = model.ScreenDetailViewModel as AssetFeaturesViewModel;
                            if (assetFeaturesViewModel != null)
                            {
                                // load data for right hand grid
                                if (this.ToggleViewModel.GridDynamicViewModel == null
                                    || this.ToggleViewModel.Screen != Screen)
                                {
                                    var assetFeaturesMappings = from d in assetFeaturesViewModel.AllFeatureTypes
                                                                select
                                                                    new AssetFeatureTypeRowItem
                                                                        {
                                                                            FeatureTypeId = d.FeatureTypeId,
                                                                            FeatureName = d.FeatureName,
                                                                            Enabled = d.Enabled,
                                                                        };

                                    // create column and data for dynamic grid
                                    this.ToggleViewModel.GridDynamicViewModel = null;
                                    this.ToggleViewModel.GridDynamicViewModel =
                                        new DynamicGridViewModel(typeof(AssetFeatureTypeRowItem));
                                    this.ToggleViewModel.GridDynamicViewModel.GridColumns = new List<DynamicColumn> 
                                                                                                { 
                                                                                                    new DynamicColumn { ColumnName = "FeatureName", Header = "FEATURE NAME", MinWidth= 80 },
                                                                                                    new DynamicColumn { ColumnName = "Enabled", Header ="ENABLED", MinWidth = 80, ColumnTemplate = RadGridViewEnum.ColumnCheckedTemplate },
                                                                                                };
                                    this.ToggleViewModel.GridDynamicViewModel.GridDataRows =
                                        assetFeaturesMappings.ToList<object>();
                                    this.ToggleViewModel.GridDynamicViewModel.LoadRadGridView();
                                    this.ToggleViewModel.Header = "Feature List";
                                    this.ToggleViewModel.Screen = Screen;
                                }
                                firstSelectedItem = assetFeaturesViewModel.SelectedFeatureType;
                            }
                        }

                        // change behavior form bar menu
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        FormBarMenuViewModel.FormMenuContent = "Asset Features";

                        if (this._formBarCurrent != string.Empty)
                        {
                            FormBarMenuViewModel.FormBarContent = this._formBarCurrent;
                        }
                        else
                        {
                            if (FormBarMenuViewModel.FormBarContent == "Asset Features")
                            {
                                FormBarMenuViewModel.FormBarContent = "Asset Features";
                            }
                        }
                        this._formBarCurrent = FormBarMenuViewModel.FormBarContent;

                        // Visible right hand grid
                        ChangedVisibility = Visibility.Visible;
                        break;
                    #endregion

                    #region Asset Classes Model
                    case EnumScreen.AssetClassesModel:
                        var mainWindowDetailsModel = this.ScreenDetailViewModel as MainAssetClassesViewModel;
                        if (mainWindowDetailsModel != null)
                        {
                            var assetClassesModelViewModel =
                                mainWindowDetailsModel.AssetClassesModelViewModel.ScreenDetailViewModel as
                                    AssetClassesModelViewModel;
                            if (assetClassesModelViewModel != null)
                            {
                                if ((this.ToggleViewModel.GridDynamicViewModel == null) ||
                                    (this.ToggleViewModel.Screen != Screen))
                                {
                                    var assetModelMappings = from d in assetClassesModelViewModel.AllAssetModel
                                                             select new AssetClassesModelRowItem
                                                             {
                                                                 EquipModelId = d.EquipModelId,
                                                                 Description = d.Description,
                                                                 Enabled = d.Enabled
                                                             };
                                    this.ToggleViewModel.GridDynamicViewModel = null;
                                    this.ToggleViewModel.GridDynamicViewModel = new DynamicGridViewModel(typeof(AssetClassesModelRowItem));
                                    this.ToggleViewModel.GridDynamicViewModel.GridColumns = new List<DynamicColumn>
                                    {
                                        new DynamicColumn
                                        {
                                            ColumnName = "Description", Header = "MODEL", MinWidth = 70
                                        },
                                        new DynamicColumn
                                        {
                                            ColumnName = "Enabled", Header = "ENABLED", MinWidth = 80, ColumnTemplate = RadGridViewEnum.ColumnCheckedTemplate
                                        }
                                    };
                                    this.ToggleViewModel.GridDynamicViewModel.GridDataRows =
                                        assetClassesModelViewModel.AllAssetModel.ToList<object>();
                                    this.ToggleViewModel.GridDynamicViewModel.LoadRadGridView();
                                    this.ToggleViewModel.Header = "Model List";
                                    this.ToggleViewModel.Screen = Screen;
                                }
                                //firstSelectedItem = assetClassesModelViewModel.SelectedModel;
                                firstSelectedItem = new EquipModel()
                                {
                                    EquipModelId = assetClassesModelViewModel.SelectedModel.EquipModelId,
                                };
                            }
                        }

                        // change behavior form bar menu
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        FormBarMenuViewModel.FormMenuContent = "Asset Model";

                        if (this._formBarCurrent != string.Empty)
                        {
                            FormBarMenuViewModel.FormBarContent = this._formBarCurrent;
                        }
                        else
                        {
                            if (FormBarMenuViewModel.FormBarContent == "Asset Model")
                            {
                                FormBarMenuViewModel.FormBarContent = "Asset Model";
                            }
                        }
                        this._formBarCurrent = FormBarMenuViewModel.FormBarContent;

                        // Visible right hand grid
                        ChangedVisibility = Visibility.Visible;

                        break;
                    #endregion

                    #region asset classes make type

                    case EnumScreen.AssetClassesMake:
                        var mainDetailModelAsset = this.ScreenDetailViewModel as MainAssetClassesViewModel;

                        if (mainDetailModelAsset != null)
                        {
                            var assetClassesMakeViewModel = mainDetailModelAsset.AssetClassesMakeViewModel.ScreenDetailViewModel as AssetClassesMakeViewModel;
                            if (assetClassesMakeViewModel != null)
                            {
                                // load data for right hand grid
                                if (this.ToggleViewModel.GridDynamicViewModel == null
                                    || this.ToggleViewModel.Screen != Screen)
                                {
                                    //var assetClassesCategoryMappings = from itemCategory in (assetClassesCategoryViewModel.CategoryDetailViewModel.DynamicAssetClassCategoryViewModel.GridDataRows)
                                    //                            select
                                    //                                new AssetClassesCategoryRowItem
                                    //                                {
                                    //                                    Category = (itemCategory as AssetClassesCategoryRowItem).Category,
                                    //                                    Enabled = (itemCategory as AssetClassesCategoryRowItem).Enabled,
                                    //                                };

                                    // create column and data for dynamic grid
                                    this.ToggleViewModel.GridDynamicViewModel = null;
                                    this.ToggleViewModel.GridDynamicViewModel =
                                        new DynamicGridViewModel(typeof(AssetClassesMakeRowItem));
                                    this.ToggleViewModel.GridDynamicViewModel.GridColumns = new List<DynamicColumn> 
                                                                                                { 
                                                                                                     new DynamicColumn { ColumnName = "Description", Header = "MAKE", MinWidth = 70 },
                                                                                                     new DynamicColumn { ColumnName = "Enabled",  Header = "ENABLED", MinWidth = 80, ColumnTemplate = RadGridViewEnum.ColumnCheckedTemplate },
                                                                                                };
                                    this.ToggleViewModel.GridDynamicViewModel.GridDataRows =
                                        assetClassesMakeViewModel.AllAssetMake.ToList<object>();
                                    this.ToggleViewModel.GridDynamicViewModel.LoadRadGridView();
                                    this.ToggleViewModel.Header = "Make List";
                                    this.ToggleViewModel.Screen = Screen;
                                }
                                //firstSelectedItem = assetClassesMakeViewModel.DynamicAssetClassMakeViewModel.SelectedItem;
                                firstSelectedItem = new EquipMake()
                                {
                                    EquipMakeId = assetClassesMakeViewModel.SelectedMake.EquipMakeId
                                };
                            }
                        }

                        // change behavior form bar menu
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        FormBarMenuViewModel.FormMenuContent = "Asset Make";

                        if (this._formBarCurrent != string.Empty)
                        {
                            FormBarMenuViewModel.FormBarContent = this._formBarCurrent;
                        }
                        else
                        {
                            if (FormBarMenuViewModel.FormBarContent == "Asset Make")
                            {
                                FormBarMenuViewModel.FormBarContent = "Asset Make";
                            }
                        }
                        this._formBarCurrent = FormBarMenuViewModel.FormBarContent;

                        // Visible right hand grid
                        if (currentStep == EnumSteps.AssignModel)
                        {
                            ChangedVisibility = Visibility.Collapsed;
                        }
                        else
                        {
                            ChangedVisibility = Visibility.Visible;
                        }
                        break;

                    #endregion

                    #region asset collateral classes
                    case EnumScreen.AssetCollateralClasses:
                        var viewmodel = this.ScreenDetailViewModel as MainWindowDetailsViewModel;

                        if (viewmodel != null)
                        {
                            var assetCollateralViewModel = viewmodel.ScreenDetailViewModel as AssetCollateralClassesViewModel;
                            if (assetCollateralViewModel != null)
                            {
                                // load data for right hand grid
                                if (this.ToggleViewModel.GridDynamicViewModel == null
                                    || this.ToggleViewModel.Screen != Screen)
                                {
                                    var assetFeaturesMappings = assetCollateralViewModel.AllCollateralClasses;

                                    // create column and data for dynamic grid
                                    this.ToggleViewModel.GridDynamicViewModel = null;
                                    this.ToggleViewModel.GridDynamicViewModel =
                                        new DynamicGridViewModel(typeof(AssetCollateralRowItem));
                                    this.ToggleViewModel.GridDynamicViewModel.GridColumns = new List<DynamicColumn>
                                                                                                {
                                                                                                    new DynamicColumn
                                                                                                        {
                                                                                                            ColumnName = "Description", Header = "COLLATERAL CLASS", MinWidth= 95
                                                                                                        },
                                                                                                };
                                    this.ToggleViewModel.GridDynamicViewModel.GridDataRows =
                                        assetFeaturesMappings.ToList<object>();
                                    this.ToggleViewModel.GridDynamicViewModel.LoadRadGridView();
                                    this.ToggleViewModel.Header = "Collateral Class List";
                                    this.ToggleViewModel.Screen = Screen;
                                }
                                firstSelectedItem = assetCollateralViewModel.SelectedCollateral;
                            }
                        }

                        // change behavior form bar menu
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        FormBarMenuViewModel.FormMenuContent = "Asset Collateral Classes";

                        if (this._formBarCurrent != string.Empty)
                        {
                            FormBarMenuViewModel.FormBarContent = this._formBarCurrent;
                        }
                        else
                        {
                            if (FormBarMenuViewModel.FormBarContent == "Asset Collateral Classes")
                            {
                                FormBarMenuViewModel.FormBarContent = "Asset Collateral Classes";
                            }
                        }
                        this._formBarCurrent = FormBarMenuViewModel.FormBarContent;

                        // Visible right hand grid
                        ChangedVisibility = Visibility.Visible;
                        break;
                    #endregion

                    #region registers
                    case EnumScreen.AssetRegisters:
                        var mainWindowDetailsViewModelRegister = this.ScreenDetailViewModel as MainWindowDetailsViewModel;
                        if (mainWindowDetailsViewModelRegister != null)
                        {
                            var registersViewModel = mainWindowDetailsViewModelRegister.ScreenDetailViewModel as AssetRegistersViewModel;
                            if (registersViewModel != null)
                            {
                                    // load data for right hand grid
                                    if (this.ToggleViewModel.GridDynamicViewModel == null || this.ToggleViewModel.Screen != Screen)
                                    {
                                        var assetRegistersMappings = from d in registersViewModel.AllAssetRegister
                                                                     select
                                                                         new AssetRegisterRowItem
                                                                         {
                                                                             ID = d.ID,
                                                                             RegisterName = d.RegisterName,
                                                                             ReportName = d.ReportName,
                                                                             InternalOnly = d.InternalOnly
                                                                         };

                                        // create column and data for dynamic grid
                                        this.ToggleViewModel.GridDynamicViewModel = null;
                                        this.ToggleViewModel.GridDynamicViewModel = new DynamicGridViewModel(typeof(AssetRegisterRowItem));
                                        this.ToggleViewModel.GridDynamicViewModel.GridColumns = new List<DynamicColumn>
                                                                                         {
                                                                                             new DynamicColumn { ColumnName = "RegisterName", Header = "REGISTER NAME", MinWidth = 90 },
                                                                                             new DynamicColumn { ColumnName = "InternalOnly",  Header = "INTERNAL ONLY", MinWidth = 90, ColumnTemplate = RadGridViewEnum.ColumnCheckedTemplate },
                                                                                         };
                                        this.ToggleViewModel.GridDynamicViewModel.GridDataRows = assetRegistersMappings.ToList<object>();
                                        this.ToggleViewModel.GridDynamicViewModel.LoadRadGridView();
                                        this.ToggleViewModel.Header = "Asset Register";
                                        this.ToggleViewModel.Screen = Screen;
                                    }
                                    firstSelectedItem = new AssetRegister()
                                    {
                                        ID = registersViewModel.SelectedRegister.ID
                                    };
                                    //firstSelectedItem = registersViewModel.SelectedRegister;
                            }
                        }

                        // change behavior form bar menu
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        FormBarMenuViewModel.FormMenuContent = "Asset Register";
                        if (this._formBarCurrent != string.Empty)
                        {
                            FormBarMenuViewModel.FormBarContent = this._formBarCurrent;
                        }
                        else
                        {
                            if (FormBarMenuViewModel.FormBarContent == "Asset Registers")
                            {
                                FormBarMenuViewModel.FormBarContent = "Asset Registers Detail";
                            }
                        }

                        this._formBarCurrent = FormBarMenuViewModel.FormBarContent;

                        // Visible right hand grid
                        ChangedVisibility = Visibility.Visible;
                        break;
                    #endregion

                    #region registeredAsset
                    case EnumScreen.RegisteredAsset:
                        var mainWindowDetailsViewModelRegisteredAsset = this.ScreenDetailViewModel as MainWindowDetailsViewModel;
                        if (mainWindowDetailsViewModelRegisteredAsset != null)
                        {
                            var registersViewModel = mainWindowDetailsViewModelRegisteredAsset.ScreenDetailViewModel as RegisteredAssetViewModel;
                            if (registersViewModel != null)
                            {
                                // load data for right hand grid
                                if (this.ToggleViewModel.GridDynamicViewModel == null || this.ToggleViewModel.Screen != Screen)
                                {
                                    var assetRegistersMappings = from d in registersViewModel.AllRegisteredAsset
                                                                 select
                                                                     new RegisteredAssetRowItem()
                                                                     {
                                                                         Id = d.Id,
                                                                         AssetRegisterId = d.AssetRegisterId,
                                                                         AssetState = d.AssetState,
                                                                     };

                                    // create column and data for dynamic grid
                                    this.ToggleViewModel.GridDynamicViewModel = null;
                                    this.ToggleViewModel.GridDynamicViewModel = new DynamicGridViewModel(typeof(RegisteredAssetRowItem));
                                    this.ToggleViewModel.GridDynamicViewModel.GridColumns = new List<DynamicColumn>
                                                                                         {
                                                                                             new DynamicColumn { ColumnName = "Id", Header = "Asset ID" },
                                                                                             new DynamicColumn { ColumnName = "AssetRegisterId",  Header = "Reg#" },
                                                                                             new DynamicColumn { ColumnName = "AssetState", Header = "Asset State"},
                                                                                         };
                                    this.ToggleViewModel.GridDynamicViewModel.GridDataRows = assetRegistersMappings.ToList<object>();
                                    this.ToggleViewModel.GridDynamicViewModel.LoadRadGridView();
                                    this.ToggleViewModel.Header = "Assets List";
                                    this.ToggleViewModel.Screen = Screen;
                                }
                                firstSelectedItem = new RegisteredAsset
                                {
                                    ID = registersViewModel.SelectedRegistererdAsset.Id
                                };
                                //firstSelectedItem = registersViewModel.SelectedRegister;
                            }
                        }

                        // change behavior form bar menu
                        FormBarMenuViewModel.ChangedVisibility = Visibility.Visible;
                        FormBarMenuViewModel.FormMenuContent = "Assets";
                        if (this._formBarCurrent != string.Empty)
                        {
                            FormBarMenuViewModel.FormBarContent = this._formBarCurrent;
                        }
                        else
                        {
                            if (FormBarMenuViewModel.FormBarContent == "Assets")
                            {
                                FormBarMenuViewModel.FormBarContent = "Asset Detail";
                            }
                        }

                        this._formBarCurrent = FormBarMenuViewModel.FormBarContent;

                        // Visible right hand grid
                        ChangedVisibility = Visibility.Visible;
                        break;
                    #endregion
                }
            }

            // To call some Actions or Events of Toggle ViewModel 
            if (ToggleViewModel != null)
            {
                ToggleViewModel.OnSelectedItemChange = ToggleViewModel_SelectedItemChanged;
                ToggleViewModel.RaiseSelectedItemChanged();
                if (firstSelectedItem != null)
                {
                    ToggleViewModel.SetSelectedItem(firstSelectedItem);
                }
            }
        }