0
我有列表框中的一些聯繫人編號在列表框中現在我想添加顯示和隱藏按鈕到列表框中的每個聯繫人項目當用戶按下隱藏按鈕接點都會被隱藏,當用戶按下顯示按鈕的接觸將是展示和反之亦然我如何在WP8做.. 我用下面的代碼,請幫助我..如何添加顯示和隱藏按鈕與圖像在Windows Phone 8的列表框中的項目
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Margin="0, 10, 0, 10">
<Border BorderThickness="0" HorizontalAlignment="Left" VerticalAlignment="Center" BorderBrush="{StaticResource PhoneAccentBrush}" Margin="5, 0, 0, 0">
<Image Source="{Binding ImageUrl, Converter={StaticResource kconverter}}" Width="48" Height="48" Stretch="Fill"/>
</Border>
<TextBlock x:Name="item_name" Text="{Binding Name, Mode=OneWay}" FontSize="{StaticResource PhoneFontSizeLarge}" Margin="10, 0, 0, 0" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0, 10, 0, 10">
<Border BorderThickness="0" HorizontalAlignment="Left" VerticalAlignment="Center" BorderBrush="{StaticResource PhoneAccentBrush}" Margin="355, 0, 0, 0">
<Image Name="onimg" Visibility="Visible" Source="/Assets/Images/blue.button.png" Width="85" Height="20" Tap="Image_TapOn" Stretch="Fill"/>
</Border>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0, 10, 0, 10">
<Border BorderThickness="0" HorizontalAlignment="Left" VerticalAlignment="Center" BorderBrush="{StaticResource PhoneAccentBrush}" Margin="355, 0, 0, 0">
<Image Name="offimg" Visibility="Collapsed" Source="/Assets/Images/setting-h.png" Width="85" Height="48" Tap="Image_TapOff" Stretch="Fill"/>
</Border>
</StackPanel>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
感謝您的幫助,先生.. – user
先生,我有一個更多的問題,我想添加一個列表框選定的項目,請檢查此鏈接 http://stackoverflow.com/questions/29844360/wp8-cant-show-listbox-item-after-using-hardware-back-button – user