public bool IsGrouped
{
get => isGrouped;
- internal set
+ set
{
- if (isGrouped != value)
+ isGrouped = value;
+ needInitalizeLayouter = true;
+ //Need to re-intialize Internal Item Source.
+ if (InternalItemSource != null)
{
- isGrouped = value;
- //Need to re-intialize Internal Item Source.
- if (InternalItemSource != null)
- {
- InternalItemSource.Dispose();
- InternalItemSource = null;
- }
- if (ItemsSource != null)
- InternalItemSource = ItemsSourceFactory.Create(this);
+ InternalItemSource.Dispose();
+ InternalItemSource = null;
}
- needInitalizeLayouter = true;
+ if (ItemsSource != null)
+ InternalItemSource = ItemsSourceFactory.Create(this);
Init();
}
}
/// DataTemplate of group header.
/// </summary>
/// <remarks>Please note that, internal index will be increased by group header.
- /// GroupHeaderTemplate is essential for groupable view.</remarks>
+ /// GroupHeaderTemplate is essential for groupable view.</remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
public DataTemplate GroupHeaderTemplate
{
set
{
groupHeaderTemplate = value;
- if (value != null) IsGrouped = true;
- else IsGrouped = false;
+ needInitalizeLayouter = true;
+ //Need to re-intialize Internal Item Source.
+ if (InternalItemSource != null)
+ {
+ InternalItemSource.Dispose();
+ InternalItemSource = null;
+ }
+ if (ItemsSource != null)
+ InternalItemSource = ItemsSourceFactory.Create(this);
+ Init();
}
}