View Issue Details

IDProjectCategoryView StatusLast Update
0001626NoesisGUIUnitypublic2020-03-20 16:45
ReporterC4ustic Assigned Tosfernandez  
PrioritynormalSeverityminor 
Status resolvedResolutionfixed 
Product Version2.2.6 
Target Version3.0.0Fixed in Version3.0.0 
Summary0001626: You get a stack overflow exception if clicking a TreeViewItem that has a template set in it's style.
Description

Having a style like this:

<Style x:Key="{x:Type TreeViewItem}" TargetType="{x:Type TreeViewItem}">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type TreeViewItem}">
                <Border x:Name="Border" Padding="2" SnapsToDevicePixels="true" BorderBrush="{StaticResource Brush_ItemBorder}" BorderThickness="{TemplateBinding BorderThickness}">
                    <ContentPresenter  Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"/>
                </Border>                   
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

And then just click on the the item in the tree view:

My xaml looks like this:

<TreeView Name="x_folderTreeView" Grid.Column="0" ItemsSource="{Binding RootFolderItems}" SelectedItemChanged ="SelectedFolderChangedEx">
<TreeView.ItemTemplate >
<HierarchicalDataTemplate DataType="{x:Type NsUI:NsUICreateObjectFolderItem}" ItemsSource="{Binding ChildFolders}" >
<Grid PreviewMouseLeftButtonDown="Folder_TreeView_ItemSelected" >
<TextBlock Text="{Binding FolderName}" Height="35" FontSize="22"/>
</Grid>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>

PlatformWindows

Activities

C4ustic

C4ustic

2020-02-16 23:09

reporter   ~0006097

This is what the exception look like:

StackOverflowException: The requested operation caused a stack overflow.
Noesis.View.MouseButtonDown (System.Int32 x, System.Int32 y, Noesis.MouseButton button) (at Assets/NoesisGUI/Plugins/API/Core/View.cs:126)
NoesisView.ProcessEvent (UnityEngine.Event ev, System.Boolean enableKeyboard, System.Boolean enableMouse, System.Boolean emulateTouch) (at Assets/NoesisGUI/Plugins/NoesisView.cs:1002)
NoesisView.OnGUI () (at Assets/NoesisGUI/Plugins/NoesisView.cs:1129)

Issue History

Date Modified Username Field Change
2020-02-16 23:08 C4ustic New Issue
2020-02-16 23:09 C4ustic Note Added: 0006097
2020-03-03 11:45 sfernandez Assigned To => sfernandez
2020-03-03 11:45 sfernandez Status new => assigned
2020-03-03 11:45 sfernandez Target Version => 3.0.0
2020-03-20 16:45 sfernandez Status assigned => resolved
2020-03-20 16:45 sfernandez Resolution open => fixed
2020-03-20 16:45 sfernandez Fixed in Version => 3.0.0
2025-10-10 13:29 jsantos Category Unity3D => Unity