2using SkiaSharp.Extended.UI.Controls;
19 this.InitializeComponent();
20 this.ContentPageModel = Vm;
23 protected override void OnSizeAllocated(
double width,
double height)
25 base.OnSizeAllocated(width, height);
28 if (this.RainbowView is
null || this.ConfettiView is
null)
34 this.RainbowView.WidthRequest = height + 200;
35 this.RainbowView.HeightRequest = width + 200;
38 this.ConfettiView.Systems?.Clear();
40 double BandHeight = 40;
41 double BandWidth = 40;
44 Rect BottomLeftRect =
new Rect(
46 y: height - BandHeight,
51 Rect BottomRightRect =
new Rect(
53 y: height - BandHeight,
57 this.ConfettiView.Systems?.Add(this.CreateSideSystem(SKConfettiEmitterSide.Left, BottomLeftRect));
58 this.ConfettiView.Systems?.Add(this.CreateSideSystem(SKConfettiEmitterSide.Right, BottomRightRect));
63 Console.WriteLine($
"Error updating rainbow view: {ex.Message}");
71 return base.OnDisappearingAsync();
75 private SKConfettiSystem CreateSideSystem(SKConfettiEmitterSide side, Rect p)
77 SKConfettiSystem Sys =
new SKConfettiSystem
80 Emitter = SKConfettiEmitter.Stream(100, 2),
83 Gravity =
new Point(0, 40),
84 MinimumInitialVelocity = 500,
85 MaximumInitialVelocity = 800,
86 MinimumRotationVelocity = 0,
87 MaximumRotationVelocity = 360,
88 MaximumVelocity = 800,
91 Colors =
new SKConfettiColorCollection
93 Colors.Red, Colors.Yellow, Colors.Green, Colors.Blue
95 Physics =
new SKConfettiPhysicsCollection
97 new SKConfettiPhysics (8,1),
98 new SKConfettiPhysics (12,0.6)
100 Shapes =
new SKConfettiShapeCollection
102 new SKConfettiSquareShape(),
103 new SKConfettiCircleShape()
107 EmitterBounds =
new SKConfettiEmitterBounds(p)
111 if (side == SKConfettiEmitterSide.Left)
114 Sys.StartAngle = 280;
120 Sys.StartAngle = 220;
127 private void SwipeGestureRecognizer_Swiped(
object sender, SwipedEventArgs e)
131 if (this.ContentPageModel is ViewIdentityViewModel VM)
133 if (!this.BottomSheet.IsExpanded)
135 this.BottomSheet?.ToggleExpanded();
Base class that references services in the app.
static ILogService LogService
Log service.
A page to display when the user wants to view an identity.
override Task OnDisappearingAsync()
ViewIdentityPage(ViewIdentityViewModel Vm)
Creates a new instance of the ViewIdentityPage class.