feat: add music library page with search, edit and delete
Add a Library page reachable from the navigation. It lists all songs from the SQLite database, filters them by title or artist, edits title, artist, license and attribution in a dialog, and deletes a song after a confirmation prompt. File path, duration and source stay read-only. LibraryController wraps SongRepository so the view only forwards user actions. Changes are written to the database immediately, and the list reloads every time the page is shown. Refs #3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
89b7959404
commit
faa1dc19cc
7 files changed
+357
No files matched your search
@@ -0,0 +1,67 @@
|
||||
<Page x:Class="Radiosender.Views.Pages.LibraryPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
Title="Library"
|
||||
Loaded="OnLoaded">
|
||||
<Grid Margin="24">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ui:TextBlock Grid.Row="0" FontTypography="Title" Text="Library" />
|
||||
|
||||
<DockPanel Grid.Row="1" Margin="0,16,0,12" LastChildFill="True">
|
||||
<ui:Button x:Name="DeleteButton"
|
||||
DockPanel.Dock="Right"
|
||||
Margin="8,0,0,0"
|
||||
Content="Delete"
|
||||
Icon="{ui:SymbolIcon Delete24}"
|
||||
IsEnabled="False"
|
||||
Click="OnDelete" />
|
||||
<ui:Button x:Name="EditButton"
|
||||
DockPanel.Dock="Right"
|
||||
Margin="8,0,0,0"
|
||||
Content="Edit"
|
||||
Icon="{ui:SymbolIcon Edit24}"
|
||||
IsEnabled="False"
|
||||
Click="OnEdit" />
|
||||
<ui:TextBox x:Name="SearchBox"
|
||||
AutomationProperties.Name="Search songs"
|
||||
PlaceholderText="Search title or artist"
|
||||
Icon="{ui:SymbolIcon Search24}"
|
||||
TextChanged="OnSearchChanged" />
|
||||
</DockPanel>
|
||||
|
||||
<ui:ListView x:Name="SongList"
|
||||
Grid.Row="2"
|
||||
SelectionMode="Single"
|
||||
AutomationProperties.Name="Songs"
|
||||
SelectionChanged="OnSelectionChanged"
|
||||
MouseDoubleClick="OnEdit">
|
||||
<ui:ListView.View>
|
||||
<ui:GridView>
|
||||
<ui:GridViewColumn Width="260" Header="Title" DisplayMemberBinding="{Binding Title}" />
|
||||
<ui:GridViewColumn Width="200" Header="Artist" DisplayMemberBinding="{Binding Artist}" />
|
||||
<ui:GridViewColumn Width="80" Header="Duration">
|
||||
<ui:GridViewColumn.DisplayMemberBinding>
|
||||
<Binding Path="Duration" StringFormat="m\:ss" />
|
||||
</ui:GridViewColumn.DisplayMemberBinding>
|
||||
</ui:GridViewColumn>
|
||||
<ui:GridViewColumn Width="140" Header="License" DisplayMemberBinding="{Binding License}" />
|
||||
<ui:GridViewColumn Width="220" Header="Attribution" DisplayMemberBinding="{Binding Attribution}" />
|
||||
</ui:GridView>
|
||||
</ui:ListView.View>
|
||||
</ui:ListView>
|
||||
|
||||
<ui:TextBlock x:Name="EmptyText"
|
||||
Grid.Row="2"
|
||||
Margin="0,48,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
Text="No songs found."
|
||||
Visibility="Collapsed" />
|
||||
</Grid>
|
||||
</Page>
|
||||
Reference in new issue
Block a user