Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class Popper
- {
- public async static Task Pop (string message, AbsoluteLayout attachLayout, int showforMilliseconds = 1500)
- {
- var container = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.Center,
- BackgroundColor = Color.FromHex ("#DDEFEFEF"),
- Padding = 10
- };
- var label = new Label
- {
- Text = message,
- FontAttributes = FontAttributes.Bold,
- Style = (Style)Application.Current.Resources["PopupText"]
- };
- container.Children.Add (label);
- container.Scale = 0;
- container.Opacity = 0;
- attachLayout.Children.Add (container, attachLayout.Bounds, AbsoluteLayoutFlags.PositionProportional);
- container.ScaleTo (1.0f, 100);
- container.FadeTo (1.0f, 100);
- await Task.Delay (showforMilliseconds);
- container.ScaleTo (0.0f, 250);
- await container.FadeTo (0.0f, 250);
- attachLayout.Children.Remove (container);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement