After building, my View looks fine in the Designer until I click anywhere in the XAML window. Then the Designer reports that an Exception was thrown, resulting in the following in the Designer view:
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'.
- StackTrack
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
InnerException: None
I usually also get a squigly line underneath my ToolWindow declaration, with a tooltip that also says "The component 'ActiproSoftware.Products...." [same message as above]
In the Error List window, I get the same message. Apparently, Microsoft is pretty sure that it can't find the resource 'ActiproSoftware.Shared.Wpf.Design.40;component/products.windows.design/taskpaneanchorbutton.xaml'
I am referencing the signed assemblies from a folder that also contains the Design folder, which in turn contains the ActiproSotware...Design.40.dll files.
Here is my View:
<docking:ToolWindow x:Class="Wdh.PrismApplicationPrototype.Modules.RegionManagerViewer.View"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:docking="http://schemas.actiprosoftware.com/winfx/xaml/docking"
Title="Region Manager Tool"
>
<Grid>
<Button Content="Hello?"/>
</Grid>
</docking:ToolWindow>
The View's code-behind file:
using Wdh.PrismApplicationPrototype.SharedInfrastructure.UI;
namespace Wdh.PrismApplicationPrototype.Modules.RegionManagerViewer
{
/// <summary>
/// Interaction logic for View.xaml
/// </summary>
public partial class View : IView
{
public View()
{
InitializeComponent();
}
public IViewModel ViewModel
{
get { return DataContext as IViewModel; }
set { DataContext = value; }
}
}
}
And, for good measure, my ViewModel:
using System.Collections.Generic;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.ServiceLocation;
using Wdh.PrismApplicationPrototype.SharedInfrastructure;
using Wdh.PrismApplicationPrototype.SharedInfrastructure.UI;
namespace Wdh.PrismApplicationPrototype.Modules.RegionManagerViewer
{
class ViewModel : IViewModel
{
private readonly IRegionManager regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
public IEnumerable<IRegion> Regions { get { return regionManager.Regions; } }
public IContext Context { get; set; }
public bool IsNavigationTarget(IContext context)
{
return true;
}
}
}