Hallo Wie kann ich erweitern in die Schaltfläche für eine benutzerdefinierte Lösung anzeigen?So erweitern Sie die Schaltfläche für eine benutzerdefinierte Lösung Xamarin
Ich werde nicht diese erweitern:
....
<Button BackgroundColor="#388fee" BorderColor="#388fee" BorderRadius="25" WidthRequest="50" HeightRequest="50"
Command="{Binding CheckinShareCommand}" Margin="0,16">
<Button.Image>
<FileImageSource File="googlemap_view_share_button.png" />
</Button.Image>
</Button>
....
Dies ist meine individuelle Lösung.
Wenn Sie ein Bild und drücken es verklärt ihn
public class CustomImage: Bild { public static Nur-Lese-BindableProperty Command = BindableProperty.Create (p => p.Command, null); öffentlicher ICommand-Befehl { get {return (ICommand) GetValue (CommandProperty); } set {SetValue (CommandProperty, Wert); }}
public static readonly BindableProperty CommandParameterProperty = BindableProperty.Create<CustomImage, object>(p => p.CommandParameter, null);
public object CommandParameter
{
get { return (object)GetValue(CommandParameterProperty); }
set { SetValue(CommandParameterProperty, value); }
}
private ICommand TransitionCommand
{
get
{
return new Command(async() =>
{
this.AnchorX = 0.48;
this.AnchorY = 0.48;
await this.ScaleTo(2.8, 50, Easing.Linear);
await Task.Delay(100);
await this.ScaleTo(1, 50, Easing.Linear);
if (Command != null)
{
Command.Execute(CommandParameter);
}
});
}
}
public CustomImage()
{
Initialize();
}
public void Initialize()
{
GestureRecognizers.Add(new TapGestureRecognizer()
{
Command = TransitionCommand
});
....
Sind Sie wollen Vergrößerungen auf Ihre Schaltfläche drücken? –
ja, wenn ich den Knopf drücke ich möchte Vergrößerungen Effekt –
Schau dir meine Antwort hoffe es hilft dir !!! –