WPF 스타일(Style), XAML에서 Setter 엘리먼트의 Value 속성을 데이터 바인딩한 예제
n 아래 예문은 XAML에서 Setter 엘리먼트의 Value 속성을 데이터 바인딩 했다.
<Window x:Class="WpfApp6.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp6"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<StackPanel>
<StackPanel.Resources>
<Style TargetType="{x:Type Button}">
<Setter Property="FontSize"
Value="{Binding ElementName=scroll, Path=Value}" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Margin" Value="24" />
</Style>
</StackPanel.Resources>
<ScrollBar Name="scroll" Orientation="Horizontal" Margin="24"
Minimum="11" Maximum="100" Value="24" />
<Button>
Button Number 1
</Button>
<Button>
Button Number 2
</Button>
<Button>
Button Number 3
</Button>
</StackPanel>
</Window>
|
(C#교육동영상)C# ADO.NET 실습 ODP.NET/ODAC 설치 오라클 함수 호출 실습, C#학원, WPF학원, 닷넷학원, 자바학원 https://www.youtube.com/watch?v=qIPU85yAlzc&list=PLxU-i...
댓글 없음:
댓글 쓰기