TO CREATE STYLE TEMPLATE IN GENERIC.XAML:
Step1:open the “silverlight class library” named it as “style3” ,add one class file and named it as “button3.cs”,add new text fife and it as “generi.xaml”(this name is important) by right clicking the generic.xaml.
set build action propertie as resource .
step2:create a style property in “generic.xaml”
eg:
Step3:in button3.cs: inherit th ContentControl in class.and create a constructor
Eg: namespace style3
{
public class button3:ContentControl
{
public button3()
{
this.DefaultStyleKey = typeof(button3);
} }
}
Step4:build the “style3”
Step5:open new “silverlight application”,add refrence of “style3” to the application.add namespace in page.xaml and use the button ,finally run the apllication.the u will get output like this.
Eg:

set build action propertie as resource .
step2:create a style property in “generic.xaml”
eg:
Step3:in button3.cs: inherit th ContentControl in class.and create a constructor
Eg: namespace style3
{
public class button3:ContentControl
{
public button3()
{
this.DefaultStyleKey = typeof(button3);
} }
}
Step4:build the “style3”
Step5:open new “silverlight application”,add refrence of “style3” to the application.add namespace in page.xaml and use the button ,finally run the apllication.the u will get output like this.
Eg:

Comments
Post a Comment