Search This Blog

Thursday, June 15, 2017

The recommended approach to hiding the 'Protected Content' columns and Property Editors is improved - YOUR FEEDBACK IS NEEDED!


I have recently updated the HideProtectedContentController code in the How to: Hide the 'Protected Content' Columns in a List View and Property Editors in a Detail View topic. The main change is that the HideProtectedContentController now checks if a visibility state for the target UI element is customized by existing Conditional Appearance rules before applying its own customizations.

void appearanceController_CustomApplyAppearance(object sender, ApplyAppearanceEventArgs e) {
    if(e.AppearanceObject.Visibility == null || e.AppearanceObject.Visibility == ViewItemVisibility.Show) {
        // ...
    }
}

This prevents possible conflicts with existing appearance rules.

If you are using the HideProtectedContentController code in your projects, we would greatly appreciate it if you try the updated code and share your feedback here in comments.

Please note that HideProtectedContentController may make a negative impact on the application performance in complex scenarios.

No comments:

Post a Comment