I have a WPF application in C# on Windows 10. I have a StackPanel with Orientation="Horizontal", HorizontalAlignment="Stretch", and FlowDirection="RightToLeft. The StackPanel Width-1444. Inside the StackPanel I have 3 narrow Canvas objects on the Left. Inside the StasckPanel I also have a Border object with HorizontalAlignment="Stretch". Incorrectly the computed Border Width=0 even though the Border's HorizontalAlignment="Stretch".
Why is the Border Width=0 even though the Width should be the StackPanel - the ActualWidth of the 3 Canvas objects?
How do I get the Bordet Width = the remainder StackPanel not taken up of the Canvas objects?
<StackPanel Name="CenterArea" Orientation="Horizontal" Margin="5"
FlowDirection="RightToLeft"
HorizontalAlignment="Stretch">
<Canvas Name="Tind" Margin="10" Width="40">
</Canvas>
<Canvas Name="Pind" Margin="10" Width="40">
</Canvas>
<Canvas Name="Zind" Margin="10" Width="40">
</Canvas>
<Border x:Name ="border"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Margin="5,0,5,0">
<Canvas x:Name="area" Opacity="1"
Height="{Binding ActualHeight, ElementName=border, Mode=OneWay}"
Width="{Binding ActualWidth, ElementName=border, Mode=OneWay}" >
....
</Canvas>
</Border>
</StackPanel>