issharedsizescope

WPF Grid.IsSharedSizeScope in ItemsControl and ScrollViewer

和自甴很熟 提交于 2020-01-06 07:08:00
问题 I'm simplyfying this log viewer. It works mostly as expected, but somehow the column lengths don't share the same size. Here is my code: <Window.Resources> <local:IsGreaterThanConverter x:Key="IsGreaterThanConverter" /> <sys:Int32 x:Key="MaxDisplayLineLength">200</sys:Int32> <Style TargetType="ItemsControl" x:Key="LogViewerStyle"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <ScrollViewer CanContentScroll="True"> <ItemsPresenter/> </ScrollViewer> </ControlTemplate> </Setter

Grid.IsSharedScopeSize incompatible with * columns in WPF Grid

夙愿已清 提交于 2019-12-24 04:42:08
问题 I am using IsSharedSizeScope in an ItemsControl in WPF to keep the same widths for each row. Unfortunately this isn't compatible with Width='*' columns, which makes the 'A B C' text column spill off the end of the page. <Border BorderBrush="Red" BorderThickness="1"> <StackPanel Grid.IsSharedSizeScope="True"> <Grid HorizontalAlignment="Stretch"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" SharedSizeGroup="G1"/> <ColumnDefinition Width="Auto" SharedSizeGroup="G2" />

SharedSizeScope on a Grid makes the form 'dance'

孤者浪人 提交于 2019-12-08 02:41:28
问题 I have a StackPanel (tried with a Grid as well) on my page. <StackPanel Grid.IsSharedSizeScope="True"> <Partials:BaseInfo x:Name="baseInfo" /> <Partials:ExtraInfo x:Name="extraInfo" /> </StackPanel> Both partials are using a grid with the same ColumnDefinitions: <Grid.ColumnDefinitions> <ColumnDefinition Width="90" SharedSizeGroup="C1" /> <ColumnDefinition Width="Auto" SharedSizeGroup="C2" /> <ColumnDefinition Width="Auto" SharedSizeGroup="C3" /> <ColumnDefinition Width="Auto" SharedSizeGroup