parent
7d614311cd
commit
9bac4e84fc
After Width: | Height: | Size: 812 B |
After Width: | Height: | Size: 463 B |
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
x:Class="ShoopNCook.Views.HeadedButton"
|
||||||
|
x:Name="HeadedBtn">
|
||||||
|
<HorizontalStackLayout>
|
||||||
|
<Border
|
||||||
|
x:Name="PrefixBorder"
|
||||||
|
BackgroundColor="{Binding HeadColor, Source={x:Reference HeadedBtn}}"
|
||||||
|
Stroke="Transparent"
|
||||||
|
StrokeShape="RoundRectangle 250"
|
||||||
|
Padding="10">
|
||||||
|
<ImageButton
|
||||||
|
x:Name="PrefixImage"
|
||||||
|
WidthRequest="25"
|
||||||
|
HeightRequest="25"
|
||||||
|
Source="{Binding HeadSource, Source={x:Reference HeadedBtn}}"/>
|
||||||
|
</Border>
|
||||||
|
<Label
|
||||||
|
x:Name="BtnLabel"
|
||||||
|
Margin="20, 0, 0, 0"
|
||||||
|
Text="{Binding Text, Source={x:Reference HeadedBtn}}"
|
||||||
|
VerticalTextAlignment="Center"
|
||||||
|
FontFamily="Poppins"
|
||||||
|
FontSize="16"
|
||||||
|
TextColor="{StaticResource TextColorPrimary}"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</ContentView>
|
@ -0,0 +1,39 @@
|
|||||||
|
using System.Xml.Linq;
|
||||||
|
|
||||||
|
namespace ShoopNCook.Views;
|
||||||
|
|
||||||
|
public partial class HeadedButton : ContentView
|
||||||
|
{
|
||||||
|
|
||||||
|
private readonly BindableProperty TextProperty =
|
||||||
|
BindableProperty.Create("Text", typeof(string), typeof(HeadedButton), "No Text Defined.");
|
||||||
|
|
||||||
|
private readonly BindableProperty HeadColorProperty =
|
||||||
|
BindableProperty.Create("HeadColor", typeof(string), typeof(HeadedButton), "#FFFFFF");
|
||||||
|
|
||||||
|
private readonly BindableProperty HeadSourceProperty =
|
||||||
|
BindableProperty.Create("HeadSource", typeof(string), typeof(HeadedButton), default(string));
|
||||||
|
|
||||||
|
public string Text
|
||||||
|
{
|
||||||
|
get => (string)GetValue(TextProperty);
|
||||||
|
set => SetValue(TextProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string HeadColor
|
||||||
|
{
|
||||||
|
get => (string)GetValue(HeadColorProperty);
|
||||||
|
set => SetValue(HeadColorProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string HeadSource
|
||||||
|
{
|
||||||
|
get => (string)GetValue(HeadSourceProperty);
|
||||||
|
set => SetValue(HeadSourceProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public HeadedButton()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue