<Window x:Class="WPF绑定元素_2_多绑定.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"
        Title="MainWindow" Height="450" Width="800">
    <StackPanel>

        <Slider Name="TextBlockSlider"
                Value="{Binding ElementName=ExactSizeForSlider,Path=Text}"
                Maximum="100" Minimum="0" SmallChange="2" LargeChange="5"
                TickPlacement="BottomRight" TickFrequency="5" IsSelectionRangeEnabled="True" />

        <TextBox Margin="0 8" Name="BunnyTextBox">这是文字内容</TextBox>

        <ListBox Margin="0 8" Name="ListBoxColor">
            <ListBoxItem Tag="Pink" Foreground="Pink" IsSelected="True">Pink</ListBoxItem>
            <ListBoxItem Tag="Red" Foreground="Red">Red</ListBoxItem>
            <ListBoxItem Tag="Green" Foreground="Green">Green</ListBoxItem>
        </ListBox>

        <DockPanel>
            <Label> 输入文字大小：</Label>
            <TextBox Name="ExactSizeForSlider"
                     Text="{Binding ElementName=TextBlockSlider,Path=Value}"
                     VerticalAlignment="Center" />
        </DockPanel>

        <TextBlock Margin="0 4" Text="{Binding ElementName=BunnyTextBox,Path=Text}"
                   FontSize="{Binding ElementName=TextBlockSlider,Path=Value}"
                   Foreground="{Binding ElementName=ListBoxColor,Path=SelectedItem.(ListBox.Tag)}" />
    </StackPanel>
</Window>