with lookless controls I can add a dependency property like this:
public static readonly DependencyProperty CommandProperty = DependencyProperty.Register("CommandName"), typeof(ICommand), typeof(controlType));
public ICommand Command
{
get { return (ICommand)GetValue(CommandProperty);}
set {this.SetValue(CommandProperty,value);}
}
the style:
<Style BasedOn="{StaticResource {x:Type ContentControl}}" TargetType="{x:Type local:ControlType}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:ControlType}">
<Grid x:Name="titleGrid" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}">
<local:DSMoveThumb
Title="thumb"/>
<button Command={TemplateBinding Command}/>
<ScrollViewer ScrollViewer.VerticalScrollBarVisibility="Hidden">
<ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" />
</ScrollViewer>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
so that I can bind to it like this:
<local:control CommandName={Binding ViewModelCommand} />
I would like to do the same thing but for a double click event on the thumb part of the style but i am having a hard time figuring it out. Any input would be appreciated.