Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
[WPF] fix immediate tab label expanding
Browse files Browse the repository at this point in the history
Invalidate measure of each TabItem, when the ExpandTabLabels
property changes, forcing Wpf to reeavluate the tab sizes.
  • Loading branch information
sevoku committed Jan 23, 2015
1 parent 40501c7 commit 30c4627
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Xwt.WPF/Xwt.WPFBackend/NotebookBackend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,17 @@ class WpfNotebook : SWC.TabControl, IWpfWidget
{
public WidgetBackend Backend { get; set; }

public bool ExpandTabLabels { get; set; }
bool expandTabLabels;
public bool ExpandTabLabels {
get {
return expandTabLabels;
}
set {
expandTabLabels = value;
foreach (var tab in Items.Cast<TabItem> ())
tab.InvalidateMeasure ();
}
}

protected override System.Windows.Size MeasureOverride (System.Windows.Size constraint)
{
Expand Down

0 comments on commit 30c4627

Please sign in to comment.