Search Results

Search found 2 results on 1 pages for 'chikak'.

Page 1/1 | 1 

  • WPF Treeview: How to display rounded border around the selected item?

    - by chikak
    I am trying to set the rounded border around the selected item of the treeview (like the one in the windows explorer on Vista). The problem is that the trigger in the following code doesn't seem to be working. It looks like the IsSelected property is always false. <TreeView x:Name="m_treeView" BorderThickness="0" d:LayoutOverrides="Width, Height"> <TreeView.Resources> <Style TargetType="TreeViewItem"> <Style.Resources> <Brush x:Key="{x:Static SystemColors.HighlightBrushKey}">Transparent</Brush> </Style.Resources> </Style> </TreeView.Resources> <TreeView.ItemTemplate> <HierarchicalDataTemplate DataType="{x:Type local:DirectoryPresentationBase}" ItemsSource="{Binding Children}"> <TreeViewItem> <TreeViewItem.Header> <Border Name="SelectedBorder" CornerRadius="3" Background="#EFF8FD" BorderBrush="#99DEFD" BorderThickness="1" > <StackPanel Orientation="Horizontal"> <interactivity:Interaction.Behaviors> <local:TreeViewExpandBehavior AssociatedTreeView="{Binding ElementName=m_treeView}"/> </interactivity:Interaction.Behaviors> <Image x:Name="img" Width="24" Height="16" Stretch="None" Source="{Binding SmallIcon}"/> <TextBlock Text="{Binding Name}" Margin="5,0" /> </StackPanel> </Border> </TreeViewItem.Header> </TreeViewItem> <HierarchicalDataTemplate.Triggers> <Trigger Property="TreeViewItem.IsSelected" Value="True"> <Setter Property="Background" TargetName="SelectedBorder" Value="Red"/> <Setter Property="BorderBrush" TargetName="SelectedBorder" Value="Green"/> </Trigger> <Trigger Property="TreeViewItem.IsSelected" Value="False"> <Setter Property="Background" TargetName="SelectedBorder" Value="Transparent"/> <Setter Property="BorderBrush" TargetName="SelectedBorder" Value="Transparent"/> </Trigger> </HierarchicalDataTemplate.Triggers> </HierarchicalDataTemplate> </TreeView.ItemTemplate> </TreeView>

    Read the article

  • A simple eventbus for .net

    - by chikak
    Hello, I want to make a very simple event bus which will allow any client to subscribe to a particular type of event and when any publisher pushes an event on the bus using EventBus.PushEvent() method only the clients that subscribed to that particular event type will get the event. I am using c#.net 2.0 Any help/pointer would be greatly appreciated. Thanks Pradeep

    Read the article

1