本文介绍了输入事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试运行代码以在用户切换或单击字段时打开模式屏幕.
I'm trying to run code to open a modal screen when the user tabs or clicks into a field.
在使用begininvoke和 INotifyPropertyChanged.p ropertyChanged
I have similar even cose working when a field value is changed usign the begininvoke and INotifyPropertyChanged.propertyChanged
代码,因此需要类似的代码来输入"而不是更改"
code, so needsimilar code for "enter" rather than "change"
这是我的更改代码:
Private Sub UserParameters_SelectionChanged() ' catches the field that has the focus on the screen Dim selectedItem = Me.UserParameters.SelectedItem If (selectedItem Is Nothing) Then Return Microsoft.LightSwitch.Threading.Dispatchers.Main.BeginInvoke _ ( Sub() RemoveHandler DirectCast(selectedItem, INotifyPropertyChanged).PropertyChanged _ , AddressOf PropertyChanged AddHandler DirectCast(selectedItem, INotifyPropertyChanged).PropertyChanged _ , AddressOf PropertyChanged End Sub ) End Sub Private Sub PropertyChanged(ByVal sender As Object, ByVal e As PropertyChangedEventArgs) 'ShowMessageBox("param 7 from within change = " & clsCommonfunctions.fncParamDate(7, "-All-", "err")) Select Case e.PropertyName Case "CurrentUserValue" If Me.UserParameters.SelectedItem.CurrentUserValue = "" Then entityWindow.AddEntity() Else entityWindow.ViewEntity() End If End Select End Sub谢谢
赠予
推荐答案
我只能说这是一个非常"坏"的问题;想法是当有人进入或单击控件时弹出模式窗口.这将非常"震撼".用户的体验. All I can say is that it's a very "bad" idea to be popping up modal windows when someone enters, or clicks into, a control. It would be very "jarring" experience for the users.
更多推荐
输入事件
发布评论