-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathExample6.xaml
41 lines (41 loc) · 2.53 KB
/
Example6.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
<?xml version="1.0" encoding="utf-8" ?>
<ContentView x:Class="App.Controls.Examples.Example6"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:control="clr-namespace:App.Controls.Examples"
xmlns:stateButton="clr-namespace:IeuanWalker.Maui.StateButton;assembly=IeuanWalker.Maui.StateButton">
<ContentView.ControlTemplate>
<ControlTemplate x:DataType="control:Example6">
<stateButton:StateButton Grid.Column="0"
BackgroundColor="#7B66FF"
Clicked="StateButton_Clicked"
ClickedCommand="{TemplateBinding ClickedCommand}"
ClickedCommandParameter="{TemplateBinding ClickedCommandParameter}"
HeightRequest="60"
HorizontalOptions="Fill"
Pressed="StateButton_Pressed"
PressedCommand="{TemplateBinding PressedCommand}"
PressedCommandParameter="{TemplateBinding PressedCommandParameter}"
Released="StateButton_Released"
ReleasedCommand="{TemplateBinding ReleasedCommand}"
ReleasedCommandParameter="{TemplateBinding ReleasedCommandParameter}"
SemanticProperties.Description="{TemplateBinding Text}"
SemanticProperties.Hint="{TemplateBinding AccessibilityHint}">
<stateButton:StateButton.StrokeShape>
<RoundRectangle CornerRadius="5" />
</stateButton:StateButton.StrokeShape>
<stateButton:StateButton.Triggers>
<Trigger TargetType="stateButton:StateButton" Property="State" Value="Pressed">
<Setter Property="BackgroundColor" Value="#654dff" />
</Trigger>
</stateButton:StateButton.Triggers>
<Label FontAttributes="Bold"
FontSize="15"
HorizontalTextAlignment="Center"
Text="{TemplateBinding Text}"
TextColor="White"
VerticalTextAlignment="Center" />
</stateButton:StateButton>
</ControlTemplate>
</ContentView.ControlTemplate>
</ContentView>