- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
算术运算wpf中的上溢或下溢
尝试使用 MVVM + Prism 在 WPF 中重新创建 virdiSDK 示例
终端服务器入门,但是当我尝试关闭应用程序或尝试将焦点放在文本框上进行输入时,我在算术运算中遇到错误溢出或下溢
有时来源是:windowsbase有时是:PresentationFramework
堆栈
at System.Windows.Size..ctor(Double width, Double height)
at System.Windows.Documents.AdornerLayer.InvalidateAdorner(AdornerInfo adornerInfo)
at System.Windows.Documents.AdornerLayer.UpdateElementAdorners(UIElement element)
at System.Windows.Documents.AdornerLayer.UpdateAdorner(UIElement element)
at System.Windows.Documents.AdornerLayer.Add(Adorner adorner, Int32 zOrder)
at System.Windows.Documents.CaretElement.EnsureAttachedToView()
at System.Windows.Documents.CaretElement.Update(Boolean visible, Rect caretRectangle, Brush caretBrush, Double opacity, Boolean italic, CaretScrollMethod scrollMethod, Double scrollToOriginPosition)
at System.Windows.Documents.TextSelection.UpdateCaretStateWorker(Object o)
at System.Windows.Documents.TextSelection.UpdateCaretState(CaretScrollMethod caretScrollMethod)
at System.Windows.Documents.TextSelection.EnsureCaret(Boolean isBlinkEnabled, Boolean isSelectionActive, CaretScrollMethod scrollMethod)
at System.Windows.Documents.TextSelection.System.Windows.Documents.ITextSelection.UpdateCaretAndHighlight()
at System.Windows.Documents.TextEditor.OnGotKeyboardFocus(Object sender, KeyboardFocusChangedEventArgs e)
at System.Windows.Controls.Primitives.TextBoxBase.OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
at System.Windows.UIElement.OnGotKeyboardFocusThunk(Object sender, KeyboardFocusChangedEventArgs e)
at System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)
at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
at System.Windows.UIElement.Focus()
at System.Windows.Documents.TextEditorMouse.MoveFocusToUiScope(TextEditor This)
at System.Windows.Documents.TextEditorMouse.OnMouseDown(Object sender, MouseButtonEventArgs e)
at System.Windows.Controls.Primitives.TextBoxBase.OnMouseDown(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at ATSApp.App.Main() in e:\Working Projects\ATS\ATS\Shell\obj\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
查看模型代码
链接到 ViewModel代码文件:https://www.dropbox.com/s/4d5lz12xowshpqf/ModuleNavViewModel.cs
代码运行,但我无法捕捉到错误。
[Export(typeof(IModuleNavViewModel))]
[PartCreationPolicy(CreationPolicy.Shared)]
public class ModuleNavViewModel : ViewModelBase, IModuleNavViewModel
{
private IRegionManager _regionManager;
IEventAggregator _eventAggregator;
private FPTerminalActions _CurrentAction;
public FPTerminalActions CurrentAction
{
get { return _CurrentAction; }
set { _CurrentAction = value; OnPropertyChanged("CurrentAction"); }
}
[ImportingConstructor]
public ModuleNavViewModel(IRegionManager regionManager, IEventAggregator eventAggregator)
: base(regionManager, eventAggregator)
{
_eventAggregator = eventAggregator;
_regionManager = regionManager;
Categories = LoadTreeViewCategories();
LstMessage = new List<string>();
Message5 = "0";
Message2 = "0";
Message1 = "0";
CurrentAction = new FPTerminalActions();
RegisterCommands();
}
public override void RegisterCommands()
{
GlobalCommands.StartCommand.RegisterCommand(StartCommand);
GlobalCommands.StopCommand.RegisterCommand(StopCommand);
}
private object DllImport(string p)
{
throw new NotImplementedException();
}
public override bool CanStart()
{
return true;
}
public override bool CanStop()
{
return true;
}
private bool IsServerRunning = false;
[DllImport("msvcr71.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int _fpreset();
public override void Start()
{
_fpreset();
if (!IsServerRunning)
{
IntializeDevice();
IsServerRunning = true;
}
ucsAPI.ServerStart(255, 9870);
LstMessage.Clear();
}
public override void Stop()
{
ucsAPI = null;
ucBioBSP = null;
LstMessage.Clear();
}
private void IntializeDevice()
{
// create UCSAPI Instance
ucsAPI = new UCSAPIClass();
serveruserData = ucsAPI.ServerUserData as IServerUserData;
terminalUserData = ucsAPI.TerminalUserData as ITerminalUserData;
accessLogData = ucsAPI.AccessLogData as IAccessLogData;
serverAuthentication = ucsAPI.ServerAuthentication as IServerAuthentication;
// create UCBioBSP Instance
ucBioBSP = new UCBioBSPClass();
fpData = ucBioBSP.FPData as IFPData;
device = this.ucBioBSP.Device as IDevice;
extraction = this.ucBioBSP.Extraction as IExtraction;
//terminalID = txtTerminalID.Text;
// create event handle
ucsAPI.EventTerminalConnected += new _DIUCSAPIEvents_EventTerminalConnectedEventHandler(UCSCOMObj_EventTerminalConnected);
ucsAPI.EventTerminalDisconnected += new _DIUCSAPIEvents_EventTerminalDisconnectedEventHandler(UCSCOMObj_EventTerminalDisconnected);
ucsAPI.EventAddUser += new _DIUCSAPIEvents_EventAddUserEventHandler(ucsAPI_EventAddUser);
ucsAPI.EventAntipassback += new _DIUCSAPIEvents_EventAntipassbackEventHandler(ucsAPI_EventAntipassback);
ucsAPI.EventAuthTypeWithUniqueID += new _DIUCSAPIEvents_EventAuthTypeWithUniqueIDEventHandler(ucsAPI_EventAuthTypeWithUniqueID);
ucsAPI.EventAuthTypeWithUserID += new _DIUCSAPIEvents_EventAuthTypeWithUserIDEventHandler(ucsAPI_EventAuthTypeWithUserID);
ucsAPI.EventControlPeripheralDevice += new _DIUCSAPIEvents_EventControlPeripheralDeviceEventHandler(ucsAPI_EventControlPeripheralDevice);
ucsAPI.EventDeleteAllUser += new _DIUCSAPIEvents_EventDeleteAllUserEventHandler(ucsAPI_EventDeleteAllUser);
ucsAPI.EventDeleteUser += new _DIUCSAPIEvents_EventDeleteUserEventHandler(ucsAPI_EventDeleteUser);
ucsAPI.EventFingerImageData += new _DIUCSAPIEvents_EventFingerImageDataEventHandler(ucsAPI_EventFingerImageData);
ucsAPI.EventFirmwareUpgraded += new _DIUCSAPIEvents_EventFirmwareUpgradedEventHandler(ucsAPI_EventFirmwareUpgraded);
ucsAPI.EventFirmwareUpgrading += new _DIUCSAPIEvents_EventFirmwareUpgradingEventHandler(ucsAPI_EventFirmwareUpgrading);
ucsAPI.EventFirmwareVersion += new _DIUCSAPIEvents_EventFirmwareVersionEventHandler(ucsAPI_EventFirmwareVersion);
ucsAPI.EventGetAccessLog += new _DIUCSAPIEvents_EventGetAccessLogEventHandler(ucsAPI_EventGetAccessLog);
ucsAPI.EventGetAccessLogCount += new _DIUCSAPIEvents_EventGetAccessLogCountEventHandler(ucsAPI_EventGetAccessLogCount);
ucsAPI.EventGetTAFunction += new _DIUCSAPIEvents_EventGetTAFunctionEventHandler(ucsAPI_EventGetTAFunction);
ucsAPI.EventGetUserCount += new _DIUCSAPIEvents_EventGetUserCountEventHandler(ucsAPI_EventGetUserCount);
ucsAPI.EventGetUserData += new _DIUCSAPIEvents_EventGetUserDataEventHandler(ucsAPI_EventGetUserData);
ucsAPI.EventGetUserInfoList += new _DIUCSAPIEvents_EventGetUserInfoListEventHandler(ucsAPI_EventGetUserInfoList);
ucsAPI.EventOpenDoor += new _DIUCSAPIEvents_EventOpenDoorEventHandler(ucsAPI_EventOpenDoor);
ucsAPI.EventPictureLog += new _DIUCSAPIEvents_EventPictureLogEventHandler(ucsAPI_EventPictureLog);
ucsAPI.EventRealTimeAccessLog += new _DIUCSAPIEvents_EventRealTimeAccessLogEventHandler(ucsAPI_EventRealTimeAccessLog);
ucsAPI.EventSetAccessControlData += new _DIUCSAPIEvents_EventSetAccessControlDataEventHandler(ucsAPI_EventSetAccessControlData);
ucsAPI.EventSetTAFunction += new _DIUCSAPIEvents_EventSetTAFunctionEventHandler(ucsAPI_EventSetTAFunction);
ucsAPI.EventSetTATime += new _DIUCSAPIEvents_EventSetTATimeEventHandler(ucsAPI_EventSetTATime);
ucsAPI.EventTerminalStatus += new _DIUCSAPIEvents_EventTerminalStatusEventHandler(ucsAPI_EventTerminalStatus);
ucsAPI.EventVerifyCard += new _DIUCSAPIEvents_EventVerifyCardEventHandler(ucsAPI_EventVerifyCard);
ucsAPI.EventVerifyFinger1to1 += new _DIUCSAPIEvents_EventVerifyFinger1to1EventHandler(ucsAPI_EventVerifyFinger1to1);
ucsAPI.EventVerifyFinger1toN += new _DIUCSAPIEvents_EventVerifyFinger1toNEventHandler(ucsAPI_EventVerifyFinger1toN);
ucsAPI.EventVerifyPassword += new _DIUCSAPIEvents_EventVerifyPasswordEventHandler(ucsAPI_EventVerifyPassword);
ucsAPI.EventPrivateMessage += new _DIUCSAPIEvents_EventPrivateMessageEventHandler(ucsAPI_EventPrivateMessage);
ucsAPI.EventPublicMessage += new _DIUCSAPIEvents_EventPublicMessageEventHandler(ucsAPI_EventPublicMessage);
ucsAPI.EventUserFileUpgrading += new _DIUCSAPIEvents_EventUserFileUpgradingEventHandler(ucsAPI_EventUserFileUpgrading);
ucsAPI.EventUserFileUpgraded += new _DIUCSAPIEvents_EventUserFileUpgradedEventHandler(ucsAPI_EventUserFileUpgraded);
ucBioBSP.OnCaptureEvent += new _IUCBioBSPEvents_OnCaptureEventEventHandler(ucBioBSP_OnCaptureEvent);
ucBioBSP.OnEnrollEvent += new _IUCBioBSPEvents_OnEnrollEventEventHandler(ucBioBSP_OnEnrollEvent);
//InitListview();
//InitCommandList();
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
}
void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
{
//MessageBox.Show(e.Exception.ToString());
}
最佳答案
感谢 ouflak 和 HadeS 帮我找到问题。
问题已经解决
ouflak:您能发布 OnPropertyChanged 代码吗?我在那里看到了一些奇怪的问题,其中存在由那里的问题引起的无限递归循环。
waqar habib:是的....当我启动 ucsAPI.ServerStart(255, 9870) 时; ,然后 OnPropertyChanged 事件甚至不工作什么,启动终端后我更新我的列表并再次通过相同的错误......你是对的......我在启动终端后做了什么,我称之为_fpReset();至少此时不是通过错误我希望我们有一些如何捕获错误......非常感谢,伙计……至少它现在开始说话了……;)
关于c# - 算术运算wpf中的上溢或下溢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22188923/
有没有办法在另一个 WPF 窗口内托管 WPF 窗口。我有几个有点复杂的表格。但现在为了简化事情,我试图将其中一些合并为一个“仪表板”表单中的标签页。 请注意,我不是要托管 Windows 窗体,而是
WPF 特有的哪些方面和实践在非 WPF GUI 编程中最有用(并且并非难以实现)? 最佳答案 通过学习 WPF 命令,我了解了命令模式。它构成了 UI - 代码分离的基础,我认为应该在其他应用程序中
WinRT/Metro 正在获得一个新的 SemanticZoom控制,但我很难为 WPF 找到任何东西。 我不想为我的特定项目切换到 Metro,因为它不允许我制作窗口应用程序或跨多个显示器的多个实
我很难解决我的问题,我快要疯了。 想法是这样的:我有两个 ListView 元素,当一个元素从第一个列表掉落到第二个列表时,我需要打开一个对话,但我需要被掉落的元素的信息以及被添加以填充对话的元素。
如果我遵循TabControl,并且一切正常,当我切换到第二个Tabitem时,它显示就没有问题。 //datagrid //datagrid2 但是如果我有这个xaml,当我
在 Windows 窗体应用程序中,我们的数据 GridView 有很多事件,如行鼠标双击或行单击以及额外的...... 但是在 WPF 中我找不到这些事件。我如何将行鼠标双击添加到其中包含数据网格的
在这个项目中,代码 正确编译和执行 ;但是,我需要帮助解决两个问题: VS2012 WPF 设计器不适用于此 XAML 文件。它显示消息设计 View 对于 x64 和 ARM 目标平台不可用。 我收
目前我正在设计 WPF ScrollViewer,我发现了这个 Content="M 0 0 L 4 4 L 0 8 Z" 阅读 MSDN examples .现在我真的很想知道这意味着什么,但我无法
在 WPF 中,元素的可见性可以为“可见”,但实际上在屏幕上不可见,因为它的父元素(或父元素的父元素)具有折叠的可见性。 我希望能够知道一个元素是否实际呈现在屏幕上,而不必遍历可视化树检查父元素。 有
我应该使用 ApplicationCommands.Close用于关闭模式对话框还是该命令被认为是为关闭应用程序保留的?如果是后者,请大家创建Close每个命令 Dialog盒子或只是一个 Close
WPF 是否有任何可用的 piemenu 控件? 最佳答案 我在我的最爱中找到了这个,你可以看看: This 祝你今天过得愉快。 关于wpf - WPF 的菜单,我们在Stack Overflow上找
我正在尝试使用 WrapPanel 和两个 TextBlock 将星号 (*) 附加到某些文本的左侧,允许文本换行,并强制文本右对齐。通过创建一个 FlowDirection 设置为 RightToL
这里是场景(简化):我在Window上有一个控件(比如说一个Rectangle)。我迷上了MouseMove事件,以使其启动拖放操作。然后在MouseDown事件中进行动画处理,向右移动50个像素。但
我有一个 ListView ,它的项目来源是一个列表。我希望用户只选择一项。当我将 listview 的 SelectionMode 设置为 single 时,用户仍然可以选择多个项目,并且似乎 li
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
INotifyPropertyChanged 的目的是什么。我知道每当更改属性时都会触发此事件,但是 View /用户界面如何知道触发了此事件: 这是实现 INotifyPropertyChang
我正在查看工具箱中的 WPF 组件,但找不到 2005/2008 中存在的错误提供程序。 被移除了吗? 最佳答案 ErrorProvider是一个 Winforms 控件。 WPF 中没有等效项。但是
我试图在单击和双击 wpf Image 控件时有不同的行为。不幸的是,单击首先被触发,因此双击被忽略。 最佳答案 如果您改用 MouseDown 事件,则它在 EventArgs 中为 ClickCo
这可能吗? 我使用了一个框架控件并且:显示(例如:showwindow.xaml) 但是我得到这个错误: root element is not valid for navigation 最佳答案 确
我在蓝色背景的窗口上放置了一个扩展器,我想让扩展器的按钮与默认颜色不同(蓝色,它是从窗口接收的)。当我修改扩展器的背景属性时,它会将整个扩展器、标题和全部更改为新颜色。但是,我只想更改按钮本身。谁能指
我是一名优秀的程序员,十分优秀!