This is a mirror of official site: http://jasper-net.blogspot.com/

How to implement Template Binding in Silverlight Custom Control?

| Wednesday, May 18, 2011
Introduction

Continuing to our 2nd chapter of the series here on Silverlight Custom Control. In this chapter we will discuss on dynamically setting the Content and other properties to our Custom Control that we implemented earlier. After reading this article, you will be able to create properties and set content dynamically to your control. 

So, lets start describing them and learn something again today. These series of posts are mainly targeted for beginners but anyone can read it to refresh their learning. Don't forget to leave your comment at the end of the post. Any queries, please drop a line. I will try to help you as early as I can. Don't Forget to support me by providing vote. 

Background

I hope, you read my previous posts. Those will help you to understand this one very easily. If you didn't read them or want to brush up before starting this chapter, find them here: 
How to create a Custom Control in Silverlight?
How to design a Custom Control by editing the Part Template?

Once you are familiar with the previous context, lets start with this one. We will use the same example here which will give you more visualization on the sample code. 

Working with the Template Part

Template parts are defined in the XAML inside the style. In our example, we have three part called "PART_HeaderPanel", "PART_HeaderText" and "PART_Content". Those are already declared in the style and you can find them here: 

image3.png?imgmax=800

Read more: Codeproject

Posted via email from Jasper-net

0 comments: