コード例 #1
0
        public void Create(object masterView, bool scaleImage, string imageName, RectangleF frame, OnCompletion onCompletion)
        {
            View = PlatformView.Create( );
            View.BackgroundColor = ControlStylingConfig.BackgroundColor;
            View.Frame           = frame;
            View.AddAsSubview(masterView);

            MemoryStream logoStream = Rock.Mobile.IO.AssetConvert.AssetToStream(imageName);

            logoStream.Position = 0;
            PonyImage           = PlatformImageView.Create( );
            PonyImage.AddAsSubview(View.PlatformNativeObject);
            PonyImage.Image          = logoStream;
            PonyImage.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit;
            logoStream.Dispose( );

            CloseButton = PlatformButton.Create( );
            CloseButton.AddAsSubview(View.PlatformNativeObject);
            CloseButton.Text            = "Prance! Dance! It's Magic Pony Time!";
            CloseButton.BackgroundColor = PrayerConfig.PrayedForColor;
            CloseButton.TextColor       = ControlStylingConfig.Button_TextColor;
            CloseButton.CornerRadius    = ControlStylingConfig.Button_CornerRadius;
            CloseButton.SizeToFit( );
            CloseButton.ClickEvent = delegate(PlatformButton button)
            {
                OnCompletionCallback( );
            };

            OnCompletionCallback = onCompletion;
        }
コード例 #2
0
 public void Destroy( )
 {
     // clean up resources (looking at you, Android)
     PonyImage.Destroy( );
 }