DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Software Design and Architecture
  3. Security
  4. Creating an IntelliSense Compatible Enum-Based Dependency Property

Creating an IntelliSense Compatible Enum-Based Dependency Property

Tim Dams user avatar by
Tim Dams
·
May. 30, 12 · Interview
Like (0)
Save
Tweet
Share
6.19K Views

Join the DZone community and get the full member experience.

Join For Free

actually, this post has a way too fancy title , because in fact i will merely show that enum-based dependency properties are intellisense compatible “out-of-the-box”. (by the way, if you know all about dependcy properties: simply read the line in bold and you’ll know all there is to know).

when creating a (wp7/sl/wpf) usercontrol, one often ends up creating one more dependency properties (dp). most of the times you only want a discrete set of possible values that can be assigned to the dp. the logical choice then of course is to have an enum-based dp.

now, for the intellisense to work it is important that you define the enum type outside the usercontrols class. for example, suppose we have define the following enum:

now, all that remains is to add a dp that uses this enum (remember that you can use the ‘dependencyproperty’ snippet that comes with vs):

once you now add the usercontrol elsewhere in your xaml-code, intellisense will happily show what values can be assigned to the dp:

there we go. that’s all there was too it.

next post i’ll show how to create a wp7 user control to plot graphs using data binding. consider some of the code here a sneak preview.

Property (programming) Dependency

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Introduction to Containerization
  • mTLS Everywere
  • Introduction to Container Orchestration
  • Building Microservice in Golang

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: