Subscribe to mouse event.

2 posts, 0 answers
  1. Weera
    Weera avatar
    25 posts
    Member since:
    Apr 2012

    Posted 09 Jan 2015 Link to this post

    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
  2. Weera
    Weera avatar
    25 posts
    Member since:
    Apr 2012

    Posted 09 Jan 2015 in reply to Weera Link to this post

    Hi All,

    Sorry, I have fixed it my fault.

    <Setter Property="IsChecked" Value="{Binding Path=IsExpaned,Mode=TwoWay}"/>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top