■ Style 엘리먼트 : 다른 타입에 각각 적용하기
------------------------------------------------------------------------------------------------------------------------
▶ MainWindow.xaml
<Window x:Class="TestProject.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="800" Height="600" Title="Style 엘리먼트 : 다른 타입에 각각 적용하기" FontFamily="나눔고딕코딩" FontSize="16"> <Window.Resources> <Style x:Key="NormalStyleKey"> <Setter Property="Control.FontSize" Value="24" /> <Setter Property="Control.Foreground" Value="Blue" /> <Setter Property="Control.HorizontalAlignment" Value="Center" /> <Setter Property="Control.Margin" Value="24" /> <Setter Property="Control.Padding" Value="20 10 20 10" /> </Style> </Window.Resources> <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> <Button Style="{StaticResource NormalStyleKey}"> 스택 첫번째 버튼 </Button> <TextBlock Style="{StaticResource NormalStyleKey}"> 스택 가운데 텍스트 블럭 </TextBlock> <Button Style="{StaticResource NormalStyleKey}"> 스택 마지막 버튼 </Button> </StackPanel> </Window>
|
------------------------------------------------------------------------------------------------------------------------
'C# > WPF' 카테고리의 다른 글
[C#/WPF] Style 엘리먼트 : Resources 속성을 사용해 스타일 내에서 리소스 사용하기 (0) | 2015.08.04 |
---|---|
[C#/WPF] Style 엘리먼트 : 리소스로 사용하기 (0) | 2015.08.04 |
[C#/WPF] Style 엘리먼트 : 리소스로 사용하기 (0) | 2015.08.04 |
[C#/WPF] x:Null 태그 확장 사용하기 (0) | 2015.08.04 |
[C#/WPF] Style 엘리먼트 : 로컬 스타일 사용하기 (0) | 2015.08.04 |
[C#/WPF] Style 엘리먼트 : 다른 타입에 각각 적용하기 (0) | 2015.08.03 |
[C#/WPF] Binding 태그 확장 : RelativeSource 속성에서 RelativeSource 태그 확장을 사용해 엘리먼트 자신의 속성 바인딩하기 (0) | 2015.07.23 |
[C#/WPF] IMultiValueConverter 인터페이스 사용하기 (0) | 2015.07.23 |
[C#/WPF] Binding 태그 확장 : Source 속성에서 StaticResource 태그 확장을 사용해 INotifyPropertyChanged 인터페이스 구현 객체 속성 바인딩하기 (0) | 2015.07.23 |
[C#/WPF] Binding 태그 확장 : Source 속성에서 StaticResource 태그 확장을 사용해 리소스 속성 바인딩하기 (0) | 2015.07.23 |
[C#/WPF] Binding 태그 확장 : Source 속성에서 x:Static 태그 확장을 사용해 정적 객체 속성 바인딩하기 (0) | 2015.07.23 |
댓글을 달아 주세요