This is a migrated thread and some comments may be shown as answers.

Dependency Property Refactor

3 Answers 33 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
MiddleTommy
Top achievements
Rank 1
MiddleTommy asked on 05 Sep 2010, 01:07 AM
Hey I just thought of a cool refactor
I hate writing dependency properties. I always have to copy an existing on and make changes
It would be nice if I could just write a regular property and then have a refactor to upgrade the property to a dependency property (if it is in a dependency object).

or there is probably a code snippet out there somewhere I could use. but then I would have to remember what the snippet shortcut is. (man I am lazy with what I keep in my brain's cache)

3 Answers, 1 is accepted

Sort by
0
Ivo Bratoev
Telerik team
answered on 10 Sep 2010, 02:10 PM
Hello Tommy,

Thanks for your valuable feedback. Your suggestion makes a lot of sense and we added it to our product backlog. I also created a PITS issue for it where you can vote and follow its progress.
Your help is much appreciated. I added 800 Telerik points to your account.

Best wishes,
Ivo Bratoev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
MiddleTommy
Top achievements
Rank 1
answered on 27 Jun 2011, 04:18 PM
This feature is the best. I love it.
First
It would be nice to have another refactor called "convert to dependency property with callback"
And use the overload that uses the callback and default value. 
Like:
new PropertyMetadata(null,new PropertyChangedCallback(MyProperty_Changed))
And also generate the XX_Changed method.
Hey I am lazy.. I mean I could be more productive if you implemented this.

Second
When you are using this refactor on a double property it puts the default value of the dependency property to "0"
The auto default should be "default(double)" or "0.0". The default() method should be called by the refactor or just put in the code.
This will clear up any runtime errors caused by a default value that is not the correct type.
0
Stefan Avramov
Telerik team
answered on 30 Jun 2011, 12:41 PM
Hello Middletommy,

 Thanks for the feedback. We logged your feature request. Also added a PITS item for your here. As for the issue you're having, we fixed that immediately since it is a small change and it will be included in our next major release. You also receive some Telerik Points.

All the best,
Stefan Avramov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
MiddleTommy
Top achievements
Rank 1
Answers by
Ivo Bratoev
Telerik team
MiddleTommy
Top achievements
Rank 1
Stefan Avramov
Telerik team
Share this question
or