Silverlight Controls : How to use Control Template for a button control in Silverlight - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Saturday, June 4, 2011

Silverlight Controls : How to use Control Template for a button control in Silverlight

In this article let us learn how to use Control Template for a button control in a Silverlight application. Control Template will allow us to use, a control as a template to another control.

As usual, open visual studio and select Silverlight project. We can notice that there is a Grid layout in our MainPage.xaml.  Remove the default Grid layout and just drag and drop the Stack panel Layout into our application. The code for this looks like as

           <StackPanel x:Name="LayoutRoot" Background="White" >
           </StackPanel>

We shall define a Control Template as a resource and we will use it for our button control. The code for stack panel resource looks like as


Read more: Source

No comments:

Post a Comment