public static void InitCxObjectList(ref CxObjectList cxObjectList) { var dir = Directory.GetParent(Directory .GetParent(Directory .GetParent(Directory .GetCurrentDirectory()) .FullName) .FullName) .FullName; var Icon = new BitmapImage(); Icon.BeginInit(); Icon.UriSource = new Uri(dir + @"\CxControlLibrary\Icon\ObjectListItem\IconObjectListItem.png"); Icon.EndInit(); cxObjectList.ObjectlistItemsCollection.Add( new CxControlLibrary .ObjectListItem() { IsCheked = false, AttachmentName = "email_bar_slide_41_minimum_classification_02", Policy = "Policy1", IconSource = Icon, ColorRect = new SolidColorBrush(Colors.Red) }); cxObjectList.ObjectlistItemsCollection.Add( new CxControlLibrary .ObjectListItem() { IsCheked = false, AttachmentName = "Finale Version_slide_28_04", Policy = "Policy1", IconSource = Icon, ColorRect = new SolidColorBrush(Colors.Yellow) }); cxObjectList.ObjectlistItemsCollection.Add( new CxControlLibrary .ObjectListItem() { IsCheked = false, AttachmentName = "email_bar_slide_41_03", Policy = "Policy1", IconSource = Icon, ColorRect = new SolidColorBrush(Colors.White) }); }
private void InitializeObjectList() { var ObjectList = new CxControlLibrary.CxObjectList(); ObjectList.ObjectlistItemsCollection.Add(new CxControlLibrary.ObjectListItem() { IsCheked = true, AttachmentName = "Attachment Name1", Policy = "Policy1", ColorRect = new SolidColorBrush(Colors.Red) }); ObjectList.ObjectlistItemsCollection.Add(new CxControlLibrary.ObjectListItem() { IsCheked = false, AttachmentName = "Attachment Name2", Policy = "Policy2", ColorRect = new SolidColorBrush(Colors.Green) }); ObjectList.ObjectlistItemsCollection.Add(new CxControlLibrary.ObjectListItem() { IsCheked = true, AttachmentName = "Attachment Name3", Policy = "Policy3", ColorRect = new SolidColorBrush(Colors.Blue) }); ObjectList.ObjectlistItemsCollection.Add(new CxControlLibrary.ObjectListItem() { IsCheked = true, AttachmentName = "Attachment Name4", Policy = "Policy1", ColorRect = new SolidColorBrush(Colors.Yellow) }); ObjectList.ObjectlistItemsCollection.Add(new CxControlLibrary.ObjectListItem() { IsCheked = false, AttachmentName = "Attachment Name5", Policy = "Policy2", ColorRect = new SolidColorBrush(Colors.Tomato) }); ObjectList.ObjectlistItemsCollection.Add(new CxControlLibrary.ObjectListItem() { IsCheked = true, AttachmentName = "Attachment Name6", Policy = "Policy3", ColorRect = new SolidColorBrush(Colors.Tan) }); XAMLStackPanel.Children.Add(ObjectList); ObjectList.Name = "ObjectList"; ObjectList.Title = "ATTACHMENT NAME(Choose attachment to edit)"; ObjectList.CxTitlePolicy = "Title Policy"; ObjectList.CheckForAllItems = true; var tmp = ObjectList.ObjectlistItemsCollection; ObjectList.Tag = "My Tag"; // ObjectList.CxOnSelectionChange += ObjectList_CxOnSelectionChange; ObjectList.ShowTitles = false; }