'CommandConverter' problem

Topics: Prism v4 - WPF 4
Apr 7, 2011 at 5:15 PM

Hi guys,

I am introducing now Prism to our new project in the company. :)

The project is WPF4.

A normal Button on my View can perfectly connect to the ViewModel however if I have the button inside a Style/Template, I get an error:

<Style x:Key="DatagridColumnHeaderCustomTemplateStyle" TargetType="{x:Type DataGridColumnHeader}">
   <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
                        <Grid MouseLeftButtonDown="Grid_MouseLeftButtonDown">
                          <Button Width="50" Content="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}, Path=DataContext.MultiSortCommand}" Command="{Binding MultiSortCommand}" Grid.Row="1" />


Error

'CommandConverter' is unable to convert 'Microsoft.Practices.Prism.Commands.DelegateCommand' to 'System.String'.

Any idea? Its a tough nut :(

Thanks,
Houman

Apr 7, 2011 at 7:14 PM
Edited Apr 7, 2011 at 7:14 PM

Hi Houman,

You might find the following thread useful, as a similar problem is dealt with:

command in datagrid not work

I hope you find this helpful.

Thanks,

Miguel Bronzovic
http://blogs.southworks.net/mbronzovic