Skip to content

Commit

Permalink
Add PlayLists
Browse files Browse the repository at this point in the history
  • Loading branch information
MaKrotos committed Feb 22, 2024
1 parent c1545c2 commit e36caa2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
4 changes: 1 addition & 3 deletions VK UI3/Controls/PlaylistControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ To="0" Duration="0:0:0.25"/>
<Grid Padding="10">


<SymbolIcon Symbol="List" VerticalAlignment="Bottom" HorizontalAlignment="Left"
Width="24" Height="24"
/>

<Grid Opacity="0" x:Name="btnGrid" Width="50" CornerRadius="100" Height="50" Background="{ThemeResource SystemControlBackgroundAltMediumHighBrush}" VerticalAlignment="Bottom" HorizontalAlignment="Right">
<Button Click="Button_Click" Translation="0,0,24" Opacity="1" Width="50" CornerRadius="50" Height="50" HorizontalAlignment="Center" VerticalAlignment="Center" >
<FontIcon x:Name="PlayPause" Glyph="&#xF5B0;"
Expand Down
36 changes: 26 additions & 10 deletions VK UI3/Controls/TrackControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ public TrackControl()
bool addedHandler = false;
private void TrackControl_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
{
if ((DataContext as ExtendedAudio) != null)
if ((args.NewValue as ExtendedAudio) != null)
{

var track = (DataContext as ExtendedAudio).audio;
var track = (args.NewValue as ExtendedAudio).audio;
if (track == null)
return;
dataTrack = (DataContext as ExtendedAudio);
dataTrack = (args.NewValue as ExtendedAudio);


if (!addedHandler)
Expand All @@ -72,13 +72,29 @@ private void TrackControl_DataContextChanged(FrameworkElement sender, DataContex
audio = track;

if (track.Album != null && track.Album.Thumb != null)
changeImage.ChangeImageWithAnimation(
track.Album.Thumb.Photo270 ??
track.Album.Thumb.Photo300 ??
track.Album.Thumb.Photo600 ??
track.Album.Thumb.Photo34 ??
"null"
);
{

string photoUri = track.Album.Thumb.Photo270 ??
track.Album.Thumb.Photo300 ??
track.Album.Thumb.Photo600 ??
track.Album.Thumb.Photo34 ??
null;
if (photoUri == null)
{
ImageThumb.Opacity = 1;

}
else
{

changeImage.ChangeImageWithAnimation(
photoUri
);
}
}





if ((track.MainArtists == null) || (!track.MainArtists.Any()))
Expand Down

0 comments on commit e36caa2

Please sign in to comment.