it's something

This commit is contained in:
Royce551 2021-07-19 23:09:42 -06:00
parent b43e54e5ac
commit 07f309d115
5 changed files with 155 additions and 22 deletions

View file

@ -774,7 +774,7 @@ namespace FRESHMusicPlayer.ViewModels
public void OpenTagEditorCommand()
{
new FRESHMusicPlayer.Views.TagEditor.TagEditor().Show();
new FRESHMusicPlayer.Views.TagEditor.TagEditor().SetStuff(Player, Library).Show();
}
#endregion
}

View file

@ -12,7 +12,8 @@ namespace FRESHMusicPlayer.ViewModels.TagEditor
{
public class TagEditorViewModel : ViewModelBase
{
public Player Player { get; set; } = new();
public Window Window { get; set; }
public Player Player { get; set; }
public Library Library { get; set; }
private string artist;
@ -73,13 +74,23 @@ namespace FRESHMusicPlayer.ViewModels.TagEditor
public List<string> FilePaths { get; private set; } = new();
private const string windowName = "FRESHMusicPlayer Tag Editor";
private string windowTitle = "FRESHMusicPlayer Tag Editor";
public string WindowTitle
{
get => windowTitle;
set
get
{
this.RaiseAndSetIfChanged(ref windowTitle, value);
string initialString;
if (FilePaths.Count > 0)
{
initialString = $"{string.Join(", ", FilePaths} | {windowName}";
}
else
{
initialString = windowName;
}
if (UnsavedChanges) initialString = $"*{initialString}";
return initialString;
}
}
@ -186,20 +197,4 @@ namespace FRESHMusicPlayer.ViewModels.TagEditor
}
}
public class Duck
{
public int Test { get; set; }
public Duck()
{
}
public Duck(int test)
{
Test = test;
}
}
}

View file

@ -6,7 +6,7 @@
xmlns:vm="using:FRESHMusicPlayer.ViewModels.TagEditor"
mc:Ignorable="d" Height="451" Width="600"
x:Class="FRESHMusicPlayer.Views.TagEditor.TagEditor"
Title="TagEditor">
Title="{Binding WindowTitle}">
<Window.DataContext>
<vm:TagEditorViewModel/>

View file

@ -1,6 +1,8 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using FRESHMusicPlayer.ViewModels.TagEditor;
using FRESHMusicPlayer.Handlers;
namespace FRESHMusicPlayer.Views.TagEditor
{
@ -14,6 +16,15 @@ namespace FRESHMusicPlayer.Views.TagEditor
#endif
}
public TagEditor SetStuff(Player player = null, Library library = null)
{
var dataContext = DataContext as TagEditorViewModel;
dataContext.Player = player;
dataContext.Library = library;
dataContext.Window = this;
return this;
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);

View file

