This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I just test the sample application "PropertyGridCustomization". When I goto page 7 then input Chinese letter in the "age" column, the app hang up. The tace stack is followed:
在 System.String.Insert(Int32 startIndex, String value) 在 #lu.#gm.#iq(String input, Int32 position) 在 #lu.#gm.#iq(#pm where, String input) 在 Mindscape.WpfElements.NumericTextBoxBase`1.#Y(String text) 在 Mindscape.WpfElements.NumericTextBoxBase`1.OnPreviewTextInput(TextCompositionEventArgs e) 在 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) 在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) 在 System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) 在 System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) 在 System.Windows.Input.InputManager.ProcessStagingArea() 在 System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) 在 System.Windows.Documents.ImmComposition.RaiseTextInputEvent(FrameworkTextComposition composition, String compositionString) 在 System.Windows.Documents.ImmComposition.OnWmImeChar(IntPtr wParam, Boolean& handled) 在 System.Windows.Documents.ImmComposition.ImmCompositionFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 在 System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) 在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 在 System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) 在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 在 MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) 在 MS.Win32.HwndSubclass.DefWndProcWrapper(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 在 MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) 在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 在 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) 在 System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG& msg) 在 System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) 在 System.Windows.Application.RunInternal(Window window) 在 CustomizationWalkthrough.App.Main() 位置 C:\Program Files (x86)\Mindscape\WPF Elements\Samples\PropertyGridCustomization\obj\Debug\App.g.cs:行号 0 在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) 在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 在 System.Threading.ThreadHelper.ThreadStart() |
|
|
We haven't been able to reproduce this but I have found where I think it is occurring and why, and have implemented a fix which will be in the next nightly build. As we haven't been able to repro the problem, I can't guarantee that this will fix your problem, but if you could give it a try and let us know then that would be awesome. The new build will be available from about 1200 UTC. |
|
|
I'll be very glad to have a try when this patch is available. More information about this issue from VS debuger: "Index out of range, must be nonnegative value and less than the size of the array, Parameter name: startIndex"
|
|
|
Hi, |
|
|
Thanks for reporting this. We're not sure what's going on here but our guess is that the IME is somehow circumventing the normal WPF text input events (which are where we do our input filtering). We're don't currently have a Chinese-language test machine set up so this may take a little while to investigate, but we will try to get back to you as soon as possible. |
|
|
Okay, it seems that the IME is not providing input events in the same way as the keyboard does. We have a proposed fix but for compatibility reasons we do not want to implement it into the core control; furthermore, we don't know whether our proposed fix might run into subtler issues with the IME or whether you will need to perform further filtering or processing on IME input. Fortunately it is possible for you to implement it in your own code, which will give you maximum control if further issues arise. Here is what you need to do: * Derive a class from IntegerTextBox, e.g. ImeAwareIntegerTextBox. * In your constructor, add the following line: TextCompositionManager.AddPreviewTextInputUpdateHandler(this, OnPreviewTextInputUpdate); * In the body of the class, add the following event handler: private void OnPreviewTextInputUpdate(object sender, TextCompositionEventArgs e) * Create a data template using the ImeAwareIntegerTextBox (either directly or within a SpinDecorator to provide up-down arrows). * Set the Age property to use your data template instead of the built-in editor. We hope this helps! |
|