public void Initialize() { _importPath = System.IO.Path.Combine(Environment.CurrentDirectory, @"Ressources\Configuration.xlsx"); _exportPath = System.IO.Path.Combine(Environment.CurrentDirectory, @"Ressources\UnitTest.xlsx"); _wvm = WorkspaceViewModel.Instance; _groupTableVm = new GroupTableViewModel(); _wvm.LoadWorkspace(_importPath); _impExcel = ImportExcel.Instance; _exExcel = TreatPraktik.ViewModel.ExportExcel.Instance; //Get original lists of worksheets _oldExGroup = (from a in _impExcel._workSheetktExaminedGroup.ExaminedGroupList select new ktExaminedGroup { DataQualityScore = a.DataQualityScore, Expanded = a.Expanded, GroupExpendable = a.GroupExpendable, GroupIdentifier = a.GroupIdentifier, GroupType = a.GroupType, ID = a.ID, Name = a.Name, RequiredScore = a.RequiredScore }).ToList(); _oldGroupOrder = (from a in _impExcel._workSheetktUIGroupOrder.ktUIGroupOrderList select new ktUIGroupOrder { DepartmentID = a.DepartmentID, GroupOrder = a.GroupOrder, GroupTypeID = a.GroupTypeID, PageTypeID = a.PageTypeID }).ToList(); _oldOrder = (from a in _impExcel._workSheetktUIOrder.ktUIOrderList select new ktUIOrder { DesignID = a.DesignID, GroupOrder = a.GroupOrder, GroupTypeID = a.GroupTypeID, IncludedTypeID = a.IncludedTypeID, PageTypeID = a.PageTypeID }).ToList(); _oldResources = (from a in _impExcel._workSheetktResources.ktResourceList select new ktResources { ResourceID = a.ResourceID, ResourceResxID = a.ResourceResxID, ResourceTypeID = a.ResourceTypeID }).ToList(); _oldResTranslation = (from a in _impExcel._workSheetktResourceTranslation.ktResourceTranslationList select new ktResourceTranslation { LanguageID = a.LanguageID, ResourceID = a.ResourceID, TranslationText = a.TranslationText }).ToList(); }
public void Initialize() { string importPath = System.IO.Path.Combine(Environment.CurrentDirectory, @"Ressources\Configuration.xlsx"); ifvm = ToolboxStandardItemsViewModel.Instance; glvm = ToolboxGroupsViewModel.Instance; WorkspaceViewModel.Instance = null; wvm = WorkspaceViewModel.Instance; wvm.LoadWorkspace(importPath); ifvm.PopulateToolbox(); glvm.PopulateGTList(); sfvm = new ToolboxSpecialItemsViewModel(); gtvm = new GroupTableViewModel(); }
private void dropZoneToolboxGroup_Drop(object sender, DragEventArgs e) { ListBoxItem lbi = (ListBoxItem)e.Data.GetData("System.Windows.Controls.ListBoxItem"); ToolboxGroup tbg = (ToolboxGroup)lbi.DataContext; WorkspaceViewModel wvm = WorkspaceViewModel.Instance; string pageTypeID = wvm.SelectedPage; ObservableCollection <PageType> pageList = wvm.PageList; ObservableCollection <GroupTypeOrder> GroupTypeOrderCollection = pageList.First(x => x.PageTypeID.Equals(pageTypeID)).GroupTypeOrders; if (GroupTypeOrderCollection.Any(x => x.Group.GroupTypeID.Equals(tbg.Group.GroupTypeID))) { MessageBox.Show("The group already exists", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } else { GroupType gt = tbg.Group; GroupTableViewModel gtvm = new GroupTableViewModel(); gtvm.GroupTypeOrderCollection = GroupTypeOrderCollection; gtvm.InsertGroupLast(gt, pageTypeID); } }
//GroupTable - Color theme public GroupTableUserControl() { InitializeComponent(); GTViewModel = new GroupTableViewModel(); ParentGroupTableContainerUserControl = (GroupTableContainerUserControl)Parent; }