Skip to main content

Windows Workflow : Dependency Property "does not define a static dependency property with name"

If you encounter the below exception while registering a DependencyProperty

"Error 103 Could not create activity of type 'xxxxxxxxxxxxxx'. System.ArgumentException: Type 'xxxxxxxxxx' does not define a static dependency property with name 'xxxxxxProperty'.
Parameter name: ownerType
   at System.Workflow.ComponentModel.DependencyProperty.ValidateAndRegister(String name, Type propertyType, Type ownerType, PropertyMetadata defaultMetadata, Type validatorType, Boolean isRegistered)
   at System.Workflow.ComponentModel.DependencyProperty.Register(String name, Type propertyType, Type ownerType)
   at xxxxx..cctor()"

Fix:

If you are registering Dependency Property with name 'XYZ' then the declaration should be exactly like this,

public static DependencyProperty XYZProperty = DependencyProperty.Register("XYZ", typeof(bool), typeof(ApprovalWorkflow));
        public bool IsRestarted
        {
            get { return ((bool)(GetValue(XYZProperty ))); }
            set { SetValue(XYZProperty , value); }
        }

Variable name  should end with 'Property' and start with one passed to 'Register' method
VariableFormat Example  (<XYZ><Property>).

Please share your comments if it helps.

Comments

Malineni said…
Thanks Senthi...This helped me out to resolve the issue I had

Popular posts from this blog

How to access PC's internet from Android Emulator?

PC's Internet and Android emulator If PC's Internet connection is configured with manual proxy settings, Follow the below steps. 1) You can launch your Emulator from command line with DNS server detail.  Syntax : "emulator -dns-server <DNS Server IP address> "  Example: emulator -dns-server 8.8.8.8 (8.8.8.8 is Google's Public DNS Server)    (or)   Goto Eclipse->Window->Preferences->Android->Launch and give "-dns-server " and then launch your emulator. 2) In emulator goto " Settings->Wireless & Networks->Mobile Networks-> "       2.1) Ensure that " Data roaming " is checked.       2.2) Select Access Point Names       2.3) Select an APN. (eg. Telkila )       2.4) Manually set the Proxy Server and Port details. If PC's Internet connection is configured with Automatic proxy settings, Follow above steps except step 2.4  and ensure that No proxy...

Tabs at the bottom of TabActivity

Tabs at the bottom of TabActivity By default tabs in Android are displayed at the top. It is a general guideline for android developers to keep the tabs at top of the Tabs based application since lot of Android mobiles are having their home, back,search buttons or touch interface at the bottom But its purely our decision :) There are two ways to achieve this. Using RelativeLayout Using "android:layout_weight" attibute  1) Using RelativeLayout: .xml will look like the following. <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@android:id/tabhost"     android:layout_width="fill_parent"     android:layout_height="fill_parent">     <RelativeLayout         android:layout_width="fill_parent"         android:layout_height="fill_parent">    ...

Why I have Quit my job?

Why I have Quit my job? A plain answer would be "I don't like to report when leadership fails". Five major reasons are there. Reason 1: "College Dream" It is always my dream to run a technology based firm. Reason 2: During my school days I have attempted to write code using OpenGL with no knowledge or limited knowledge on game programming. I love playing games and developing games. Reason 3: I would like to build an organic firm where leadership with vision will be the essence, people matters more and process matters less. Reason 4: I thought it would be the right the time to pitch in and build the world I have dreamt. Reason 5: Technology is a powerhouse and it should be used wherever improvement and inclusiveness is needed. So, to build businesses powered by technology that enhances wellbeing of people directly/indirectly. More updates on the way ... Follow @logickumar