I changed the view property and the X axis list to dependency properties but no luck. Then I created a new class (XAxes) that implements IList<axisx> and IList (and replaced the List<axisx> property in the view class with that) so I could debug if accessing the X axis list doesn't work. Didn't see anything wrong with that. But when I add two X axes in addition to the already created X axis this exception pops out in designer: http://postimage.org/image/8an21q0jr/[^]
Here's the whole stack trace:
System.ArgumentOutOfRangeException
Specified argument was out of the range of valid values.
Parameter name: index
at MS.Internal.VirtualModel.VirtualModelItemCollection.Insert(Int32 index, IVirtualModelItem item)
at MS.Internal.VirtualModel.VirtualModelItemCollection.Insert(Int32 index, Object value)
at MS.Internal.Designer.PropertyEditing.Model.Properties.ModelItemCollectionAggregate.<>c__DisplayClassc.<Insert>b__8(ChangeEntry change, Int32 i)
at MS.Internal.Designer.PropertyEditing.Model.Properties.ModelItemCollectionAggregate.ManageCollections(SetupDelegate setup, IterationDelegate iterate, NotifyChangeDelegate notifyChange, ReturnValueDelegate returnValue)
at MS.Internal.Designer.PropertyEditing.Model.Properties.ModelItemCollectionAggregate.Insert(Object value, Int32 index)
at MS.Internal.Designer.PropertyEditing.Model.Properties.ModelPropertyValueCollection.Insert(Object value, Int32 index)
at MS.Internal.Designer.PropertyEditing.FromExpression.Framework.PropertyInspector.CollectionDialogEditor.AddItem()
at MS.Internal.Designer.PropertyEditing.FromExpression.Framework.PropertyInspector.CollectionDialogEditor.OnQuickTypesCurrentChanged(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Data.CollectionView.OnCurrentChanged()
at System.Windows.Data.ListCollectionView.MoveCurrentToPosition(Int32 position)
at System.Windows.Data.CollectionView.MoveCurrentTo(Object item)
at MS.Internal.Designer.PropertyEditing.Editors.CollectionDialogEditor.OnAddNewItem(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
at System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
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.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
at System.Windows.Input.RoutedCommand.ExecuteCore(Object parameter, IInputElement target, Boolean userInitiated)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(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.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(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)
Something pretty weird is going on when inserting elements to the list. Well, I'm out of ideas. I'm probably going to have to tell people not to use XAML code or designer in WPF until this problem is solved. Put "[Browsable(false)]" on every property or something...
modified 15-Dec-21 21:01pm.
|