一、效果
二、代码 MainWindow.xaml
<Window x:Class="Student_Binding.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:Student_Binding"
mc:Ignorable="d"
Title="MainWindow" Height="100" Width="150">
<StackPanel>
<TextBox x:Name="text1" Height="23" BorderBrush="Black" Margin="4" Text="{Binding Path=Value, ElementName=silder1}"/>
<Slider x:Name="silder1" Maximum="100" Minimum="0" Margin="4" />
</StackPanel>
</Window>