cjmx
Topic Author
Posts: 4
Joined: 21 May 2019, 14:48

[Unity] [Noesis 3.0] ToolTip is not shown when the cursor over an Item of ItemsControl

22 Jun 2020, 20:19

EDIT: Everything is working properly. It was my fault.

================================================
ToolTip works well for static UI elements but nothing happens when I'm trying to use ToolTip for items of any List control (ItemsControl, ListView, ListBox, etc).
<Grid>
        <StackPanel Orientation="Horizontal">
            <TextBlock Text="SYSTEM"
                       ToolTip="SYSTEM" />
            <ListBox ItemsSource="{Binding Items}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal" />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Grid Width="100"
                              Height="100"
                              Background="White">
                            <Grid.ToolTip>
                                <ToolTip>
                                     <TextBlock Text="TEST" />
                                </ToolTip>
                            </Grid.ToolTip>
                        </Grid>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ListBox>
        </StackPanel>
  </Grid>
In this case I declare ToolTip as part DataTemplate. Unfortunately it doesnt work at all. Before that, I tried using ToolTipService and defining ToolTip in Style of a item but the result is the same. Although ToolTip is shown to my surprise if items are declared right in xaml.

Another piece of cake: when I have the cursor over a fixed UI Element, and then I move the cursor to be over a dynamic item - ToolTip is shown for a second but immediately disappears after that. So, I think it's maybe somehow caused by incorrect mouse position for dynamic elements.
Last edited by cjmx on 22 Jun 2020, 20:57, edited 1 time in total.
 
cjmx
Topic Author
Posts: 4
Joined: 21 May 2019, 14:48

Re: [Unity] [Noesis 3.0] ToolTip is not shown when the cursor over an Item of ItemsControl

22 Jun 2020, 20:55

Never mind. My fault. Source collection of items was recreated every frame not every click as I planned. I fixed it. So, now everything is working without any issues.
 
User avatar
jsantos
Site Admin
Posts: 3905
Joined: 20 Jan 2012, 17:18
Contact:

Re: [Unity] [Noesis 3.0] ToolTip is not shown when the cursor over an Item of ItemsControl

22 Jun 2020, 21:13

Great! Thank you for the feedback

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 97 guests