Search Results

Search found 4 results on 1 pages for 'pileggi'.

Page 1/1 | 1 

  • WPF - attached behavior to capture MouseEnter on Image in TreeviewITem

    - by pileggi
    Hi! Could I have, please, a little code-sample of WPF "attached behavior"? I explain my problem: I've done my TreeView all with XAML but now I'd like to manage an event with code-behind. The HierarchicalDataTemplate contains an Image. I need to capture the events MouseEnter / MouseLeave on the Image. I'd like to do this with "attached behavior", but I don't know how. Thank you! Pileggi

    Read the article

  • capture MouseEnter / MouseLeave on Image in WPF TreeViewItem

    - by pileggi
    Hi! I've done my TreeView all with XAML but now I'd like to manage an event with code-behind and I don't know how. The HierarchicalDataTemplate contains an Image. I need to capture the events MouseEnter / MouseLeave on the Image. I've tried in this way: <Image x:Name="imgArticolo" Source="{Binding imgArt}"> <Image.Style TargetType="{x:Type Image}"> <Style> <EventSetter Event="MouseEnter" Handler="iArt_MouseEnter"/> </Style> </Image.Style> </Image> But it doesn't work: error: "MouseEnter member not recognized or not accessible" (from italian) Can you, please, help me? Thank you! Pileggi

    Read the article

  • Making selectable again a WPF TreeviewITem after the first click

    - by pileggi
    Hi, I have a TreeVIew WPF with 2 Levels of Data. I have deleted the ToogleButton from the TreeViewItemTemplate. Now I'd like to expand / collapse the groups with a single mouse-click (not with a double click as the default behaviour). I have tried in this way: Private Sub tvArt_SelectedItemChanged(ByVal sender As System.Object, _ ByVal e As RoutedPropertyChangedEventArgs(Of System.Object)) Handles tvArt.SelectedItemChanged If e.NewValue Is Nothing = False Then Dim ri As P_RicambiItem = TryCast(e.NewValue, P_RicambiItem) If ri Is Nothing = False Then If ri.isExpanded Then ri.isExpanded = False Else ri.isExpanded = True End If ri.isSelected = False End If End If End Sub Using my properties "isExpanded" and "isSelected" in the collection data source. But it works only halfway: after the first click, infact, I can't click for a second time on the same item, because, even if I've deselected it, the event handler "remembers" that it was the last selected item and it doesn't capture the event "SelectedItemChanged". How can I do? Thanks a lot, Pileggi

    Read the article

  • EventSetter - error XAML in Visual Studio designer

    - by pileggi
    Hi! I've done my TreeView all with XAML but now I'd like to manage an event with code-behind. The HierarchicalDataTemplate contains an Image. I need to capture the events MouseEnter / MouseLeave on the Image. I've tried in this way: <Image x:Name="imgArticolo" Source="{Binding imgArt}"> <Image.Style> <Style TargetType="{x:Type Image}"> <EventSetter Event="MouseEnter" Handler="iArt_MouseEnter"/> </Style> </Image.Style> </Image> But in the designer of Visual Studio appear the error: "Impossible to load a file XAML with EventSetter". How can I remedy? Thank you! Pileggi

    Read the article

1