我longlistselector
包含datatemplate
image
,text
和两个buttons
,
现在我想做的是,当我在longlistselector中选择items
时,相应的项buttons
将可见
答案 0 :(得分:0)
将您的LongListSelector与Selected item属性绑定,当您的选择被更改时,将调用Property,您可以获取选择的元素,然后更改按钮的可见性...
<ls:LongListSelector Margin="0,10,0,10" ItemsSource="{Binding attractionlist,Mode=TwoWay,UpdateSourceTrigger=Default}" SelectedItem="{Binding SelectedAttractionDetail,Mode=TwoWay,UpdateSourceTrigger=Default}" >
然后制作这样的房产..
private ObservableCollection<AttractionDetails> _attractionlist;
public ObservableCollection<AttractionDetails> attractionlist
{
get
{
return _attractionlist;
}
set
{
_attractionlist = value;
RaisePropertyChanged("attractionlist");
// Change visibility here
}
}