diff --git a/MusicX.Core/Helpers/IIdentifiable.cs b/MusicX.Core/Helpers/IIdentifiable.cs index f6b5d0e2..c2ddd8f7 100644 --- a/MusicX.Core/Helpers/IIdentifiable.cs +++ b/MusicX.Core/Helpers/IIdentifiable.cs @@ -1,5 +1,6 @@ using MusicX.Core.Models; using MusicX.Core.Models.General; +using System.Linq; namespace MusicX.Core.Helpers; @@ -109,6 +110,7 @@ private static void RemoveAds(Section section) block is { Banners.Count: > 0 } && block.Banners.RemoveAll(banner => banner.ClickAction?.Action.Url.Contains("subscription") is true || banner.ClickAction?.Action.Url.Contains("combo") is true || + banner.ClickAction?.Action.Url.Contains("narrative") is true || banner.ClickAction?.Action.Url .Contains("https://vk.com/app") is true || banner.ClickAction?.Action.Url.Contains("https://vk.com/vk_music") is diff --git a/MusicX/Controls/BlockControl.xaml b/MusicX/Controls/BlockControl.xaml index bc41dcb9..8d29459d 100644 --- a/MusicX/Controls/BlockControl.xaml +++ b/MusicX/Controls/BlockControl.xaml @@ -103,6 +103,10 @@ + + + + diff --git a/MusicX/Controls/Blocks/AudioMixesBlock.xaml b/MusicX/Controls/Blocks/AudioMixesBlock.xaml index 787aafee..b575afc4 100644 --- a/MusicX/Controls/Blocks/AudioMixesBlock.xaml +++ b/MusicX/Controls/Blocks/AudioMixesBlock.xaml @@ -101,14 +101,69 @@ + FontFamily="{StaticResource VKSansDemiBold}" > + + + + + FontFamily="{StaticResource VKSansRegular}"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicX/Controls/Blocks/AudioMixesBlock.xaml.cs b/MusicX/Controls/Blocks/AudioMixesBlock.xaml.cs index 879468ba..b9b3bff2 100644 --- a/MusicX/Controls/Blocks/AudioMixesBlock.xaml.cs +++ b/MusicX/Controls/Blocks/AudioMixesBlock.xaml.cs @@ -1,5 +1,6 @@ using Microsoft.Extensions.DependencyInjection; using MusicX.Core.Services; +using MusicX.Models.Enums; using MusicX.Services; using MusicX.Services.Player; using MusicX.Services.Player.Playlists; @@ -12,6 +13,15 @@ namespace MusicX.Controls.Blocks; public sealed partial class AudioMixesBlock : UserControl { + public MixMode Mode + { + get => (MixMode)GetValue(ModeProperty); + set => SetValue(ModeProperty, value); + } + + public static readonly DependencyProperty ModeProperty = + DependencyProperty.Register("Mode", typeof(MixMode), typeof(AudioMixesBlock)); + public bool IsPlaying { get => (bool)GetValue(IsPlayingProperty); @@ -26,6 +36,8 @@ public AudioMixesBlock() { InitializeComponent(); + Mode = MixMode.Mix; + _player = StaticService.Container.GetRequiredService(); _player.CurrentPlaylistChanged += Player_CurrentPlaylistChanged; @@ -56,4 +68,22 @@ private async void Button_Click(object sender, RoutedEventArgs e) await _player.PlayAsync(new MixPlaylist(data, StaticService.Container.GetRequiredService())); } + + private void LibraryButton_Click(object sender, RoutedEventArgs e) + { + Mode = MixMode.Library; + + MixButton.Appearance = Wpf.Ui.Controls.ControlAppearance.Transparent; + + LibraryButton.Appearance = Wpf.Ui.Controls.ControlAppearance.Secondary; + } + + private void MixButton_Click(object sender, RoutedEventArgs e) + { + Mode = MixMode.Mix; + + MixButton.Appearance = Wpf.Ui.Controls.ControlAppearance.Secondary; + + LibraryButton.Appearance = Wpf.Ui.Controls.ControlAppearance.Transparent; + } } diff --git a/MusicX/Controls/Blocks/MusicCategoryBlockControl.xaml b/MusicX/Controls/Blocks/MusicCategoryBlockControl.xaml index 91e629f6..2644fe1e 100644 --- a/MusicX/Controls/Blocks/MusicCategoryBlockControl.xaml +++ b/MusicX/Controls/Blocks/MusicCategoryBlockControl.xaml @@ -30,7 +30,8 @@ - + + - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MusicX/Controls/Blocks/MusicCategoryBlockControl.xaml.cs b/MusicX/Controls/Blocks/MusicCategoryBlockControl.xaml.cs index 0258c140..1d03f054 100644 --- a/MusicX/Controls/Blocks/MusicCategoryBlockControl.xaml.cs +++ b/MusicX/Controls/Blocks/MusicCategoryBlockControl.xaml.cs @@ -98,5 +98,6 @@ private async void CardAction_Click(object sender, RoutedEventArgs e) public enum MusicCategoryLayout { List, - Grid + Grid, + DoubleGrid } \ No newline at end of file diff --git a/MusicX/Models/Enums/MixMode.cs b/MusicX/Models/Enums/MixMode.cs new file mode 100644 index 00000000..d775b489 --- /dev/null +++ b/MusicX/Models/Enums/MixMode.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MusicX.Models.Enums +{ + public enum MixMode + { + Unknown = 0, + + Mix = 1, + + Library = 2, + } +}