Try our conversational search powered by Generative AI!

Override property value in edit mode

Vote:
 

Do you know how to override property value in edit mode?

For example:

public virtual string AboutUsLinksTitle
{
      get
      {
           var value = this.GetPropertyValue(p => p.AboutUsLinksTitle);
           return string.IsNullOrWhiteSpace(value) ? "overrided value" : value;
      }
      set
      {
           this.SetPropertyValue(p => p.AboutUsLinksTitle, value);
      }
}

In debug it returns "overrided value", but shows empty value. It's probably, because of proxy class which is created in the background...

Thanks!

#173603
Jan 03, 2017 13:45
Vote:
 

Hi Paweł,

The code inside getter will never be executed in All Properties view. Only in On-Page Editing view, and actual page/block view.

#173619
Jan 03, 2017 17:28
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.