diff --git a/Sources/Linaris/PlaylistsPage.xaml b/Sources/Linaris/PlaylistsPage.xaml
index 059257d..b35cd71 100644
--- a/Sources/Linaris/PlaylistsPage.xaml
+++ b/Sources/Linaris/PlaylistsPage.xaml
@@ -27,14 +27,12 @@
-
-
+
-
+
-
@@ -45,7 +43,7 @@
-
+
diff --git a/Sources/Linaris/PlaylistsPage.xaml.cs b/Sources/Linaris/PlaylistsPage.xaml.cs
index f5e43e3..5360320 100644
--- a/Sources/Linaris/PlaylistsPage.xaml.cs
+++ b/Sources/Linaris/PlaylistsPage.xaml.cs
@@ -37,7 +37,6 @@ public partial class PlaylistsPage : ContentPage
void ResetAll(object sender, EventArgs e)
{
ResetSubMenus(sender, e);
- ResetRenaming(sender, e);
IsNewPlaylist = false;
}
@@ -49,22 +48,6 @@ public partial class PlaylistsPage : ContentPage
}
}
- void ResetRenaming(object sender, EventArgs e)
- {
- foreach (var Playlist in playlists)
- {
- Playlist.IsRenaming = false;
- if (!CheckRenaming(Playlist))
- {
- Playlist.NewName = Playlist.Name;
- }
- else
- {
- Playlist.Name = Playlist.NewName;
- }
- }
- }
-
// Add methods
@@ -78,6 +61,7 @@ public partial class PlaylistsPage : ContentPage
App.Manager.AddPlaylist(playlist);
playlists.Add(playlist);
IsNewPlaylist = false;
+ entry.Text = "";
}
}
}
@@ -127,41 +111,6 @@ public partial class PlaylistsPage : ContentPage
// Change methods
- void RenamePlaylist(object sender, EventArgs e)
- {
- ResetSubMenus(sender, e);
- if (sender is Button button)
- {
- if (button.BindingContext is Playlist playlist)
- {
- if (!playlist.IsRenaming)
- {
- ResetRenaming(sender, e);
- playlist.IsRenaming = true;
- }
- else
- {
- ResetRenaming(sender, e);
- }
- }
- }
- else if (sender is Entry entry)
- {
- if (entry.BindingContext is Playlist playlist)
- {
- if (!CheckRenaming(playlist))
- {
- entry.TextColor = Color.FromRgb(255,0,0);
- }
- else
- {
- ResetRenaming(sender, e);
- playlist.Name = playlist.NewName;
- }
- }
- }
- }
-
private async void ChangeImage(object sender, EventArgs e)
{
var result = await FilePicker.PickAsync(new PickOptions
@@ -197,36 +146,6 @@ public partial class PlaylistsPage : ContentPage
}
return false;
}
-
- // Check methods
-
- void CheckNewName(object sender, EventArgs e)
- {
- if (sender is Entry entry)
- {
- if (entry.BindingContext is Playlist playlist)
- {
- if (!CheckRenaming(playlist))
- {
- entry.TextColor = Color.FromRgb(255, 0, 0);
- }
- else
- {
- entry.TextColor = Color.FromRgb(255, 255, 255);
- }
- }
- }
- }
-
- bool CheckRenaming(Playlist playlist)
- {
- if (playlist.NewName.Length > Manager.MAX_NAME_LENGTH || string.IsNullOrWhiteSpace(playlist.NewName) || HasSameName(playlist.NewName))
- {
- return false;
- }
- return true;
- }
-
// Navigation
async void GoToPlaylist(object sender, EventArgs e)
diff --git a/Sources/Model/Playlist.cs b/Sources/Model/Playlist.cs
index f4441c3..1b3befc 100644
--- a/Sources/Model/Playlist.cs
+++ b/Sources/Model/Playlist.cs
@@ -148,21 +148,6 @@ public class Playlist : INotifyPropertyChanged
private bool isSubMenuVisible;
- public bool IsRenaming
- {
- get => isRenaming;
- set
- {
- if (isRenaming != value)
- {
- isRenaming = value;
- }
- OnPropertyChanged();
- }
- }
-
- private bool isRenaming = false;
-
public Playlist(string nom, string description, string imageURL)
{
Name = nom;