DateTimeEditBox Exception

Editors for WPF Forum

Posted 10 years ago by Rod Spencer - Service Software Engineer, Segway
Version: 14.1.0602
Avatar

Hi,

I'm using the 2014.1 version of the actipro library in Visual Studio 2013 and I'm trying to use the DateTimeEditBox and I'm getting the following exception in the VS editor: Exception: The component 'ActiproSoftware.Products.Windows.Design.TaskPaneAnchorButton' does not have a resource identified by the URI '/ActiproSoftware.Shared.Wpf.Design.40;component/products.windows.design/taskpaneanchorbutton.xaml'.

The application runs, but I have no dropdown button. Can you explain what is happening and how do I fix this?

<UserControl x:Class="Segway.Service.Load.Load_Control"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:wpfres="clr-namespace:Segway.WPFResources;assembly=WPFResources"
             xmlns:editors="http://schemas.actiprosoftware.com/winfx/xaml/editors"
             xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared"
             mc:Ignorable="d" 
             d:DesignHeight="350" d:DesignWidth="600">
.
.
.
        <Grid Grid.Column="1" Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="150"/>
                <ColumnDefinition Width="150"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="1" Text="Start Date/Time" VerticalAlignment="Center" FontSize="16" />
            <editors:DateTimeEditBox Grid.Column="2" Width="200" HorizontalAlignment="Left" 
                                     Value="{Binding Path=StartDate, Mode=TwoWay}"
                                     DropDownButtonVisibility="Visible" MinDropDownHeight="150" 
                                     MaxDropDownHeight="250"
                                     />
        </Grid>

[Modified 10 years ago]

Comments (4)

Posted 10 years ago by Rod Spencer - Service Software Engineer, Segway
Avatar

I forgot to mention that I'm using 2014.1

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Rod,

Thanks for writing.  I tried to repro the designer error by opening our DateTimeEditBox sample in the VS 2013 Update 3 designer but it opened up ok for me.  Are you able to repro it in our sample?

I think your dropdown button issue is that you made your edit box a width of 200 but you put it in a 150px wide column of the Grid.


Actipro Software Support

Posted 10 years ago by Rod Spencer - Service Software Engineer, Segway
Avatar

Thank you for you quick response.  One difference is that I'm using VS 2013 Update 2. I wouldn't think that would make any difference.

I removed the width and now the dropdown arrow is visible.  I'm assuming that it was there before, but just not visible.  However, I'm still getting the exception error, however, the control seems to be working.

I took my code and placed it in the sample code:

...\Documents\Actipro Software\WPF-Controls\v14.1.0601\SampleBrowser\ProductSamples\EditorsSamples\EditBoxes\DateTimeEditBox\MainControl.xaml

and this does not produce an exception.  I then took the sample code and placed it in my code (which is what I did in the first place) which is as follows: 

<editors:DateTimeEditBox x:Name="editBox" CheckBoxVisibility="Visible"
SpinnerVisibility="{Binding IsChecked, ElementName=spinnerVisibilityCheckBox, Converter={StaticResource BooleanToVisibilityConverter}}"
Width="200" Margin="0,7,0,0" HorizontalAlignment="Left" Value="{x:Static system:DateTime.Now}">
<editors:DateTimeEditBox.LayoutTransform>
<ScaleTransform ScaleX="{Binding ElementName=scaleSlider, Path=Value}"
ScaleY="{Binding ElementName=scaleSlider, Path=Value}" />
</editors:DateTimeEditBox.LayoutTransform>
</editors:DateTimeEditBox>

 

Since I am not using a Slider and Spinner, I removed those lines, removed the Width, added the Grid Column, changed the Value to my original binding and ended up with this:

<editors:DateTimeEditBox x:Name="editBox" Grid.Column="2" CheckBoxVisibility="Visible"
Margin="0,7,0,0" HorizontalAlignment="Left" Value="{Binding Path=StartDate, Mode=TwoWay}">
</editors:DateTimeEditBox>

 

After a few seconds I got two popup boxes indicating that the designer has crashed.  In one of them, I get the following.  I went to the folders specified (after a closed the windows) and these files are not there.

Files that help describe the problem:
...\AppData\Local\Temp\WERCC53.tmp.WERInternalMetadata.xml
...\AppData\Local\Temp\WEREE35.tmp.appcompat.txt
...\AppData\Local\Temp\WEREEE2.tmp.mdmp

Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt

 

Then I get the full exception message displayed in the Xaml portion of the design screen

System.Exception

The component 'ActiproSoftware.Products.Windows.Design.TaskPaneAnchorButton' does not have a resource identified by the URI '/ActiproSoftware.Shared.Wpf.Design.40;component/products.windows.design/taskpaneanchorbutton.xaml'.
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at ActiproSoftware.Products.Windows.Design.TaskPaneAnchorButton.InitializeComponent()
at ActiproSoftware.Products.Windows.Design.TaskPaneAnchorButton..ctor()
at ActiproSoftware.Products.Windows.Design.PrimarySelectionAdornerProviderBase..ctor(String taskPaneTitle)
at #Lld.#Xld..ctor()

