Using System.Diagnostics.Debug. First pass at player controls styling
This commit is contained in:
@ -9,6 +9,7 @@ namespace Aurora.Design.Components.MediaPlayer
|
||||
{
|
||||
|
||||
InitializeComponent();
|
||||
PlayButton.Source = ImageSource.FromFile("Resources/play.png");
|
||||
}
|
||||
|
||||
#region SongTitle Bindable
|
||||
@ -16,7 +17,11 @@ namespace Aurora.Design.Components.MediaPlayer
|
||||
BindableProperty.Create(propertyName: "SongTitle",
|
||||
returnType: typeof(string),
|
||||
declaringType: typeof(Player),
|
||||
propertyChanged: OnSongTitlePropertyChanged);
|
||||
propertyChanged: (BindableObject bindable, object oldValue, object newValue) =>
|
||||
{
|
||||
Player component = bindable as Player;
|
||||
component.SongTitleLabel.Text = (string)newValue;
|
||||
});
|
||||
|
||||
public string SongTitle
|
||||
{
|
||||
@ -30,12 +35,6 @@ namespace Aurora.Design.Components.MediaPlayer
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnSongTitlePropertyChanged(BindableObject bindable, object oldValue, object newValue)
|
||||
{
|
||||
Player component = bindable as Player;
|
||||
component.SongTitleLabel.Text = (string)newValue;
|
||||
}
|
||||
|
||||
#endregion SongTitle Bindable
|
||||
|
||||
#region ArtistName Bindable
|
||||
@ -43,7 +42,11 @@ namespace Aurora.Design.Components.MediaPlayer
|
||||
BindableProperty.Create(propertyName: "ArtistName",
|
||||
returnType: typeof(string),
|
||||
declaringType: typeof(Player),
|
||||
propertyChanged: OnArtistNamePropertyChanged);
|
||||
propertyChanged: (BindableObject bindable, object oldValue, object newValue) =>
|
||||
{
|
||||
Player component = bindable as Player;
|
||||
component.ArtistNameLabel.Text = (string)newValue;
|
||||
});
|
||||
|
||||
public string ArtistName
|
||||
{
|
||||
@ -57,12 +60,6 @@ namespace Aurora.Design.Components.MediaPlayer
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnArtistNamePropertyChanged(BindableObject bindable, object oldValue, object newValue)
|
||||
{
|
||||
Player component = bindable as Player;
|
||||
component.ArtistNameLabel.Text = (string)newValue;
|
||||
}
|
||||
|
||||
#endregion ArtistName Bindable
|
||||
|
||||
#region PreviousButton
|
||||
@ -275,5 +272,32 @@ namespace Aurora.Design.Components.MediaPlayer
|
||||
component.NextButton.IsEnabled = cmd.CanExecute(null);
|
||||
}
|
||||
#endregion PlayButton
|
||||
|
||||
#region Playing Bindable
|
||||
public static readonly BindableProperty IsPlayingProperty =
|
||||
BindableProperty.Create(
|
||||
propertyName: "IsPlaying",
|
||||
returnType: typeof(bool),
|
||||
declaringType: typeof(Player),
|
||||
propertyChanged: (BindableObject bindable, object oldValue, object newValue) =>
|
||||
{
|
||||
Player control = (Player)bindable;
|
||||
if ((bool)newValue == true)
|
||||
{
|
||||
control.PlayButton.Source = ImageSource.FromFile("Resources/pause.png");
|
||||
}
|
||||
else
|
||||
{
|
||||
control.PlayButton.Source = ImageSource.FromFile("Resources/play.png");
|
||||
}
|
||||
});
|
||||
|
||||
public bool IsPlaying
|
||||
{
|
||||
get { return (bool)GetValue(IsPlayingProperty); }
|
||||
set { SetValue(IsPlayingProperty, value); }
|
||||
}
|
||||
|
||||
#endregion Playing Binadable
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user