This project has moved and is read-only. For the latest updates, please go here.

Type 'TaxGroupListViewModel' is not usable as an object element because it is not public or does not define a public parameterless constructor or a type converter

Nov 7, 2011 at 12:22 PM

Hello. Why i'm getting this error when trying to use ViewModel in xaml file:

<vm:TaxGroupListViewModel 
    xmlns:vm="clr-namespace:WTP.Applications.ViewModels;assembly=WTP.Applications"
    xmlns:bo="clr-namespace:WTP.Domain;assembly=WTP.Domain">

    <vm:TaxGroupListViewModel.TaxGroups>
        <bo:TaxGroup SerialNumber="q" Name="dssd"/>
        <bo:TaxGroup SerialNumber="q" Name="dssd"/>
    </vm:TaxGroupListViewModel.TaxGroups>

</vm:TaxGroupListViewModel>

TaxGroupListViewModel.cs:

public class TaxGroupListViewModel : ViewModel<ITaxGroupListView>
    {
        public TaxGroupListViewModel(ITaxGroupListView view, IEnumerable<TaxGroup> taxGroups ):base(view)
        {
            if (taxGroups == null)
            {
                throw new ArgumentNullException("taxGroups");
            }

            _taxGroups = taxGroups;
            _selectedTaxGroups = new ObservableCollection<TaxGroup>();
        }
}

Nov 21, 2012 at 10:36 PM

Hi Volokos,

Did you mange to fix this problem? I am experiencing the same thing.

Thanks,

Sabba