How can I use an application resource?
Submitted by: AdministratorThe following example shows an application definition file. The application definition file defines a resource section (a value for the Resources property). Resources defined at the application level can be accessed by all other pages that are part of the application. In this case, the resource is a declared style. Because a complete style that includes a control template can be lengthy, this example omits the control template that is defined within the ContentTemplate property setter of the style.
[XAML]
<Application.Resources>
<Style TargetType="Button" x:Key="GelButton" >
<Setter Property="Margin" Value="1,2,1,2"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="Template">
<Setter.Value>
...
</Setter.Value>
</Setter>
</Style>
</Application.Resources>
Submitted by: Administrator
[XAML]
<Application.Resources>
<Style TargetType="Button" x:Key="GelButton" >
<Setter Property="Margin" Value="1,2,1,2"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="Template">
<Setter.Value>
...
</Setter.Value>
</Setter>
</Style>
</Application.Resources>
Submitted by: Administrator
Read Online WPF Job Interview Questions And Answers
Top WPF Questions
☺ | What is WPF? |
☺ | How can I mark the default value of a custom dependency property to be false? |
☺ | How can I enumerate all the descendants of a visual object? |
☺ | What is XAML extensible markup language? |
☺ | How can I create Custom Read-Only Dependency Properties? |
Top Application Program Categories
☺ | AutoCAD Interview Questions. |
☺ | Microsoft Office Interview Questions. |
☺ | Microsoft Outlook Interview Questions. |
☺ | Microsoft Excel Interview Questions. |
☺ | MATLAB Interview Questions. |