回答編集履歴

3

var

2023/11/29 13:38

投稿

TN8001
TN8001

スコア10022

test CHANGED
@@ -52,7 +52,7 @@
52
52
  template.VisualTree = factory;
53
53
 
54
54
  var list = new ListBox() { ItemsPanel = template, };
55
- for (int i = 0; i < 3; i++)
55
+ for (var i = 0; i < 3; i++)
56
56
  {
57
57
  list.Items.Add(new ListViewItem() { Content = $"Content{i}", });
58
58
  }

2

DisplayMemberPath

2023/10/30 17:01

投稿

TN8001
TN8001

スコア10022

test CHANGED
@@ -83,14 +83,10 @@
83
83
  </StackPanel>
84
84
 
85
85
  <TabControl
86
+ DisplayMemberPath="Header"
86
87
  FontSize="24"
87
88
  IsSynchronizedWithCurrentItem="True"
88
89
  ItemsSource="{Binding Tabs}">
89
- <TabControl.ItemTemplate>
90
- <DataTemplate>
91
- <TextBlock Text="{Binding Header}" />
92
- </DataTemplate>
93
- </TabControl.ItemTemplate>
94
90
 
95
91
  <TabControl.ContentTemplate>
96
92
  <DataTemplate>

1

add orz

2023/10/30 16:57

投稿

TN8001
TN8001

スコア10022

test CHANGED
@@ -79,7 +79,7 @@
79
79
  <DockPanel>
80
80
  <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
81
81
  <Button Command="{Binding AddTabCommand}" Content="Add Tab" />
82
- <Button Command="{Binding Tabs/AddContentCommand}" Content="Add AddContent" />
82
+ <Button Command="{Binding Tabs/AddContentCommand}" Content="Add Content" />
83
83
  </StackPanel>
84
84
 
85
85
  <TabControl
@@ -164,4 +164,4 @@
164
164
  [NuGet Gallery | CommunityToolkit.Mvvm 8.2.2](https://www.nuget.org/packages/CommunityToolkit.Mvvm/8.2.2)
165
165
  [RelayCommand 属性 - .NET Community Toolkit | Microsoft Learn](https://learn.microsoft.com/ja-jp/dotnet/communitytoolkit/mvvm/generators/relaycommand)
166
166
 
167
- ![アプリ動画](https://ddjkaamml8q8x.cloudfront.net/questions/2023-10-31/45a6cda3-728e-4e6c-8862-435f4996cc1d.gif)
167
+ ![アプリ動画](https://ddjkaamml8q8x.cloudfront.net/questions/2023-10-31/2d1b215b-91a6-4607-8234-410c0881a06b.gif)