Element Binding In Silverlight
Well achieving a twitter page like functionality was never the intention but this simple example will introduce to element binding concept in Silverlight.In Element Binding we can bind a control property to another control property that too declaratively inside XAML.
In this post We will emulate the twitter feature where the number of character entered by user will get displayed while user enters text in the text box , that too with out a single line in code behind.
Here i have added 2 text blocks to hold max length and the other one to hold count the character.NAs we wanted the Text Block Text property should get show the Textbox.Length property , we will bind the Text Block’s Text to the length property of textbox.
The Code to Bind the element as follow
In above code the 3rd line is the key where we assigning the Binding to the Text Property , remember dependency property.
The xaml source code only , based on the above fundamental achieves the twitter messaging like functionality.
- Performance tips for RIA Service with Silverlight 4
- Busy Indicator with DomainDataSource control
- Authentication against custom Table In Silverlight4 Using RIA Service
- Data Aggregation Using Presentation Model in RIA and Silverlight 4
- Performing CRUD on Relational Data (Multiple table) using RIA in SL4
- Converting XML data to CLR object using XmlSerializer
- Consuming External WebService from Silverlight Application
- Data Binding in Silverlight with RIA and Entity Framework – Part 3 (Validating Input Data)
- Validating Textbox on Lost Focus in RIA Service,Silverlight4
- Data Binding in Silverlight with RIA and Entity Framework – Part 2 (Updating Data)
About Manas Patnaik (51 posts)
My name is Manas Patnaik as my domain name suggests, and I design & write software. I live in Bangalore. I used to live in Berhampur, Orissa. My e-mail address is manas002002 AT gmail.com.
Well first, there’s a day job at Infosys , Bangalore. There, I work as Technology Analyst .Previously I worked at Relyon Softech Ltd as Software Engineer .Professionally , I am working from last 4 years . My strength as architect and developer is in developing fault-tolerant, highly scalable, high quality enterprise systems. Since 2005 I am developing and deploying on .Net platform, with occassional forays in LISP,J2EE.You can find my resume here.
In any remaining free time, I used to be at community sites for posting solution or else you will find me in kitchen .
If there’s any time left over, i share my experience here in this blog,watch movies or else play strategy games (Rise of Nation my favorite).