/// <summary> /// Map Workshare.Option.ObjectModel to WCM UI data model. /// </summary> /// <param name = "model">UI data model to be changed</param> /// <param name = "optionsRoot">Option object model to convert from</param> /// <param name = "bAdmin">Switch Admin / User mode</param> private void OptionModelToUIModel(MainViewModel model) { var areas = new Dictionary<string, AreaOption>(); model.Options.Clear(); model.Categories.Clear(); foreach (var category in _optionsRoot.Categories) { ProcessCategory(model, areas, category); } foreach (var item in areas) { model.AddOption(item.Value); } foreach (Category cat in model.Categories) { cat.SubCategories.Sort(item => item.Order); } model.BuildCompositeOptions(); }