コード例 #1
0
        private async Task ContentScrolled(double yOffset)
        {
            if (yOffset > headerMaxScroll &&
                -LblTitle.TranslationX > labelTitleMaxTranslation)
            {
                return;
            }

            double scrollY = yOffset < 0 ? 0 : yOffset;
            double labelTitleTranslation = labelTitleMaxTranslation * scrollY / headerMaxScroll;
            double imageTranslationX     = imgProfileMaxTranslationX * scrollY / headerMaxScroll;
            double imageTranslationY     = imgProfileMaxTranslationY * scrollY / headerMaxScroll;
            double imageScale            = 1 - imgProfileMinScaleDiff * scrollY / headerMaxScroll;

            Debug.WriteLine($"scrollY: {scrollY}");
            Debug.WriteLine($"labelTitleTranslation: {labelTitleTranslation}");
            Debug.WriteLine($"imageTranslationX: {imageTranslationX}");
            Debug.WriteLine($"imageTranslationY: {imageTranslationY}");
            Debug.WriteLine($"imageScale: {imageScale}");

            if (scrollY >= headerMaxScroll)
            {
                await Task.WhenAll(GridImageBackgroud.TranslateTo(0, -headerMaxScroll),
                                   LblTitle.TranslateTo(-labelTitleMaxTranslation, 0),
                                   ImgProfilePicture.TranslateTo(imgProfileMaxTranslationX, -imgProfileMaxTranslationY),
                                   ImgProfilePicture.ScaleTo(1 - imgProfileMinScaleDiff));
            }
            else
            {
                await Task.WhenAll(GridImageBackgroud.TranslateTo(0, -scrollY),
                                   LblTitle.TranslateTo(-labelTitleTranslation, 0),
                                   ImgProfilePicture.TranslateTo(imageTranslationX, -imageTranslationY),
                                   ImgProfilePicture.ScaleTo(imageScale));
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (TxtNameAdmin != null)
            {
                TxtNameAdmin.Dispose();
                TxtNameAdmin = null;
            }

            if (TxtAddressAdmin != null)
            {
                TxtAddressAdmin.Dispose();
                TxtAddressAdmin = null;
            }

            if (TxtPhoneAdmin != null)
            {
                TxtPhoneAdmin.Dispose();
                TxtPhoneAdmin = null;
            }

            if (BtnDisableAccount != null)
            {
                BtnDisableAccount.Dispose();
                BtnDisableAccount = null;
            }

            if (BtnEdit != null)
            {
                BtnEdit.Dispose();
                BtnEdit = null;
            }

            if (BtnEnableAccount != null)
            {
                BtnEnableAccount.Dispose();
                BtnEnableAccount = null;
            }

            if (ImgProfilePicture != null)
            {
                ImgProfilePicture.Dispose();
                ImgProfilePicture = null;
            }

            if (LblChange != null)
            {
                LblChange.Dispose();
                LblChange = null;
            }

            if (ViewProfilePicture != null)
            {
                ViewProfilePicture.Dispose();
                ViewProfilePicture = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (BtnEdit != null)
            {
                BtnEdit.Dispose();
                BtnEdit = null;
            }

            if (ImgProfilePicture != null)
            {
                ImgProfilePicture.Dispose();
                ImgProfilePicture = null;
            }

            if (LblChange != null)
            {
                LblChange.Dispose();
                LblChange = null;
            }

            if (TxtAddress != null)
            {
                TxtAddress.Dispose();
                TxtAddress = null;
            }

            if (TxtName != null)
            {
                TxtName.Dispose();
                TxtName = null;
            }

            if (TxtPhone != null)
            {
                TxtPhone.Dispose();
                TxtPhone = null;
            }

            if (ViewProfilePicture != null)
            {
                ViewProfilePicture.Dispose();
                ViewProfilePicture = null;
            }
        }