处理按钮单击XAML C#Windows Phone中ListBox ItemTemplate内的事件

时间:2014-05-31 11:24:18

标签: c# xaml windows-phone-8 listbox

嗨,我是新的Windows手机,我使用下面的代码,现在我需要点击超链接按钮,它在ListBox内。

 <ListBox x:Name="lbbusiness" Width="470" Tap="lbbusiness_Tap">
            <ListBox.ItemTemplate>
                <DataTemplate>
                                <StackPanel x:Name="Header1">
                                    <HyperlinkButton x:Name="SaveData" Width="Auto" CommandParameter="{Binding business_id}" Click="SaveData_Click">
                                        <HyperlinkButton.Template>
                                            <ControlTemplate>
                                                <Image Source="/Assets/Images/MainPageImg/save.png" Width="50" HorizontalAlignment="Right" Margin="0,0,15,0"></Image>
                                            </ControlTemplate>
                                        </HyperlinkButton.Template>
                                    </HyperlinkButton>
                                    <TextBlock x:Name="Businessname" Text="{Binding business_name}" VerticalAlignment="Top" HorizontalAlignment="Left" Foreground="White" Margin="0,-45,0,0"></TextBlock>
                                </StackPanel>


                            <StackPanel x:Name="Footer" HorizontalAlignment="Left">
                                <TextBlock x:Name="rating" Foreground="Black" HorizontalAlignment="Left" FontSize="18" Margin="0,-5,0,0">
                               <Run Text="Score"/>
                               <Run Text="{Binding avg_rate}"/>
                               <Run Text="From"/>
                               <Run Text="{Binding rate_votes}"/>
                               <Run Text="Votes"/>
                                </TextBlock>
                            </StackPanel>
                        </StackPanel>
                    </Border>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

它的触发但是在调用事件时发生错误,

     System.ArgumentOutOfRangeException

0 个答案:

没有答案