1
下面是触发的PropertyChanged属性:列表框结合不同于TextBlock的行为不同结合
public override List<Tag> Tags
{
get
{
return base.Tags;
}
set
{
if (base.Tags != value) {
base.Tags = value;
if (PropertyChanged != null)
{
PropertyChanged(this,
new PropertyChangedEventArgs("Tags"));
PropertyChanged(this,
new PropertyChangedEventArgs("TotalTagPages"));
PropertyChanged(this,
new PropertyChangedEventArgs("PageHasTags"));
}
}
}
}
这种控制刷新正确时CurrentPage.Tags修改:
<TextBlock DockPanel.Dock="Bottom" Name="TagHeader"
Text="{Binding CurrentPage.Tags,
Converter={converter:EnumerableToSpacedString}}"
Foreground="White" />
这一个不刷新时CurrentPage.Tags被更改,但当CurrentPage本身发生更改时会这样做:
<ListBox VerticalAlignment="Top"
Style="{StaticResource DarkListBox}"
ItemTemplate="{StaticResource TagTemplateNoCounts}"
ItemsSource="{Binding CurrentPage.Tags}" >
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"></StackPanel>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
任何想法?
当你说*“改为” *你的意思'Tags'是越来越设置为其他清单,对吗? –
正确........ –
您是否在输出窗口中启用了绑定错误?如果是这样(如果不这样做)是否有任何绑定错误? – CodingGorilla