일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- 알고리즘
- ipad
- GitHub
- CNN
- Button
- Lotto
- pip
- 삼성소프트웨어멤버십
- mariadb
- DFS
- synology
- Numpy
- Python
- E-P1
- javascript
- dataframe
- RNN
- GT-S80
- Splunk
- pandas
- SciPy
- index
- mean
- imread
- SPL
- keras
- Series
- pycharm
- install
- LSTM
Archives
- Today
- Total
잠토의 잠망경
[WPF] TextBox Enter Key Event 본문
Event
TextBox 입력후 Enter로 조회하고 싶을때 아래와 같이 MVVM 사용하면 된다.
View
<TextBox
Width="120"
Text="{Binding TxtInput, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="KeyDown">
<ei:CallMethodAction MethodName="UIElement_OnKeyDown" TargetObject="{Binding}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</TextBox>
ViewModel
public void UIElement_OnKeyDown(object sender, KeyEventArgs e)
{
//https://stackoverflow.com/questions/3752451/enter-key-pressed-event-handler
if (e.Key == Key.Enter)
{
CommandSearchFunction();
}
}
Comments