Skip to content

Commit 806b010

Browse files
committed
use listbox instead of itemsrepeater. Fixes #80.
1 parent 5ba0208 commit 806b010

File tree

2 files changed

+29
-22
lines changed

2 files changed

+29
-22
lines changed

AvaGui/Models/ObjectEditorModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ public bool TryLoadObject(FileSystemItem filesystemItem, out UiLocoFile? uiLocoF
208208
Logger.Warning($"Unable to load object {filesystemItem.Name} with unique id {uniqueObjectId} from online - received no DAT object data");
209209
}
210210

211-
Logger.Info($"Added object {filesystemItem.Name} with unique id {uniqueObjectId} to local cache");
211+
Logger.Info($"Downloaded object {filesystemItem.Name} with unique id {uniqueObjectId} and added it to the local cache");
212+
Logger.Debug($"{filesystemItem.Name} has authors=[{string.Join(", ", locoObj.Authors.Select(x => x.Name))}], tags=[{string.Join(", ", locoObj.Tags.Select(x => x.Name))}], modpacks=[{string.Join(", ", locoObj.Modpacks.Select(x => x.Name))}], licence={locoObj.Licence}");
212213
OnlineCache.Add(uniqueObjectId, locoObj);
213214
}
214215
else

AvaGui/Views/MainWindow.axaml

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -251,52 +251,58 @@
251251
<Border BorderThickness="1" Margin="4" >
252252
<StackPanel>
253253
<TextBlock Margin="4">Authors</TextBlock>
254-
<ItemsRepeater ItemsSource="{Binding CurrentObject.Metadata.Authors}" Background="{DynamicResource ExpanderContentBackground}" >
255-
<ItemsRepeater.Layout>
256-
<WrapLayout />
257-
</ItemsRepeater.Layout>
258-
<ItemsRepeater.ItemTemplate>
254+
<ListBox ItemsSource="{Binding CurrentObject.Metadata.Authors}">
255+
<ListBox.ItemsPanel>
256+
<ItemsPanelTemplate>
257+
<WrapPanel/>
258+
</ItemsPanelTemplate>
259+
</ListBox.ItemsPanel>
260+
<ListBox.ItemTemplate>
259261
<DataTemplate>
260262
<Border BorderThickness="2">
261263
<TextBlock Margin="4" Text="{Binding Name}" />
262264
</Border>
263265
</DataTemplate>
264-
</ItemsRepeater.ItemTemplate>
265-
</ItemsRepeater>
266+
</ListBox.ItemTemplate>
267+
</ListBox >
266268
</StackPanel>
267269
</Border>
268270
<Border BorderThickness="1" Margin="4" >
269271
<StackPanel>
270272
<TextBlock Margin="4">Tags</TextBlock>
271-
<ItemsRepeater ItemsSource="{Binding CurrentObject.Metadata.Tags}" Background="{DynamicResource ExpanderContentBackground}" >
272-
<ItemsRepeater.Layout>
273-
<WrapLayout />
274-
</ItemsRepeater.Layout>
275-
<ItemsRepeater.ItemTemplate>
273+
<ListBox ItemsSource="{Binding CurrentObject.Metadata.Tags}">
274+
<ListBox.ItemsPanel>
275+
<ItemsPanelTemplate>
276+
<WrapPanel/>
277+
</ItemsPanelTemplate>
278+
</ListBox.ItemsPanel>
279+
<ListBox.ItemTemplate>
276280
<DataTemplate>
277281
<Border BorderThickness="2">
278282
<TextBlock Margin="4" Text="{Binding Name}" />
279283
</Border>
280284
</DataTemplate>
281-
</ItemsRepeater.ItemTemplate>
282-
</ItemsRepeater>
285+
</ListBox.ItemTemplate>
286+
</ListBox >
283287
</StackPanel>
284288
</Border>
285289
<Border BorderThickness="1" Margin="4" >
286290
<StackPanel>
287291
<TextBlock Margin="4">Modpacks</TextBlock>
288-
<ItemsRepeater ItemsSource="{Binding CurrentObject.Metadata.Modpacks}" Background="{DynamicResource ExpanderContentBackground}" >
289-
<ItemsRepeater.Layout>
290-
<WrapLayout />
291-
</ItemsRepeater.Layout>
292-
<ItemsRepeater.ItemTemplate>
292+
<ListBox ItemsSource="{Binding CurrentObject.Metadata.Modpacks}">
293+
<ListBox.ItemsPanel>
294+
<ItemsPanelTemplate>
295+
<WrapPanel/>
296+
</ItemsPanelTemplate>
297+
</ListBox.ItemsPanel>
298+
<ListBox.ItemTemplate>
293299
<DataTemplate>
294300
<Border BorderThickness="2">
295301
<TextBlock Margin="4" Text="{Binding Name}" />
296302
</Border>
297303
</DataTemplate>
298-
</ItemsRepeater.ItemTemplate>
299-
</ItemsRepeater>
304+
</ListBox.ItemTemplate>
305+
</ListBox >
300306
</StackPanel>
301307
</Border>
302308
</StackPanel>

0 commit comments

Comments
 (0)