Grid
とLine
がGrid
の中にあるとします。 私はいつもLine
の幅をGrid
の幅と同じにします。だから、私は彼らにuwpデータバインディング:どのようにGrid.WidthPropertyの変更を聞くには
<Page
x:Class="GeoDraw.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:GeoDraw"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x1="using:System"
mc:Ignorable="d" Background="#FF262626" RequestedTheme="Dark" Loaded="Page_Loaded">
<Grid x:Name="grid" BorderBrush="#FFE02121" Margin="20" Background="#FFD69696">
<Line Stroke="White" Y1="20" Y2="20" X1="0" X2="{Binding ElementName=grid, Path=ActualWidth}" />
</Grid>
</Page>
を拘束ラインは当初、グリッドの幅がかかりますが、グリッドのサイズを変更すると、線の幅を変更しません。 これらのプロパティを正しくバインドするにはどうすればよいですか?
おそらく
正確に!私は 'TextBox'についても不思議だった。今分かります。多くの感謝アンドレ:) –