일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 알고리즘
- keras
- Numpy
- 삼성소프트웨어멤버십
- CNN
- dataframe
- Series
- DFS
- synology
- imread
- RNN
- Lotto
- LSTM
- pandas
- pip
- SPL
- pycharm
- GitHub
- GT-S80
- install
- Python
- mean
- index
- Splunk
- Button
- E-P1
- javascript
- SciPy
- mariadb
- ipad
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