Hi,
I'm not quite sure if this is the correct forum for this question (it may be more IDE orDebug related) but I'll try here first anyway.
I've written a WPF application the compiles and runs successfully. However when I bring up one of my WPF .xaml pages it underlines one of myObjectDataProvider tagsin blue and gives me the non helpful message as follows:
Exception has been thrown by the target of an invocation
I've checked my code and can't see anything wrong and like I said- the program does run as expected.
Then I hear you say - "Well if your program works who cares about the message". Ahh but the problem is whilst this error message exists I can't display the page in the designer and I can't see the page properties. Perhaps it doesn't like databinding in user controls?
Code Block
<
UserControl x:Class="IB.WESS.UI.FieldSales.Contracts.ContractUserControls.UC_Conditionality"
xmlns:local="clr-namespace:IB.WESS.UI.FieldSales.Contracts.ContractUserControls"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="Auto" Width="Auto">
<UserControl.Resources>
<ObjectDataProvider ObjectType="{x:Type local:ProductCategories}" x:Key="odpProductCategories" />
<ObjectDataProvider ObjectType="{x:Type local:PaymentTypes}" x:Key="odpPaymentTypes" />
<ObjectDataProvider ObjectType="{x:Type local:TrackingFrequencies}" x:Key="odpTrackingFrequency"/>
<ObjectDataProvider ObjectType="{x:Type local:ConditionalityGroups}" x:Key="odpConditionalityGroups" />
</< FONT>UserControl.Resources>
etc...
code behind class of the 1st Object (rest of the objects are the same)
Code Block
public class ProductCategories : ObservableCollection<ProductCategoryEntity>
{
public ProductCategories()
{
ProductCategoryCollection products = new ProductCategoryCollection();
BaseDataManager baseDataManager = new BaseDataManager();
products = baseDataManager.GetAllProductCategories();
foreach (ProductCategoryEntity productCategoryEntity in products)
{
this.Add(productCategoryEntity);
}
}
}
Now I am still using Visual Studio 2008 beta. May be this is an issue that is fixed in the recently released MSDN version?
May be there is some way to get the IDE to give me a more detailed description of what it's complaining about?
Any help / pointers would be great.
Thanks