System.Reflection.TargetInvocationException
Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Windows.Design.Features.FeatureManager.CreateFeatureProvider(Type featureProviderType)
at Microsoft.Windows.Design.Features.FeatureManager.<CreateFeatureProviders>d__1c.MoveNext()
at Microsoft.Windows.Design.Features.FeatureManager.<CreateFeatureProviders>d__15.MoveNext()
at Microsoft.Windows.Design.Policies.PolicyDrivenFeatureConnector'1.CreateFeatureProviders(ModelItem item, ItemPolicy policy, List'1 dataList)
at Microsoft.Windows.Design.Policies.PolicyDrivenFeatureConnector'1.OnPolicyItemsChanged(Object sender, PolicyItemsChangedEventArgs e)
at System.EventHandler'1.Invoke(Object sender, TEventArgs e)
at Microsoft.Windows.Design.Policies.ItemPolicy.OnPolicyItemsChanged(PolicyItemsChangedEventArgs e)
at Microsoft.Windows.Design.Policies.SelectionPolicy.OnSelectionChanged(Selection newSelection)
at Microsoft.Windows.Design.ContextItemManager.SubscribeProxy'1.SubscribeContext(ContextItem item)
at Microsoft.Windows.Design.SubscribeContextCallback.Invoke(ContextItem item)
at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.OnItemChanged(ContextItem item)
at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.SetValue(ContextItem value)
at Microsoft.Expression.DesignSurface.ViewModel.Extensibility.ExtensibilityManager.SetSelection(Selection selection)
at Microsoft.Expression.DesignSurface.ViewModel.Extensibility.ExtensibilityManager.ForceAdornerUpdate()
at Microsoft.Expression.DesignSurface.View.SceneView.RebuildAdornerSets()
at Microsoft.Expression.XamlPlatform.Views.XamlSceneView.UpdateInternal(Boolean updateInstances, Boolean updateReferences)
at Microsoft.Expression.WpfPlatform.Views.WpfSceneView.UpdateInternal(Boolean updateInstances, Boolean updateReferences)
at Microsoft.Expression.XamlPlatform.Views.XamlSceneView.UpdateFromDamage(ViewStateBits viewStateBits, DocumentNodeChangeList damage, SceneUpdateStates sceneUpdateStates)
at Microsoft.Expression.DesignSurface.ViewModel.SceneViewModel.TryUpdateView(PipelineUpdateInfo pipelineUpdateInfo)
at Microsoft.Expression.DesignSurface.ViewModel.SceneViewModel.FirePipelineUpdate(PipelineUpdateInfo pipelineUpdateInfo)
at Microsoft.Expression.DesignSurface.ViewModel.SceneViewModel.RefreshCurrentValues()
at Microsoft.Expression.XamlPlatform.Views.XamlSceneView.ShowException(Exception exception)
at Microsoft.Expression.DesignSurface.Utility.DesignerExceptionHandler.ShowException(Exception exception)
at Microsoft.Expression.DesignSurface.Utility.DesignerExceptionHandler.CurrentDispatcher_UnhandledException(Object sender, DispatcherUnhandledExceptionEventArgs e)
at Microsoft.Expression.DesignHost.Isolation.Primitives.IsolationBoundary.RemoteIsolationContext.CurrentDispatcher_UnhandledException(Object sender, DispatcherUnhandledExceptionEventArgs e)
at System.Windows.Threading.Dispatcher.CatchException(Exception e)
at System.Windows.Threading.Dispatcher.CatchExceptionStatic(Object source, Exception e)
at System.Windows.Threading.ExceptionWrapper.CatchException(Object source, Exception e, Delegate catchHandler)
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 Microsoft.Expression.DesignHost.Isolation.DesignerProcess.RunApplication()
at Microsoft.Expression.DesignHost.Isolation.DesignerProcess.<>c__DisplayClass2.<Main>b__0()
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()

 

This seems like a lot of stuff.  

In summary, putting my code in the sample does not create the exception.  Putting the sample code in my project still generates the exception.

I hope this helps.  

[Modified 10 years ago]

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

This may be the same thing as this other exception we found and reported to Microsoft in the past:

https://connect.microsoft.com/VisualStudio/feedbackdetail/view/843637/vs-2013-designer-errors-out-after-rebuild-when-using-custom-controls-with-designer-extensibility

All of this used to work but I think in the course of VS updates over time they broke it. :)  Per the reply in that thread, we need to revisit and rearchitect everything in our designer code to avoid using ComponentResourceKey references.  We have that on our TODO list.  You should be able to work around the problem in the meantime by using XAML only view in the designer when it occurs.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.