Skip to content

Commit 5015fdf

Browse files
corvinszCorvin SzimionKeboo
authored
Fix 3706 - close tab items in demo (#3707)
* Cleanup of launchSettings and Cards Page in Demo * Revert "Cleanup of launchSettings and Cards Page in Demo" This reverts commit ede38d4. * fixed a bug in the demo app which removed the wrong TabItem in the TabControl of which the TabItems can be "closed" * Clean up binding path --------- Co-authored-by: Corvin Szimion <[email protected]> Co-authored-by: Kevin Bost <[email protected]>
1 parent 94f2177 commit 5015fdf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/MainDemo.Wpf/Domain/TabsViewModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ internal class TabsViewModel : ViewModelBase
2323

2424
public TabsViewModel()
2525
{
26-
var closeCommand = new AnotherCommandImplementation(_ =>
26+
var closeCommand = new AnotherCommandImplementation(tab =>
2727
{
28-
if (SelectedTab is { } selectedTab)
29-
CustomTabs?.Remove(selectedTab);
28+
if (tab is CustomTab castedTab)
29+
CustomTabs?.Remove(castedTab);
3030
});
3131

3232
CustomTabs = new()

src/MainDemo.Wpf/Tabs.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@
732732
<DataTemplate>
733733
<StackPanel Orientation="Horizontal">
734734
<TextBlock Text="{Binding CustomHeader}" />
735-
<Button Command="{Binding CloseCommand}">
735+
<Button Command="{Binding CloseCommand}" CommandParameter="{Binding}">
736736
<Button.Template>
737737
<ControlTemplate>
738738
<materialDesign:PackIcon Kind="Close"

0 commit comments

Comments
 (0)