11<?xml version =" 1.0" encoding =" utf-8" ?>
2- <pages : BasePage
2+ <pages : BasePage
3+ x : Class =" CommunityToolkit.Maui.Sample.Pages.Behaviors.AnimationBehaviorPage"
34 xmlns =" http://schemas.microsoft.com/dotnet/2021/maui"
45 xmlns : x =" http://schemas.microsoft.com/winfx/2009/xaml"
6+ xmlns : behaviorPages =" clr-namespace:CommunityToolkit.Maui.Sample.Pages.Behaviors"
57 xmlns : mct =" http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
68 xmlns : pages =" clr-namespace:CommunityToolkit.Maui.Sample.Pages"
79 xmlns : system =" clr-namespace:System;assembly=netstandard"
810 xmlns : vm =" clr-namespace:CommunityToolkit.Maui.Sample.ViewModels.Behaviors"
9- x : Class =" CommunityToolkit.Maui.Sample.Pages.Behaviors.AnimationBehaviorPage"
10- xmlns : behaviorPages =" clr-namespace:CommunityToolkit.Maui.Sample.Pages.Behaviors"
11- x : TypeArguments =" vm:AnimationBehaviorViewModel"
12- x : DataType =" vm:AnimationBehaviorViewModel" >
11+ x : DataType =" vm:AnimationBehaviorViewModel"
12+ x : TypeArguments =" vm:AnimationBehaviorViewModel" >
1313
14- <VerticalStackLayout Spacing = " 15 " Padding = " 12 " >
14+ <VerticalStackLayout Padding = " 12 " Spacing = " 15 " >
1515 <Label >
1616 <Label .FormattedText>
1717 <FormattedString >
2828 </Label .FormattedText>
2929 </Label >
3030
31- <Button Text =" Click this Button" Margin = " 16,0 " >
31+ <Button Margin = " 16,0 " Text =" Click this Button" >
3232 <Button .Behaviors>
3333 <mct : AnimationBehavior EventName =" Clicked" >
3434 <mct : AnimationBehavior .AnimationType>
35- <behaviorPages : SampleScaleAnimation
36- Easing =" {x:Static Easing.Linear}"
37- Length =" 100" />
35+ <behaviorPages : SampleScaleAnimation Easing =" {x:Static Easing.Linear}" Length =" 100" />
3836 </mct : AnimationBehavior .AnimationType>
3937 </mct : AnimationBehavior >
4038 </Button .Behaviors>
4139 </Button >
4240
43- <Entry Placeholder =" Animate on Focused and Unfocused" Margin = " 16,0 " >
41+ <Entry Margin = " 16,0 " Placeholder =" Animate on Focused and Unfocused" >
4442 <Entry .Behaviors>
4543 <mct : AnimationBehavior EventName =" Focused" >
4644 <mct : AnimationBehavior .AnimationType>
47- <behaviorPages : SampleScaleToAnimation
45+ <behaviorPages : SampleScaleToAnimation
4846 Easing =" {x:Static Easing.Linear}"
4947 Length =" 100"
50- Scale =" 1.05" />
48+ Scale =" 1.05" />
5149 </mct : AnimationBehavior .AnimationType>
5250 </mct : AnimationBehavior >
5351
5452 <mct : AnimationBehavior EventName =" Unfocused" >
5553 <mct : AnimationBehavior .AnimationType>
56- <behaviorPages : SampleScaleToAnimation
54+ <behaviorPages : SampleScaleToAnimation
5755 Easing =" {x:Static Easing.Linear}"
5856 Length =" 100"
59- Scale =" 1" />
57+ Scale =" 1" />
58+ </mct : AnimationBehavior .AnimationType>
59+ </mct : AnimationBehavior >
60+ </Entry .Behaviors>
61+ </Entry >
62+
63+ <Entry Margin =" 16,0" Placeholder =" Animate on tap" >
64+ <Entry .Behaviors>
65+ <mct : AnimationBehavior AnimateOnTap =" {Binding Source={x:Reference AnimateOnTapToggle}, Path=IsToggled, x:DataType=Switch}" >
66+ <mct : AnimationBehavior .AnimationType>
67+ <behaviorPages : SampleScaleAnimation Easing =" {x:Static Easing.Linear}" Length =" 100" />
6068 </mct : AnimationBehavior .AnimationType>
6169 </mct : AnimationBehavior >
6270 </Entry .Behaviors>
6371 </Entry >
72+ <HorizontalStackLayout Margin =" 16,0" Spacing =" 10" >
73+ <Label Text =" Toggle animate on tap: " VerticalTextAlignment =" Center" />
74+ <Switch x : Name =" AnimateOnTapToggle" />
75+ </HorizontalStackLayout >
76+
6477
65- <!-- Shows how the AnimationBehavior will play nicely with already attached TapGestureRecognizers -->
66- <Label Text =" Click this Label" Margin =" 16,0" HorizontalOptions =" Center" >
78+ <!-- Shows how the AnimationBehavior will play nicely with already attached TapGestureRecognizers -->
79+ <Label
80+ Margin =" 16,0"
81+ HorizontalOptions =" Center"
82+ Text =" Click this Label" >
6783 <Label .GestureRecognizers>
6884 <TapGestureRecognizer Command =" {Binding AnimationCommand}" />
6985 </Label .GestureRecognizers>
7086 <Label .Behaviors>
7187 <mct : AnimationBehavior >
7288 <mct : AnimationBehavior .AnimationType>
73- <behaviorPages : SampleScaleAnimation
74- Easing =" {x:Static Easing.Linear}"
75- Length =" 100" />
89+ <behaviorPages : SampleScaleAnimation Easing =" {x:Static Easing.Linear}" Length =" 100" />
7690 </mct : AnimationBehavior .AnimationType>
7791 </mct : AnimationBehavior >
7892 </Label .Behaviors>
7993 </Label >
8094
81- <Border BackgroundColor =" LightGreen" Margin =" 16,0" x : Name =" AnimatedBorder" >
95+ <Border
96+ x : Name =" AnimatedBorder"
97+ Margin =" 16,0"
98+ BackgroundColor =" LightGreen" >
8299 <Border .Behaviors>
83- <mct : AnimationBehavior
84- AnimateCommand =" {Binding AnimateFromViewModelCommand}"
85- BindingContext =" {Binding Path=BindingContext, Source={x:Reference AnimatedBorder}, x:DataType=Border}" >
100+ <mct : AnimationBehavior AnimateCommand =" {Binding AnimateFromViewModelCommand}" BindingContext =" {Binding Path=BindingContext, Source={x:Reference AnimatedBorder}, x:DataType=Border}" >
86101 <mct : AnimationBehavior .AnimationType>
87102 <mct : FadeAnimation Opacity =" 0.2" />
88103 </mct : AnimationBehavior .AnimationType>
89104 </mct : AnimationBehavior >
90105 </Border .Behaviors>
91- <Label Text =" Click Inside This Border" HorizontalOptions = " Center " />
106+ <Label HorizontalOptions = " Center " Text =" Click Inside This Border" />
92107 </Border >
93108
94- <Button Text =" Animate the frame above" Command = " {Binding TriggerAnimationCommand} " />
109+ <Button Command = " {Binding TriggerAnimationCommand} " Text =" Animate the frame above" />
95110 </VerticalStackLayout >
96111</pages : BasePage >
0 commit comments