WPF-Control/WPF绑定元素-1-代码模式的绑定/MainWindow.xaml

27 lines
1.5 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<Window x:Class="WPF绑定元素_1_代码模式的绑定.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"
mc:Ignorable="d"
Icon="public/003540AH4M72.jpg" Title="WPF绑定元素_1_代码模式的绑定" Height="450" Width="800">
<StackPanel>
<Slider Name="SliderFontSize" Minimum="1" Maximum="100" Value="40" TickFrequency="1" TickPlacement="TopLeft" />
<Label>
Binding 绑定元素 ElementName=SliderFontSize 指定元素名称,Path=Value 指定绑定的值
</Label>
<TextBlock Margin="10" Text="简单的文字" Name="TextBlockShow" />
<WrapPanel>
<Button Margin="5 0" Padding="15 5" Name="SetSmall" Click="SetSmall_OnClick">设置小号</Button>
<Button Margin="5 0" Padding="15 5" Name="SetNormal" Click="SetNormal_OnClick">设置默认</Button>
<Button Margin="5 0" Padding="15 5" Name="SetLarge" Click="SetLarge_OnClick">设置大号</Button>
<Label>不要直接设置在字体上会使用字面绑定代替元素绑定或者使用Mode为TwoWay</Label>
</WrapPanel>
<WrapPanel>
<Button Margin="5 0" Padding="15 5" Name="ClearBinding" Click="ClearBinding_OnClick">清除绑定</Button>
</WrapPanel>
</StackPanel>
</Window>