Working player contained within main page and control delegated to viewmodels

This commit is contained in:
watsonb8
2019-11-08 19:54:51 -05:00
parent 794b4739b1
commit 63efcdad69
7 changed files with 134 additions and 75 deletions

View File

@ -14,11 +14,9 @@
<StackLayout
Grid.Column="0">
<Label
x:Name="SongTitleLabel"
Text="{Binding SongTitle}"/>
x:Name="SongTitleLabel"/>
<Label
x:Name="ArtistNameLabel"
Text="{Binding ArtistName}"/>
x:Name="ArtistNameLabel"/>
</StackLayout>
<StackLayout
Grid.Column="1"
@ -26,19 +24,16 @@
<Button
Text="Previous"
x:Name="PreviousButton"
Command="{Binding PreviousCommand}"
WidthRequest="100"
HeightRequest="50"/>
<Button
x:Name="PlayButton"
Text="{Binding PlayButtonText}"
Command="{Binding PlayCommand}"
Text="Play/Pause"
WidthRequest="100"
HeightRequest="50"/>
<Button
Text="Next"
x:Name="NextButton"
Command="{Binding NextCommand}"
WidthRequest="100"
HeightRequest="50"/>
</StackLayout>

View File

@ -7,9 +7,6 @@ namespace Aurora.Design.Components.MediaPlayer
{
public Player()
{
// this.PreviousButton.Clicked += OnPreviousButtonClicked;
// this.PlayButton.Clicked += OnPlayButtonClicked;
// this.NextButton.Clicked += OnNextButtonClicked;
InitializeComponent();
}
@ -33,7 +30,7 @@ namespace Aurora.Design.Components.MediaPlayer
}
}
private static void OnSongTitlePropertyChanged(BindableObject bindable, object newValue, object oldValue)
private static void OnSongTitlePropertyChanged(BindableObject bindable, object oldValue, object newValue)
{
Player component = bindable as Player;
component.SongTitleLabel.Text = (string)newValue;
@ -60,7 +57,7 @@ namespace Aurora.Design.Components.MediaPlayer
}
}
private static void OnArtistNamePropertyChanged(BindableObject bindable, object newValue, object oldValue)
private static void OnArtistNamePropertyChanged(BindableObject bindable, object oldValue, object newValue)
{
Player component = bindable as Player;
component.ArtistNameLabel.Text = (string)newValue;