-
Notifications
You must be signed in to change notification settings - Fork 32
/
FreakySignaturePadView.xaml
78 lines (77 loc) · 3.74 KB
/
FreakySignaturePadView.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="utf-8" ?>
<ContentView
x:Class="Maui.FreakyControls.FreakySignaturePadView"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:converters="clr-namespace:Maui.FreakyControls.Shared.Converters"
xmlns:freakyControls="clr-namespace:Maui.FreakyControls"
x:Name="this">
<ContentView.Resources>
<converters:InverseBoolConverter x:Key="InverseBoolConverter" />
</ContentView.Resources>
<AbsoluteLayout>
<Image
AbsoluteLayout.LayoutBounds="0,0,1,1"
AbsoluteLayout.LayoutFlags="All"
x:Name="BackgroundImageView"
Grid.ColumnSpan="2"
Aspect="{Binding BackgroundImageAspect, Source={x:Reference this}}"
InputTransparent="True"
Opacity="{Binding BackgroundImageOpacity, Source={x:Reference this}}"
Source="{Binding BackgroundImage, Source={x:Reference this}}" />
<freakyControls:FreakySignatureCanvasView
AbsoluteLayout.LayoutBounds="0,0,1,1"
AbsoluteLayout.LayoutFlags="All"
x:Name="SignaturePadCanvas"
Grid.ColumnSpan="2"
Cleared="OnSignatureCleared"
StrokeColor="{Binding StrokeColor, Source={x:Reference this}}"
StrokeCompleted="OnSignatureStrokeCompleted"
StrokeWidth="{Binding StrokeWidth, Source={x:Reference this}}" />
<freakyControls:FreakySvgImageView
x:Name="ClearLabel"
AbsoluteLayout.LayoutBounds="0,0,40,40"
AbsoluteLayout.LayoutFlags="PositionProportional"
Grid.Column="1"
Base64String="{Binding ClearImageBase64, Source={x:Reference this}}"
HeightRequest="35"
ImageColor="{Binding ClearImageColor, Source={x:Reference this}}"
IsVisible="{Binding IsBlank, Source={x:Reference this}, Converter={StaticResource InverseBoolConverter}}"
ResourceId="{Binding ClearResourceId, Source={x:Reference this}}"
SvgAssembly="{Binding ClearImageAssembly, Source={x:Reference this}}"
SvgMode="AspectFit"
VerticalOptions="Start"
HorizontalOptions="Start"
WidthRequest="35">
<freakyControls:FreakySvgImageView.GestureRecognizers>
<TapGestureRecognizer Tapped="OnClearTapped" />
</freakyControls:FreakySvgImageView.GestureRecognizers>
</freakyControls:FreakySvgImageView>
<VerticalStackLayout
Margin="0"
Padding="0"
AbsoluteLayout.LayoutBounds="0.5,1,1,0.9"
AbsoluteLayout.LayoutFlags="All"
InputTransparent="True"
Spacing="0"
VerticalOptions="End">
<BoxView
x:Name="SignatureLine"
HeightRequest="{Binding SignatureUnderlineWidth, Source={x:Reference this}}"
HorizontalOptions="Fill"
InputTransparent="True"
VerticalOptions="End"
Color="{Binding SignatureUnderlineColor, Source={x:Reference this}}" />
<Label
x:Name="CaptionLabel"
FontFamily="{Binding CaptionFontFamily, Source={x:Reference this}}"
FontSize="{Binding CaptionFontSize, Source={x:Reference this}}"
HorizontalOptions="Fill"
HorizontalTextAlignment="Center"
InputTransparent="True"
Text="{Binding CaptionText, Source={x:Reference this}}"
TextColor="{Binding CaptionTextColor, Source={x:Reference this}}"
VerticalOptions="End" />
</VerticalStackLayout>
</AbsoluteLayout>
</ContentView>