ExpressionEditorPanel change component colors

Posted by: ydolapchiev on 13 December 2021, 5:21 am EST

    • Post Options:
    • Link

    Posted 13 December 2021, 5:21 am EST - Updated 4 October 2022, 8:36 am EST

    I am attempting to change the colors of the components of the ExpressionEditorPanel, but that seems to be an overly complicated task. I accidentally managed to change the right component’s style while changing something else entirely, and am now looking to do something similar to the left one.



    How can I see which style is set to the right component and set it to the left one as well?

  • Posted 13 December 2021, 6:24 am EST

    Hello,

    Thanks for providing the snapshot.

    In order to set background on C1TreeView and ListBox inside C1ExpressionEditorPanel, you need to handle Loaded event of C1ExpressionEditorPanel, then you can find both (C1TreeView and ListBox) from it’s template and now you can style them accordingly as : (see code snippet)

    
    private void ExpressionEditorPanel_Loaded(object sender, RoutedEventArgs e)
            {
                var panel = sender as C1ExpressionEditorPanel;
                var itemListBox = panel.Template.FindName("ItemsListBox",panel) as ListBox;
                var treeView = panel.Template.FindName("CategoriesTreeView", panel) as C1TreeView;
                treeView.Background = Brushes.LightGray;
                itemListBox.Background = Brushes.LightGray;
            }
    
    

    Please refer the attached sample for the same : ExpressionEditorStyling.zip

    Best Regards,

    Nitin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels