Skip to content

Commit 49242e4

Browse files
committed
Another fix for closeable tabs
1 parent e519307 commit 49242e4

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

samples/Myra.Samples.CustomUIStylesheet/Myra.Samples.CustomUIStylesheet.FNA.Core.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414

1515
<ItemGroup>
1616
<ProjectReference Include="..\..\src\Myra\Myra.FNA.Core.csproj" />
17-
</ItemGroup></Project>
17+
</ItemGroup>
18+
</Project>

src/Myra/Graphics2D/UI/Properties/PropertyGrid.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ public object Object
206206

207207
_object = value;
208208
Rebuild();
209+
210+
ObjectChanged?.Invoke(this, EventArgs.Empty);
209211
}
210212
}
211213

@@ -340,6 +342,7 @@ public string Filter
340342
public Func<Record, object, Widget> CustomWidgetProvider;
341343

342344
public event EventHandler<GenericEventArgs<string>> PropertyChanged;
345+
public event EventHandler ObjectChanged;
343346

344347
private PropertyGrid(TreeStyle style, string category, Record parentProperty, PropertyGrid parentGrid = null)
345348
{

src/Myra/Graphics2D/UI/Selectors/TabControl.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ protected override void InsertItem(TabItem item, int index)
230230

231231
var button = new ListViewButton
232232
{
233-
Tag = item,
234233
HorizontalAlignment = HorizontalAlignment.Stretch,
235234
VerticalAlignment = VerticalAlignment.Stretch,
236235
Height = item.Height,
@@ -246,10 +245,13 @@ protected override void InsertItem(TabItem item, int index)
246245

247246
if (!CloseableTabs)
248247
{
248+
button.Tag = item;
249249
_gridButtons.Widgets.Insert(index, button);
250250
} else
251251
{
252252
var topItemPanel = new HorizontalStackPanel();
253+
topItemPanel.Tag = item;
254+
253255
topItemPanel.Widgets.Add(button);
254256
StackPanel.SetProportionType(button, ProportionType.Fill);
255257

0 commit comments

Comments
 (0)