View Issue Details

IDProjectCategoryView StatusLast Update
0001559NoesisGUIUnity3Dpublic2019-10-17 10:17
Reportereasylaser Assigned Tosfernandez  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.2.5 
Target Version2.2.6Fixed in Version2.2.6 
Summary0001559: GridViewColumn bindings not working when inside a template
DescriptionWhen a ListView is defined inside a ControlTemplate, the bindings specified in the GridViewColumn.Header are not working.
Steps To Reproduce
<Grid
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid.Resources>
        <Grid x:Key="ctx">
            <TextBlock Text="Offset"/>
            <TextBlock Text="Color"/>
        </Grid>
        <GradientStopCollection x:Key="list">
            <GradientStop Offset="1" Color="Red"/>
            <GradientStop Offset="2" Color="Green"/>
            <GradientStop Offset="3" Color="Blue"/>
        </GradientStopCollection>
        <DataTemplate x:Key="cellEmpty">
            <Decorator/>
        </DataTemplate>
          <Style x:Key="headerEmpty" TargetType="{x:Type GridViewColumnHeader}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
                        <Decorator/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <ControlTemplate x:Key="ctrlTemplate" TargetType="Control">
            <Grid>
                <TabControl>
                    <TabItem Header="Rect">
                        <Rectangle Margin="20" Fill="Salmon"/>
                    </TabItem>
                    <TabItem Header="List">
                        <ListView ItemsSource="{StaticResource list}" ScrollViewer.PanningMode="VerticalOnly">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn Width="4" HeaderContainerStyle="{StaticResource headerEmpty}" CellTemplate="{StaticResource cellEmpty}"/>
                                    <GridViewColumn Header="{Binding Children[0].Text}">
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <TextBlock Text="{Binding Offset}" HorizontalAlignment="Right" Margin="10,0"/>
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                    </GridViewColumn>
                                    <GridViewColumn Header="{Binding Children[1].Text}">
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <TextBlock Text="{Binding Color}" HorizontalAlignment="Center" Margin="10,0">
                                                    <TextBlock.Foreground>
                                                        <SolidColorBrush Color="{Binding Color}"/>
                                                    </TextBlock.Foreground>
                                                </TextBlock>
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                    </GridViewColumn>
                                </GridView>
                            </ListView.View>
                        </ListView>
                    </TabItem>
                </TabControl>
            </Grid>
        </ControlTemplate>
    </Grid.Resources>
    <Grid x:Name="LayoutRoot" DataContext="{StaticResource ctx}">
        <Control Width="400" Height="400" Template="{StaticResource ctrlTemplate}"/>
    </Grid>
</Grid>
TagsNo tags attached.
PlatformAny

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-10-03 13:27 sfernandez New Issue
2019-10-03 13:27 sfernandez Reporter sfernandez => easylaser
2019-10-03 13:27 sfernandez Assigned To => sfernandez
2019-10-03 13:27 sfernandez Status new => assigned
2019-10-03 13:27 sfernandez Target Version => 2.3.0
2019-10-16 12:35 sfernandez Target Version 2.3.0 => 2.2.6
2019-10-17 10:17 sfernandez Status assigned => resolved
2019-10-17 10:17 sfernandez Resolution open => fixed
2019-10-17 10:17 sfernandez Fixed in Version => 2.2.6