problem with locating viewmodel

Topics: Actions & Coroutines
Feb 24, 2014 at 2:15 PM
Hello,
I've in a usercontrol defined this item

<search:RicercaRapportoInlineView x:Name="RapportiSearch"></search:RicercaRapportoInlineView>

where it's definition is

<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
        <TextBlock x:Name="SearchText" HorizontalAlignment="Left" TextAlignment="Center" Text="Rapporto"
                                      VerticalAlignment="Center"/>
        <TextBox x:Name="PART_SearchTextBox" VerticalContentAlignment="Center" HorizontalAlignment="Left"
                                     Width="200" BorderBrush="Gray" BorderThickness="1" 
                                     Text="{Binding Path=SearchText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource TemplatedParent}}"/>
        <TextBlock x:Name="tb2" HorizontalAlignment="Left" Text="Intestazione" 
                                       VerticalAlignment="Center" Margin="5,0,0,0"/>
        <TextBlock x:Name="PART_DescriptionTextBlock" TextAlignment="Center" VerticalAlignment="Center"
                                       Text="{Binding Path=SelectedRapporto.INTESTAZIONE,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource TemplatedParent}}"
                                       MaxWidth="500" Background="LightGray" MinWidth="200" />
        <Button x:Name="GridSearch"  HorizontalAlignment="Right" Margin="2,0,0,0" >
            <Button.Content>
                <Image Height="15" Width="15">
                    <Image.Source>
                        <BitmapImage UriSource="/DOME;component/Media/find.png"></BitmapImage>
                    </Image.Source>
                </Image>
            </Button.Content>
        </Button>
    </StackPanel>
and I've its viewmodel ... now in another viewmodel I've defined a public property called

[Import]
public RicercaRapportoInlineViewModel RapportiSearch { get; set; }

When I click on the GridSearch as on the other items of my usercontrol no action is beign fired in the viewmodel...I think there's something missing on the binding.... can someone help me?
tHanks