Skip to content
This repository was archived by the owner on Jul 23, 2019. It is now read-only.

Commit e35b3dc

Browse files
committed
Convert ListBox collections to convention binding.
1 parent 2366cb6 commit e35b3dc

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

YouTube Downloader/Views/CurrentDownloadsView.xaml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,10 @@
7171
</Button>
7272
</StackPanel>
7373

74-
<ListBox BorderThickness="0"
75-
ItemsSource="{Binding Downloads, Mode=OneTime}"
74+
<ListBox x:Name="Downloads"
75+
BorderThickness="0"
7676
SelectionMode="Extended"
7777
Helpers:SelectedItemsHelper.SelectedItems="{Binding SelectedDownloads, Mode=OneTime}">
78-
<ListBox.ItemTemplate>
79-
<DataTemplate>
80-
<StackPanel>
81-
<ContentControl Caliburn:View.Model="{Binding Mode=OneTime}"/>
82-
</StackPanel>
83-
</DataTemplate>
84-
</ListBox.ItemTemplate>
85-
8678
<ListBox.ItemContainerStyle>
8779
<Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
8880
<Setter Property="SnapsToDevicePixels" Value="True"/>

YouTube Downloader/Views/MatchedVideosView.xaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,9 @@
2323
</TextBlock>
2424
</StatusBar>
2525

26-
<ListBox BorderThickness="0"
27-
ItemsSource="{Binding Videos, Mode=OneTime}"
26+
<ListBox x:Name="Videos"
27+
BorderThickness="0"
2828
SelectionMode="Extended"
29-
Helpers:SelectedItemsHelper.SelectedItems="{Binding SelectedVideos, Mode=OneTime}">
30-
<ListBox.ItemTemplate>
31-
<DataTemplate>
32-
<ContentControl Caliburn:View.Model="{Binding Mode=OneTime}"/>
33-
</DataTemplate>
34-
</ListBox.ItemTemplate>
35-
</ListBox>
29+
Helpers:SelectedItemsHelper.SelectedItems="{Binding SelectedVideos, Mode=OneTime}"/>
3630
</DockPanel>
3731
</UserControl>

0 commit comments

Comments
 (0)