@ -0,0 +1,127 @@
[10:16:34 PM] Hi! I'm FMP!
FRESHMusicPlayer for Mac and Linux Beta 12
.NET 5.0.8
Unix 10.15.1
[10:16:34 PM] Handling config...
[10:16:34 PM] Handling command line args...
[10:16:34 PM] Showing library!
[10:16:36 PM] Showing library!
[10:16:47 PM] Showing library!
[10:16:48 PM] Showing library!
[10:16:57 PM] Showing library!
[10:16:58 PM] Showing library!
[10:16:58 PM] Showing library!
[10:16:59 PM] Showing library!
[10:16:59 PM] Showing library!
[10:17:00 PM] Showing library!
[10:17:18 PM] FMP is shutting down!
[10:17:18 PM] Goodbye!
[10:19:06 PM] Hi! I'm FMP!
FRESHMusicPlayer for Mac and Linux Beta 12
.NET 5.0.8
Unix 10.15.1
[10:19:06 PM] Handling config...
[10:19:06 PM] Handling command line args...
[10:19:06 PM] Showing library!
[10:19:07 PM] Showing library!
[10:22:27 PM] FMP is shutting down!
[10:22:27 PM] Goodbye!
[10:24:39 PM] Hi! I'm FMP!
FRESHMusicPlayer for Mac and Linux Beta 12
.NET 5.0.8
Unix 10.15.1
[10:24:39 PM] Handling config...
[10:24:39 PM] Handling command line args...
[10:24:39 PM] Showing library!
[10:24:40 PM] Showing library!
[10:25:26 PM] FMP is shutting down!
[10:25:26 PM] Goodbye!
[10:25:34 PM] Hi! I'm FMP!
FRESHMusicPlayer for Mac and Linux Beta 12
.NET 5.0.8
Unix 10.15.1
[10:25:34 PM] Handling config...
[10:25:34 PM] Handling command line args...
[10:25:34 PM] Showing library!
[10:25:35 PM] Showing library!
[10:25:41 PM] FMP is shutting down!
[10:25:41 PM] Goodbye!
[10:31:04 PM] Hi! I'm FMP!
FRESHMusicPlayer for Mac and Linux Beta 12
.NET 5.0.8
Unix 10.15.1
[10:31:04 PM] Handling config...
[10:31:04 PM] Handling command line args...
[10:31:04 PM] Showing library!
[10:31:05 PM] Showing library!
[10:33:17 PM] Hi! I'm FMP!
FRESHMusicPlayer for Mac and Linux Beta 12
.NET 5.0.8
Unix 10.15.1
[10:33:17 PM] Handling config...
[10:33:17 PM] Handling command line args...
[10:33:17 PM] Showing library!
[10:33:18 PM] Showing library!
[10:35:06 PM] Hi! I'm FMP!
FRESHMusicPlayer for Mac and Linux Beta 12
.NET 5.0.8
Unix 10.15.1
[10:35:06 PM] Handling config...
[10:35:06 PM] Handling command line args...
[10:35:06 PM] Showing library!
[10:35:07 PM] Showing library!
[10:36:53 PM] Showing library!
[10:36:53 PM] Showing library!
[10:36:53 PM] Showing library!
[10:36:54 PM] Showing library!
[10:36:54 PM] Showing library!
[10:36:54 PM] Showing library!
[10:36:54 PM] Showing library!
[10:36:54 PM] Showing library!
[10:36:54 PM] Showing library!
[10:36:54 PM] Showing library!
[10:36:54 PM] Showing library!
[10:36:55 PM] Showing library!
[10:36:55 PM] Showing library!
[10:36:55 PM] Showing library!
[10:36:55 PM] Showing library!
[10:36:55 PM] Showing library!
[10:36:55 PM] Showing library!
[10:36:55 PM] Showing library!
[10:36:55 PM] Showing library!
[10:36:55 PM] Showing library!
[10:36:55 PM] Showing library!
[10:36:55 PM] Showing library!
[10:36:56 PM] Showing library!
[10:36:56 PM] Showing library!
[10:36:56 PM] Showing library!
[10:36:56 PM] Showing library!
[10:36:56 PM] Showing library!
[10:36:57 PM] Showing library!
[10:36:57 PM] Showing library!
[10:36:57 PM] Showing library!
[10:36:57 PM] Showing library!
[10:36:58 PM] Showing library!
[10:36:59 PM] Showing library!
[10:36:59 PM] Showing library!
[10:37:00 PM] Showing library!
[10:41:49 PM] Showing library!
[10:42:19 PM] Showing library!
[10:42:27 PM] Player: SongChanged
[10:43:13 PM] Showing library!
[10:43:13 PM] Showing library!
[10:43:14 PM] Showing library!
[10:43:14 PM] Showing library!
[10:43:14 PM] Showing library!
[10:43:14 PM] Showing library!
[10:43:14 PM] Showing library!
[10:43:14 PM] Showing library!
[10:43:15 PM] Showing library!
[10:46:01 PM] Player: Stopping!