mirror of
https://github.com/muskit/MercuryConverter.git
synced 2026-06-02 20:24:26 -07:00
first commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<Panel xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:MercuryConverter.Views"
|
||||
x:Class="MercuryConverter.Views.Selection"
|
||||
>
|
||||
<DockPanel>
|
||||
<ContentControl Name="SelectionInfo" DockPanel.Dock="Right" Width="250">
|
||||
<Label Content="SelectionInfo"/>
|
||||
</ContentControl>
|
||||
<StackPanel>
|
||||
<Expander HorizontalAlignment="Stretch" BorderThickness="0">
|
||||
<Expander.Header>
|
||||
Search/Filter
|
||||
</Expander.Header>
|
||||
<StackPanel Name="Filter">
|
||||
<TextBox />
|
||||
</StackPanel>
|
||||
</Expander>
|
||||
<DataGrid Name="ListingTable">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="ID"/>
|
||||
<DataGridTextColumn Header="Title"/>
|
||||
<DataGridTextColumn Header="Artist"/>
|
||||
<DataGridTextColumn Header="Source"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
</Panel>
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace MercuryConverter.Views;
|
||||
|
||||
public partial class Selection : Panel
|
||||
{
|
||||
public Selection()
|
||||
{
|
||||
InitializeComponent();
|
||||
Database.Songs.CollectionChanged += OnSongsChg;
|
||||
}
|
||||
|
||||
private void OnSongsChg(object? sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
Console.WriteLine("Songs collection changed!");
|
||||
|
||||
if (e.NewItems != null)
|
||||
{
|
||||
Console.WriteLine("Added...");
|
||||
foreach (Data.Song added in e.NewItems)
|
||||
{
|
||||
Console.WriteLine($"[{added.id}] {added.artist} - {added.name}");
|
||||
}
|
||||
}
|
||||
if (e.OldItems != null)
|
||||
{
|
||||
Console.WriteLine("Removed...");
|
||||
foreach (Data.Song rem in e.OldItems)
|
||||
{
|
||||
Console.WriteLine($"[{rem.id}] {rem.artist} - {rem.name}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user