Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                0

                                We have introduced the CustomApplyAppearance and AppearanceApplied events into the DevExpress.ExpressApp.ConditionalAppearance.AppearanceController class.
                                Both use the DevExpress.ExpressApp.ConditionalAppearance.ApplyAppearanceEventArgs class as event arguments:

                                	
                                [C#]
                                public class ApplyAppearanceEventArgs : HandledEventArgs { public ApplyAppearanceEventArgs(IAppearance appearance, AppearanceItemType itemType, string itemName, object item, object[] contextObjects); public IAppearance Appearance { get; } public object[] ContextObjects { get; } public object Item { get; } public string ItemName { get; } public AppearanceItemType ItemType { get; } }
                                It is important to note that you can cast the Item property to the IViewElementProvider interface and then use its ViewElement property to access an underlying object for additional customizations.
                                The above events are very similar to the EditorStateCustomizing/CustomEditorStateCustomization and EditorStateCustomized events exposed in the ConditionalEditorState module (ConditionalEditorState - provide an event to allow additional user customization of target editors), and so they can be used for the same tasks - providing custom appearance customizations.

                                Let's demonstrate the use of the CustomApplyAppearance event with a small sample:

                                	
                                [C#]
                                public class S30263 : ViewController<ListView> { protected override void OnActivated() { base.OnActivated(); Frame.GetController<AppearanceController>().CustomApplyAppearance += new EventHandler<ApplyAppearanceEventArgs>(S30263_AppearanceApplied); } protected override void OnDeactivated() { Frame.GetController<AppearanceController>().CustomApplyAppearance -= new EventHandler<ApplyAppearanceEventArgs>(S30263_AppearanceApplied); base.OnDeactivated(); } private void S30263_AppearanceApplied(object sender, ApplyAppearanceEventArgs e) { if (e.ItemType == AppearanceItemType.ViewItem.ToString() && e.ItemName == "TargetFormattingProperty" && e.ContextObjects.Length>0) { //Dennis: Use the code below to cancel appearance customizations for the selected records in the ListView. e.Handled = View.SelectedObjects.Contains(e.ContextObjects[0]); //Or //Dennis: Cast the e.Item property to the IViewElementProvider interface and then use its ViewElement property to access underlying object for additional customizations. //DevExpress.ExpressApp.Editors.IViewElementProvider provider = (DevExpress.ExpressApp.Editors.IViewElementProvider)e.Item; //DoSomethingInCaseOfXtraGrid(provider.ViewElement as DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs); } } }

                                Thanks,
                                Dennis

                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Your Privacy - Legal Statements

                                Copyright © 1998-2013 Developer Express Inc.
                                ALL RIGHTS RESERVED
                                All trademarks or registered trademarks
                                are property of their respective owners