2014-09-30 2 views
1

wpf 팝업에서 누른 키를 바인딩 할 수 있습니까?wpf에서 팝업 키 바인딩

나는 이런 식으로 그것을 시도하지만 아무런 영향 보인다 :

<Popup.InputBindings> 
    <KeyBinding Key="Escape" Command="Close" /> 
    <KeyBinding Key="Enter" Command="{Binding NewDateSelectedCommand}" /> 
</Popup.InputBindings> 

답변

0

을 당신은, 당신은 팝업

<Popup x:Name="popup"> 
    <Popup.InputBindings> 
     <KeyBinding Key="Escape" Command="Close" /> 
     <KeyBinding Key="Enter" Command="{Binding NewDateSelectedCommand}" /> 
    </Popup.InputBindings> 
</Popup> 

public void ShowPopup() 
{ 
    this.popup.IsOpen = true; 
    this.popup.Focus(); 
} 
에 초점을()으로 설정해야 할 수 있습니다