Icons finally working with pngs (SVGs later maybe)

This commit is contained in:
watsonb8
2019-12-03 15:51:16 -08:00
parent c24ff95bfc
commit 22a524cfd1
9 changed files with 158 additions and 25 deletions

View File

@ -8,3 +8,11 @@
#MediaInfoLayout label {
margin-left: 20;
}
ImageButton {
margin-top: 10;
margin-left: 20;
margin-right: 20;
margin-bottom: 10;
width: 40;
}

View File

@ -2,7 +2,7 @@
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Aurora.Design.Extensions"
xmlns:imgBtn="clr-namespace:Aurora.Design.Components.ImageButton"
x:Class="Aurora.Design.Components.MediaPlayer.Player">
<ContentView.Resources>
<StyleSheet
@ -34,22 +34,15 @@
Grid.Column="1"
HorizontalOptions="Center"
Orientation="Horizontal">
<Image Source="{local:ImageResource Aurora.gtk.Resources.forward.png}" />
<ImageButton
<imgBtn:ImageButton
x:Name="PreviousButton"
Source="{local:ImageResource Aurora.gtk.Resources.backward.png}"
WidthRequest="100"
HeightRequest="50"></ImageButton>
<ImageButton
Source="Resources/backward.png"/>
<imgBtn:ImageButton
x:Name="PlayButton"
Source="{local:ImageResource Aurora.gtk.Resources.play.png}"
WidthRequest="100"
HeightRequest="50"/>
<ImageButton
Source="Resources/play.png"/>
<imgBtn:ImageButton
x:Name="NextButton"
Source="{local:ImageResource Aurora.gtk.Resources.forward.png}"
WidthRequest="100"
HeightRequest="50"/>
Source="Resources/forwards.png"/>
</StackLayout>
</Grid>
</ContentView.Content>

View File

@ -107,14 +107,14 @@ namespace Aurora.Design.Components.MediaPlayer
if (newValue is Command)
{
Command cmd = newValue as Command;
component.PreviousButton.Clicked += component.OnPreviousButtonClicked;
component.PreviousButton.Tapped += component.OnPreviousButtonClicked;
cmd.CanExecuteChanged += (sender, e) => OnPreviousButtonCanExecuteChanged(sender, e, component, cmd);
}
if (oldValue is Command && oldValue != null)
{
Command cmd = newValue as Command;
component.PreviousButton.Clicked -= component.OnPreviousButtonClicked;
component.PreviousButton.Tapped -= component.OnPreviousButtonClicked;
cmd.CanExecuteChanged -= (sender, e) => OnPreviousButtonCanExecuteChanged(sender, e, component, cmd);
}
}
@ -177,14 +177,14 @@ namespace Aurora.Design.Components.MediaPlayer
if (newValue is Command)
{
Command cmd = newValue as Command;
component.PlayButton.Clicked += component.OnPlayButtonClicked;
component.PlayButton.Tapped += component.OnPlayButtonClicked;
cmd.CanExecuteChanged += (sender, e) => OnPlayButtonCanExecuteChanged(sender, e, component, cmd);
}
if (oldValue is Command && oldValue != null)
{
Command cmd = newValue as Command;
component.PlayButton.Clicked -= component.OnPlayButtonClicked;
component.PlayButton.Tapped -= component.OnPlayButtonClicked;
cmd.CanExecuteChanged -= (sender, e) => OnPlayButtonCanExecuteChanged(sender, e, component, cmd);
}
}
@ -247,14 +247,14 @@ namespace Aurora.Design.Components.MediaPlayer
if (newValue is Command)
{
Command cmd = newValue as Command;
component.NextButton.Clicked += component.OnNextButtonClicked;
component.NextButton.Tapped += component.OnNextButtonClicked;
cmd.CanExecuteChanged += (sender, e) => OnNextButtonCanExecuteChanged(sender, e, component, cmd);
}
if (oldValue is Command && oldValue != null)
{
Command cmd = oldValue as Command;
component.NextButton.Clicked -= component.OnNextButtonClicked;
component.NextButton.Tapped -= component.OnNextButtonClicked;
cmd.CanExecuteChanged -= (sender, e) => OnNextButtonCanExecuteChanged(sender, e, component, cmd);
}
}