WPF资源文件相关使用说明

WPF是一个比较新的开发工具。既然是一个新技术工具,其具体包含内容值得我们去深入的研究。比如这里将会为大家介绍的WPF资源文件的使用方法,就是一个值得学习的基础技能。#t#

WPF资源文件代码示例:

  1. < Window x:Class="WPFFR.Window1" 
  2. xmlns="http://schemas.
    microsoft.com/winfx/2006
    /xaml/presentation"
     
  3. xmlns:x="http://schemas.
    microsoft.com/winfx/2006/xaml"
     
  4. Title="Window1" Height=
    "300" Width="300"> 
  5. < Window.Resources> 
  6. < Style x:Key="backcolor" 
    TargetType="Grid"> 
  7. < Setter Property="Background" 
    Value="Red"/> 
  8. < /Style> 
  9. < /Window.Resources> 
  10. < Grid Style="{StaticResource 
    backcolor}"
    > 
  11. < Button Height="23" Margin=
    "92,0,112,79" Name="button1" 
    VerticalAlignment="Bottom">Button
    < /Button> 
  12. < /Grid> 
  13. < /Window>  

 

WPF资源文件适用方法的介绍就为大家介绍到这里。

THE END