This is a migrated thread and some comments may be shown as answers.

Subscribe to mouse event.

1 Answer 183 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Weera
Top achievements
Rank 1
Weera asked on 09 Jan 2015, 10:15 AM
Hi,

<Style x:Key="GridViewToggleButtonStyle1" TargetType="{x:Type telerik:GridViewToggleButton}">
<Setter Property="ArrowTemplate">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:GridViewToggleButton}">
<Border Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Border Height="9">
<Grid>
<Path x:Name="plus" Data="M0.5,0.5L6.5,3.5 0.5,6.5z" Fill="White" Height="9" Margin="{TemplateBinding Padding}" Stretch="Fill" Stroke="#FF9D9D9D" StrokeThickness="{TemplateBinding BorderThickness}" Width="6"/>
<Path x:Name="minus" Data="M6.5,0.5L6.5,6.5 0.5,6.5z" Fill="#FF595959" Height="7" Margin="{TemplateBinding Padding}" Opacity="0" Stretch="Fill" Stroke="Black" StrokeThickness="{TemplateBinding BorderThickness}" Width="7"/>
</Grid>
</Border>

<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonUp">
<i:InvokeCommandAction Command="{Binding ElementName=LayoutRootGrid,Path=DataContext.ClickCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Border>
<ControlTemplate.Triggers>
<Trigger SourceName="plus" Property="Opacity" Value="1">
<Setter Property="Background" Value="Red"/>
</Trigger>
<Trigger SourceName="plus" Property="Opacity" Value="0">
<Setter Property="Background" Value="Yellow"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

Here is the point
<!--<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonUp">
<i:InvokeCommandAction Command="{Binding ElementName=LayoutRootGrid,Path=DataContext.ClickCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>-->

it should work but not working

I want to execute ViewModel's ClickCommand when users expand and collapse. Take a look at the attached file

1 Answer, 1 is accepted

Sort by
0
Weera
Top achievements
Rank 1
answered on 09 Jan 2015, 12:16 PM
Hi All,

Sorry, I have fixed it my fault.

<Setter Property="IsChecked" Value="{Binding Path=IsExpaned,Mode=TwoWay}"/>
Tags
TreeListView
Asked by
Weera
Top achievements
Rank 1
Answers by
Weera
Top achievements
Rank 1
Share this question
or