c# - Exception while setting DataContext -


i have created custom usercontrol exposes dependencyproperties headertitle , headertitleforeground

public partial class pageheadercontrol : usercontrol {     public string headertitle      {         { return (string)getvalue(headertitleproperty); }         set { setvalue(headertitleproperty, value); }     }      public static readonly dependencyproperty headertitleproperty = dependencyproperty.register("headertitle", typeof(string), typeof(pageheadercontrol), new propertymetadata(""));      public string headertitleforeground     {         { return (string)getvalue(headertitleforegroundproperty); }         set { setvalue(headertitleforegroundproperty, value); }     }      public static readonly dependencyproperty headertitleforegroundproperty = dependencyproperty.register("headertitleforeground", typeof(string), typeof(pageheadercontrol), new propertymetadata(""));      public pageheadercontrol()     {         initializecomponent();         (this.content frameworkelement).datacontext = this;     } } 

but while debugging app throws exception show below:

  system.exception occurred    _hresult=-2146233088    _message=error hresult e_fail has been returned call com component.    hresult=-2146233088    message=error hresult e_fail has been returned call com component.    source=system.windows    stacktrace:       @ ms.internal.xcpimports.checkhresult(uint32 hr)    innerexception:  

however custom control correctly drawn. so, how can resolve this? critical issue?

your class pageheadercontrol dependency props registered elevationpageheadercontrol owner..?


Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -