1
xctk:IntegerUpDownのイベントにIコマンドをバインドします。 ViewModelにはxctk:IntegerUpDownの 'LostMouseCapture'イベントへのコマンドのバインド
<xctk:IntegerUpDown Name="MinColor" ClipValueToMinMax="True" Grid.Column="2"
Minimum="0" Maximum="{Binding Path=MinColorMaxValue}" Value="{Binding Path=MinColorValue}" Increment="1"
PreviewTextInput="IntegerUpDown_PreviewTextInput" DataObject.Pasting="IntegerUpDown_Pasting" PreviewKeyDown="IntegerUpDown_PreviewKeyDown" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="LostMouseCapture">
<i:InvokeCommandAction Command="{Binding Path=ValueCommand}" CommandParameter="{Binding FileName}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</xctk:IntegerUpDown>
:イベントは、 'LostMouseCapture' XAMLで
である私はIntegerUpdownでいくつかの値を入れて、その後、私は 'ValueCommand' を呼び出したいの外側をクリックし
private DelegateCommand m_ValueCommand = null;
public ICommand ValueCommand
{
get
{
if (m_ValueCommand == null)
m_ValueCommand = new DelegateCommand(new Action<object>(ExecuteValueCommand),
new Predicate<object>(CanExecuteValueCommand));
return m_ValueCommand;
}
}
public bool CanExecuteValueCommand(object sender)
{
return true;
}
public void ExecuteValueCommand(object sender)
{
}
。これにはどんな解決策がありますか?
おかげで多くのことを。 LostKeyboardFocusが機能しました。 – SAT