View Issue Details

IDProjectCategoryView StatusLast Update
0001552NoesisGUIC# SDKpublic2019-09-10 03:12
ReporterlupodAssigned Tosfernandez 
PrioritynormalSeveritymajorReproducibilityalways
Status assignedResolutionopen 
Product Version2.2.3 
Target Version2.3.0Fixed in Version 
Summary0001552: Sharing column or row sizes between grids with BaseDefinition.ShareSizeGroup does not work.
DescriptionColumns (or rows) in different grids can sync their sizes using the ShareSizeGroup attribute. This requires the Grid.IsSharedSizeScope property on any ancestor to be set to true.
An example where this is useful (and actually quite critical) is displaying items with multiple columns in an ItemsControl. This could be a list of key value pairs where we want all the values aligned in a common column. We cannot use one common grid for all items because the templates for the ItemsPanel and the Items itself are defined separately.

The ShareSizeGroup attribute has no effect and the official example, which works in Blend, does not work in Noesis (see below).

The feature is described in this article from the .NET docs: https://docs.microsoft.com/en-us/dotnet/framework/wpf/controls/how-to-share-sizing-properties-between-grids
Steps To ReproduceTry the example from the .NET docs, it does not work: (https://docs.microsoft.com/en-us/dotnet/framework/wpf/controls/how-to-share-sizing-properties-between-grids)

Here is a simplified version of the code sample from the link above, but with the (in Noesis unsupported) Grid.ShowGridLines removed. And I removed the toggling logic.
This code does work flawlessly in Blend (design and runtime) but the same code does not work in Noesis for Unity.

Expected Result: The columns and row of the right grid should be resized to the corresponding sizes in the left grid.
Actual Result: No size sharing is happening when running in unity.

    <DockPanel Name="dp1" Grid.IsSharedSizeScope="True" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10">

        <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">

            <Grid Margin="0,0,10,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition SharedSizeGroup="FirstColumn"/>
                    <ColumnDefinition SharedSizeGroup="SecondColumn"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" SharedSizeGroup="FirstRow"/>
                </Grid.RowDefinitions>

                <Rectangle Fill="Silver" Grid.Column="0" Grid.Row="0" Width="200" Height="100"/>
                <Rectangle Fill="Blue" Grid.Column="1" Grid.Row="0" Width="150" Height="100"/>

                <TextBlock Grid.Column="0" Grid.Row="0" FontWeight="Bold">First Column</TextBlock>
                <TextBlock Grid.Column="1" Grid.Row="0" FontWeight="Bold">Second Column</TextBlock>
            </Grid>

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition SharedSizeGroup="FirstColumn"/>
                    <ColumnDefinition SharedSizeGroup="SecondColumn"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" SharedSizeGroup="FirstRow"/>
                </Grid.RowDefinitions>

                <Rectangle Fill="Silver" Grid.Column="0" Grid.Row="0"/>
                <Rectangle Fill="Blue" Grid.Column="1" Grid.Row="0"/>

                <TextBlock Grid.Column="0" Grid.Row="0" FontWeight="Bold">First Column</TextBlock>
                <TextBlock Grid.Column="1" Grid.Row="0" FontWeight="Bold">Second Column</TextBlock>
            </Grid>

        </StackPanel>
        
    </DockPanel>
TagsC#, Unity, xaml
PlatformWindows

Activities

lupod

lupod

2019-09-09 14:16

reporter  

expected.png (3,379 bytes)
expected.png (3,379 bytes)
actual.png (3,603 bytes)
actual.png (3,603 bytes)
jsantos

jsantos

2019-09-09 20:49

manager   ~0005957

Thanks for the awesome report!

Issue History

Date Modified Username Field Change
2019-09-09 14:16 lupod New Issue
2019-09-09 14:16 lupod Tag Attached: C#
2019-09-09 14:16 lupod Tag Attached: Unity
2019-09-09 14:16 lupod Tag Attached: xaml
2019-09-09 14:16 lupod File Added: expected.png
2019-09-09 14:16 lupod File Added: actual.png
2019-09-09 14:17 lupod Steps to Reproduce Updated View Revisions
2019-09-09 14:23 lupod Description Updated View Revisions
2019-09-09 14:23 lupod Steps to Reproduce Updated View Revisions
2019-09-09 14:26 lupod Category Unity3D => C# SDK
2019-09-09 20:49 jsantos Note Added: 0005957
2019-09-10 03:12 sfernandez Assigned To => sfernandez
2019-09-10 03:12 sfernandez Status new => assigned
2019-09-10 03:12 sfernandez Target Version => 2.3.0