static void Main(string[] args) { // Create Watermarker instance Watermarker waterMarker = new Watermarker(); // Initialize library waterMarker.InitLibrary("demo", "demo"); // Set input file name string inputFilePath = "my_sample_image.jpg"; // Set output file title string outputFilePath = "my_sample_output.jpg"; // Add image to apply watermarks to waterMarker.AddInputFile(inputFilePath, outputFilePath); // Create new watermark LogoImage preset = new LogoImage(); // Select image file preset.ImageFile = "mylogo.png"; // Add watermark to watermarker waterMarker.AddWatermark(preset); // Set output directory waterMarker.OutputOptions.OutputDirectory = "."; // Apply watermarks waterMarker.Execute(); // open generated image file in default image viewer installed in Windows Process.Start(outputFilePath); }
void PositionImage() { LogoImage.SetValue(Canvas.LeftProperty, _SplashImageRect.X); LogoImage.SetValue(Canvas.TopProperty, _SplashImageRect.Y); LogoImage.Height = _SplashImageRect.Height; LogoImage.Width = _SplashImageRect.Width; }
public SplashScreenImage(SplashScreenSettings settings, string splashImagePath, string logoPath) { InitializeComponent(); if (!string.IsNullOrEmpty(splashImagePath)) { BackgroundImage.Source = new BitmapImage(new Uri(splashImagePath)); } if (!string.IsNullOrEmpty(logoPath)) { LogoImage.Source = new BitmapImage(new Uri(logoPath)); LogoImage.VerticalAlignment = settings.LogoVerticalAlignment; switch (settings.LogoHorizontalAlignment) { case HorizontalAlignment.Left: LogoImage.SetValue(Grid.ColumnProperty, 0); break; case HorizontalAlignment.Center: LogoImage.SetValue(Grid.ColumnProperty, 1); break; case HorizontalAlignment.Right: LogoImage.SetValue(Grid.ColumnProperty, 2); break; default: break; } } }
async Task ExecuteStoryboardAsync() { await Task.Delay(3000); await LogoImage.ScaleTo(0.75f, length : 1000, easing : Easing.CubicOut); await LogoImage.ScaleTo(25, length : 250, easing : Easing.CubicIn); }
public LogoEditor(UIScreen _tScreen) { tLogoImage = new LogoImage(); tLogoImage.Init(); tScreen = _tScreen; AddLogoToScreen(260, 160); AddLogoListToScreen(); AddLogoLayersToScreen(); }
void ReleaseDesignerOutlets() { if (EmailText != null) { EmailText.Dispose(); EmailText = null; } if (InputLayout != null) { InputLayout.Dispose(); InputLayout = null; } if (LoginButton != null) { LoginButton.Dispose(); LoginButton = null; } if (LoginLayout != null) { LoginLayout.Dispose(); LoginLayout = null; } if (LogoImage != null) { LogoImage.Dispose(); LogoImage = null; } if (PasswordText != null) { PasswordText.Dispose(); PasswordText = null; } if (RegisterButton != null) { RegisterButton.Dispose(); RegisterButton = null; } if (VerifyButton != null) { VerifyButton.Dispose(); VerifyButton = null; } if (FacebookLoginButton != null) { FacebookLoginButton.Dispose(); FacebookLoginButton = null; } }
private void PanGestureRecognizer_PanUpdated(object sender, PanUpdatedEventArgs e) { if (animationStarted) { return; } if (LogoImage.TranslationY > -50 && LogoImage.TranslationY <= 0) { LogoImage.TranslationY += e.TotalY; if (LogoImage.TranslationY > 0) { LogoImage.TranslationY = 0; } return; } animationStarted = true; Animating?.Invoke(); MaterialFrame.FadeTo(0.99, 160u * (uint)InputSL.Children.Count, Easing.CubicInOut); // Opacity 1.0 causes text above to become blurred? LogoImage.TranslateTo(0, Height * -0.35d, 400, Easing.CubicOut); TitleSL.FadeTo(1, 600, Easing.CubicInOut); TitleSL.TranslateTo(0, 0, 600, Easing.CubicInOut); ChevronSL.FadeTo(0, 100, Easing.CubicOut); EmailEntry.IsEnabled = PasswordEntry.IsEnabled = PasswordConfirmationEntry.IsEnabled = true; int t = 0; foreach (VisualElement v in InputSL.Children) { t += 160; v.TranslationX = -v.Width; Device.StartTimer(TimeSpan.FromMilliseconds(t), () => { if (!_signUp) { if (v == Button) { v.TranslateTo(0, -(PasswordConfirmationSL.Height + 4), 400, Easing.SinOut); v.FadeTo(1, 400, Easing.SinOut); return(false); } else if (v == PasswordConfirmationSL) { v.TranslateTo(0, 0, 400, Easing.SinOut); return(false); } } v.TranslateTo(0, 0, 400, Easing.SinOut); v.FadeTo(1, 400, Easing.SinOut); return(false); }); } ThemeEngine.RefreshTheme(); // Set nav colours to what they should be on android }
private void OnBackgrndImageLoaded(object sender, FFImageLoading.Forms.CachedImageEvents.FinishEventArgs e) { if (Shell.Current.CurrentState.Location.OriginalString != "//Login") { return; } imageLoaded = true; ChevronSL.FadeTo(1, 500, Easing.CubicOut); BackgrndImage.FadeTo(1, 500, Easing.CubicOut); LogoImage.TranslateTo(0, 80, 750, Easing.CubicInOut); }
private void SplashPage_Loaded(object sender, RoutedEventArgs e) { PositionImage(); Window.Current.SizeChanged += Current_SizeChanged; LogoEffectAnim = LogoImage.Offset(0, -64, 250, 100); LogoEffectAnim.Completed += (_, s) => { LoadingUI.Fade(1.0f, 250).Start(); }; LogoEffectAnim.Start(); }
protected override async void OnAppearing() { base.OnAppearing(); Version.Text = (Application.Current as App).Version; await LogoImage.ScaleTo(0.9, 1500, Easing.Linear); await LogoImage.ScaleTo(1, 1000, Easing.Linear); Application.Current.MainPage = new NavigationPage(new MainPage()); await Navigation.PushAsync(new MainPage()); }
public override async void OnNavigatedTo(string parameter, NavigationMode mode, IDictionary <string, object> state) { JsonObject data = JsonObject.Parse(parameter); TileTitle = data.GetNamedString("tile_title"); PageHeader = data.GetNamedString("header"); Action = data.GetNamedString("action"); m_id = data.GetNamedString("id"); if (mode == NavigationMode.Back) { int key = (int)state["key"]; var d = (JsonObject)TempDataStore.GetInstance().GetObject(key); SetImageData(d.GetNamedObject("logo"), m_logoImage); SetImageData(d.GetNamedObject("small"), m_smallImage); SetImageData(d.GetNamedObject("wide"), m_wideImage); SetImageData(d.GetNamedObject("large"), m_largeImage); UseDarkText = d.GetNamedBoolean("use_dark"); } else { await WideImage.SetImageSource(""); await SmallImage.SetImageSource(""); await LogoImage.SetImageSource(""); await LargeImage.SetImageSource(""); string uri = ""; if (data.ContainsKey("image_wide_url")) { uri = data.GetNamedString("image_wide_url"); await WideImage.SetImageSource(uri); } if (uri != "") { if (WideImage.ImageSource == null) { await WideImage.SetImageSource(uri); } if (LogoImage.ImageSource == null) { await LogoImage.SetImageSource(uri); } //if (String.IsNullOrEmpty(SmallImage.ImageSource)) // await SmallImage.SetImageSource(uri); //if (String.IsNullOrEmpty(LargeImage.ImageSource)) // await LargeImage.SetImageSource(uri); } } }
void ReleaseDesignerOutlets() { if (LogoImage != null) { LogoImage.Dispose(); LogoImage = null; } if (TitelLabel != null) { TitelLabel.Dispose(); TitelLabel = null; } }
public MainWindow() { InitializeComponent(); logoPanel.Height = 530; FormPanel.Visibility = Visibility.Hidden; ThicknessAnimation myThicknessAnimation = new ThicknessAnimation(); myThicknessAnimation.Duration = TimeSpan.FromSeconds(1.0); myThicknessAnimation.FillBehavior = FillBehavior.HoldEnd; myThicknessAnimation.From = new Thickness(102, 172, 0, 0); myThicknessAnimation.To = new Thickness(102, 10, 0, 0); LogoImage.BeginAnimation(Image.MarginProperty, myThicknessAnimation); FormPanel.Visibility = Visibility.Visible; }
private void setDesign(Design design) { //LogoImage.Source = design.logo; LogoImage.SetResourceReference(Image.SourceProperty, design.logoref); // Background colors CardDesign.Background = design.color_bg_primary; Sec2Color.Background = design.color_bg_secondary; if (design.isPhoto) { LogoImage2.Visibility = Visibility.Hidden; // Text colors NameFirst.Visibility = Visibility.Visible; NameFirst.Foreground = design.color_text_primary; NameLast.Visibility = Visibility.Visible; NameLast.Foreground = design.color_text_secondary; JobDescription.Visibility = Visibility.Visible; JobDescription.Foreground = design.color_text_secondary; NameFirst.Height = Double.NaN; } else { LogoImage2.Visibility = Visibility.Visible; NameFirst.Visibility = Visibility.Hidden; NameLast.Visibility = Visibility.Hidden; JobDescription.Visibility = Visibility.Hidden; NameFirst.Height = 0; LogoImage2.SetResourceReference(Image.SourceProperty, design.logo2ref); Bio person = App.Current.Resources["person"] as Bio; Uri unknownPerson = new Uri(@"pack://application:,,,/Resources/img/unkown person.png"); person.Photo = new BitmapImage(unknownPerson); } // Clear footer and add new one if present Footer.Children.Clear(); if (design.footer != null) { Footer.Children.Add(design.footer); } }
static void Main(string[] args) { // Create Watermarker instance Watermarker waterMarker = new Watermarker(); // Initialize library waterMarker.InitLibrary("demo", "demo"); // Set input file name string inputFilePath = "my_sample_image.jpg"; // Set output file title string outputFilePath = "my_sample_output.jpg"; // Add image to apply watermarks to waterMarker.AddInputFile(inputFilePath, outputFilePath); // Create new watermark LogoImage preset = new LogoImage(); // Select image file preset.ImageFile = "mylogo.png"; // Set text transparency preset.Transparency = 40; // Set watermark placement preset.Placement = WatermarkPlacement.MiddleCenter; // Set scale preset.Scale = 2.0f; // Add watermark to watermarker waterMarker.AddWatermark(preset); // Set output directory waterMarker.OutputOptions.OutputDirectory = "."; // Set output format waterMarker.OutputOptions.ImageFormat = OutputFormats.JPEG; // Apply watermarks waterMarker.Execute(); // open generated image file in default image viewer installed in Windows Process.Start(outputFilePath); }
public override void WriteTo(XElement xE) { base.WriteTo(xE); XmlUtility.SetXsiType(xE, "https://adwords.google.com/api/adwords/cm/v201609", "ResponsiveDisplayAd"); XElement xItem = null; if (MarketingImage != null) { xItem = new XElement(XName.Get("marketingImage", "https://adwords.google.com/api/adwords/cm/v201609")); MarketingImage.WriteTo(xItem); xE.Add(xItem); } if (LogoImage != null) { xItem = new XElement(XName.Get("logoImage", "https://adwords.google.com/api/adwords/cm/v201609")); LogoImage.WriteTo(xItem); xE.Add(xItem); } if (ShortHeadline != null) { xItem = new XElement(XName.Get("shortHeadline", "https://adwords.google.com/api/adwords/cm/v201609")); xItem.Add(ShortHeadline); xE.Add(xItem); } if (LongHeadline != null) { xItem = new XElement(XName.Get("longHeadline", "https://adwords.google.com/api/adwords/cm/v201609")); xItem.Add(LongHeadline); xE.Add(xItem); } if (Description != null) { xItem = new XElement(XName.Get("description", "https://adwords.google.com/api/adwords/cm/v201609")); xItem.Add(Description); xE.Add(xItem); } if (BusinessName != null) { xItem = new XElement(XName.Get("businessName", "https://adwords.google.com/api/adwords/cm/v201609")); xItem.Add(BusinessName); xE.Add(xItem); } }
private async Task AnimateLoginStart() { await Task.Run(() => { LoginEntry.FadeTo(0, 500, Easing.Linear); PasswordEntry.FadeTo(0, 500, Easing.Linear); LoginButton.FadeTo(0, 500, Easing.Linear); }); await LogoImage.TranslateTo(0, 50, 1000, Easing.Linear); while ((BindingContext as LoginPageViewModel).Busy) { await LogoImage.FadeTo(1, 600); await LogoImage.FadeTo(0, 600); } }
private void PanGestureRecognizer_PanUpdated(object sender, PanUpdatedEventArgs e) { if (animationStarted) { return; } if (LogoImage.TranslationY > -50 && LogoImage.TranslationY <= 0) { LogoImage.TranslationY += e.TotalY; if (LogoImage.TranslationY > 0) { LogoImage.TranslationY = 0; } return; } animationStarted = true; Animating?.Invoke(); MaterialFrame.FadeTo(0.99, 160u * (uint)ButtonSL.Children.Count, Easing.CubicInOut); // Opacity 1.0 causes text above to become blurred? LogoImage.TranslateTo(0, Height * -0.35d, 400, Easing.CubicOut); TitleSL.FadeTo(1, 600, Easing.CubicInOut); TitleSL.TranslateTo(0, 0, 600, Easing.CubicInOut); ChevronSL.FadeTo(0, 100, Easing.CubicOut); int t = 0; foreach (Frame f in ButtonSL.Children) { t += 160; f.TranslationX = -f.Width; Device.StartTimer(TimeSpan.FromMilliseconds(t), () => { f.TranslateTo(0, 0, 400, Easing.SinOut); f.FadeTo(1, 400, Easing.SinOut); return(false); }); } ThemeEngine.RefreshTheme(); // Set nav colours to what they should be on android }
protected override async void OnAppearing() { base.OnAppearing(); await LogoImage.ScaleTo(0.9, 1500, Easing.Linear); await LogoImage.ScaleTo(1, 1000, Easing.Linear); //if (CrossConnectivity.Current.IsConnected) //{ // // your logic... Application.Current.MainPage = new NavigationPage(new MainMenuPage()); await Navigation.PushAsync(new MainMenuPage()); //} //else //{ // await DisplayAlert("Error", "No internet access.", "OK"); // var closer = DependencyService.Get<ICloseApplication>(); // if (closer != null) // closer.closeApplication(); //} }
private void InitiateDocument() { PdfStream = new MemoryStream(); PdfDocument = new Document(ReportConfiguration.PageOrientation); PdfDocument.SetMargins(ReportConfiguration.MarginLeft, ReportConfiguration.MarginRight, ReportConfiguration.MarginTop, ReportConfiguration.MarginBottom); PdfWriter = PdfWriter.GetInstance(PdfDocument, PdfStream); // create logo, header and page number objects PdfPCell cell; HeaderSectionHeight = 0; LogoImage = null; if (ReportConfiguration.LogoPath != null) { LogoImage = Image.GetInstance(ReportConfiguration.LogoPath); LogoImage.ScalePercent(ReportConfiguration.LogImageScalePercent); LogoImage.SetAbsolutePosition(PdfDocument.LeftMargin, PdfDocument.PageSize.Height - PdfDocument.TopMargin - LogoImage.ScaledHeight); HeaderSectionHeight = LogoImage.ScaledHeight; } Title = null; float titleHeight = 0; if ((ReportConfiguration.ReportTitle != null) || (ReportConfiguration.ReportSubTitle != null)) { Title = new PdfPTable(1); Title.TotalWidth = PdfDocument.PageSize.Width - (PdfDocument.LeftMargin + PdfDocument.RightMargin); if (ReportConfiguration.ReportTitle != null) { cell = new PdfPCell(new Phrase(ReportConfiguration.ReportTitle, new Font(ReportFonts.HelveticaBold, 12))); cell.HorizontalAlignment = Element.ALIGN_CENTER; cell.Border = 0; Title.AddCell(cell); } if (ReportConfiguration.ReportSubTitle != null) { cell = new PdfPCell(new Phrase(ReportConfiguration.ReportSubTitle, new Font(ReportFonts.Helvetica, 10))); cell.HorizontalAlignment = Element.ALIGN_CENTER; cell.PaddingTop = 5; cell.Border = 0; Title.AddCell(cell); } // Get the height of the title section for (int i = 0; i < Title.Rows.Count; i++) { titleHeight = titleHeight + Title.GetRowHeight(i); } } HeaderSectionHeight = (HeaderSectionHeight > titleHeight) ? HeaderSectionHeight : titleHeight; PageNumberLabel = new PdfPTable(1); PageNumberLabel.TotalWidth = PdfDocument.PageSize.Width - (PdfDocument.LeftMargin + PdfDocument.RightMargin); cell = new PdfPCell(new Phrase ("Page Label", new Font(ReportFonts.Helvetica, 8))); cell.Border = 0; float pagenumberHeight = PageNumberLabel.GetRowHeight(0); HeaderSectionHeight = (HeaderSectionHeight > pagenumberHeight) ? HeaderSectionHeight : pagenumberHeight; }
private void AppInfoAnimation(object sender, ElapsedEventArgs e) { Device.BeginInvokeOnMainThread(async() => { if (App.Animation) { #region 앱 정보 await AppIconImage.FadeTo(1, 1500, Easing.SpringIn); await Task.Delay(250); await AppNameText.FadeTo(1, 1000, Easing.SpringIn); Device.BeginInvokeOnMainThread(() => { AppVersionText.Text = "v" + App.Version; AppVersionText.TranslationX -= 60; AppVersionText.Opacity = 1; }); await AppVersionText.TranslateTo(1, 0, 1000, Easing.BounceOut); #endregion await Task.Delay(100); await Line1.FadeTo(1, 250, Easing.SpringIn); await Task.Delay(100); #region 사용 된 프레임워크 텍스트 await FrameworkText.FadeTo(1, 1000, Easing.SpringIn); #endregion await Task.Delay(500); #region Xamarin 텍스트 로고 Device.BeginInvokeOnMainThread(() => { TextLogoImage.Opacity = 1; TextLogoImage.TranslationX += 250; }); _ = TextLogoImage.TranslateTo(-50, 0, 1500, Easing.BounceIn); _ = TextLogoImage.TranslateTo(1, 0, 500, Easing.BounceOut); #endregion #region Xamarin 로고 Device.BeginInvokeOnMainThread(() => { LogoImage.Opacity = 1; LogoImage.TranslationX -= 100; }); _ = LogoImage.TranslateTo(100, 0, 1500, Easing.BounceIn); _ = LogoImage.TranslateTo(1, 0, 500, Easing.BounceOut); #endregion await Task.Delay(1000); await Line2.FadeTo(1, 250, Easing.SpringIn); await Task.Delay(100); #region 개발자 텍스트 await DevelopmentText.FadeTo(1, 1000, Easing.SpringIn); await Task.Delay(250); await Developer1LText.FadeTo(1, 250, Easing.SpringIn); await Task.Delay(100); await Developer1Text.FadeTo(1, 750, Easing.SpringOut); await Task.Delay(100); await Developer2LText.FadeTo(1, 250, Easing.SpringIn); await Task.Delay(100); await Developer2Text.FadeTo(1, 750, Easing.SpringOut); await Task.Delay(100); await Developer3LText.FadeTo(1, 250, Easing.SpringIn); await Task.Delay(100); await Developer3Text.FadeTo(1, 750, Easing.SpringOut); #endregion } else { AppIconImage.Opacity = 1; AppNameText.Opacity = 1; AppVersionText.Text = "v" + App.Version; AppVersionText.Opacity = 1; Line1.Opacity = 1; FrameworkText.Opacity = 1; TextLogoImage.Opacity = 1; LogoImage.Opacity = 1; Line2.Opacity = 1; DevelopmentText.Opacity = 1; Developer1LText.Opacity = 1; Developer1Text.Opacity = 1; Developer2LText.Opacity = 1; Developer2Text.Opacity = 1; Developer3LText.Opacity = 1; Developer3Text.Opacity = 1; } }); }
public IEnumerator Load() { bool IsNoLogo = Logos == null || Logos.Count == 0; if (LogoConfig.IsEditorMode() && !IsNoLogo) { while (BaseLogoPlayer == null) { yield return(new WaitForEndOfFrame()); } yield return(new WaitForSeconds(0.1f)); for (int i = 0; i < Logos.Count; ++i) { if (tweener != null) { tweener.Kill(); } if (Logos[i].IsImage()) { LogoImage.color = new Color(1, 1, 1, 0); tweener = DOTween.ToAlpha(() => LogoImage.color, x => LogoImage.color = x, 1.0f, Logos[i].InTime); LogoImage.sprite = Logos[i].Logo; LogoImage.SetNativeSize(); yield return(new WaitForSeconds(Logos[i].WaitTime)); if (tweener != null) { tweener.Kill(); } tweener = DOTween.ToAlpha(() => LogoImage.color, x => LogoImage.color = x, 0.0f, Logos[i].OutTime); } else if (Logos[i].IsVideo()) { LogoVideo.Play(Logos[i].Video); while (LogoVideo.IsPreparing) { yield return(new WaitForEndOfFrame()); } LogoVideo.Show(); while (LogoVideo.IsPlaying()) { yield return(new WaitForEndOfFrame()); } if (!IsNextVideo(i)) { LogoVideo.Close(); } } if (i < Logos.Count - 1) { yield return(new WaitForSeconds(Logos[i].OutTime)); } } yield return(new WaitForSeconds(0.5f)); } IsShowedLogo = true; bool IsNextVideo(int i) { var index = i + 1; if (index < Logos.Count - 1) { return(Logos[index].IsVideo()); } return(false); } }
private void InitViews() { LogoImage?.SetImageFromResource(DrawableConstants.LogoIcon); BackroundImage?.SetImageFromResource(DrawableConstants.SignBackround); if (PasswordWatchImage != null) { PasswordWatchImage?.SetImageFromResource(DrawableConstants.ShowPassword); PasswordWatchImage.SetImageColorFilter(ColorConstants.ButtonGray); PasswordWatchImage.Click -= ShowPasswordContent; PasswordWatchImage.Click += ShowPasswordContent; } if (EmailPlaceholderText != null) { EmailPlaceholderText.Text = RSign.SignEmailText; EmailPlaceholderText.SetFont(FontsConstant.RobotoRegular, FontsConstant.Size15); EmailPlaceholderText.SetTextColor(ColorConstants.ButtonGray); } if (EmailText != null) { EmailText.SetTextColor(ColorConstants.WhiteColor); EmailText.SetCursorColor(ColorConstants.SelectorHome); EmailText.Focus -= LineEmail; EmailText.Focus += LineEmail; EmailText.SetFont(FontsConstant.RobotoRegular, FontsConstant.Size16); } EmailLineText?.SetBackgroundColor(ColorConstants.WhiteColor); if (PasswordPlaceholderText != null) { PasswordPlaceholderText.Text = RSign.SignPasswordText; PasswordPlaceholderText.SetFont(FontsConstant.OpenSansRegular, FontsConstant.Size15); PasswordPlaceholderText.SetTextColor(ColorConstants.ButtonGray); } if (PasswordText != null) { PasswordText.SetTextColor(ColorConstants.WhiteColor); PasswordText.SetSecure(InputType.Password); PasswordText.SetFont(FontsConstant.OpenSansRegular, FontsConstant.Size16); PasswordText.SetCursorColor(ColorConstants.SelectorHome); PasswordText.Focus -= LinePassword; PasswordText.Focus += LinePassword; } PasswordLineText?.SetBackgroundColor(ColorConstants.WhiteColor); if (PasswordForgotText != null) { PasswordForgotText.Text = RSign.SignForgotText; PasswordForgotText.SetTextColor(ColorConstants.WhiteColor); PasswordForgotText.SetFont(FontsConstant.RobotoRegular, FontsConstant.Size15); } if (SignInText != null) { SignInText.Text = RSign.SignSignInText.ToUpperInvariant(); SignInText.SetTextColor(ColorConstants.WhiteColor); SignInText.SetBackgroundColor(ColorConstants.SelectorHome); SignInText.SetSelectedColor(ColorConstants.WhiteColor); SignInText.SetFont(FontsConstant.RobotoBold, FontsConstant.Size14); } if (RegistrationDontAccountText != null) { RegistrationDontAccountText.Text = RSign.SignNotHaveAccount; RegistrationDontAccountText.SetTextColor(ColorConstants.WhiteColor); RegistrationDontAccountText.SetFont(FontsConstant.RobotoRegular, FontsConstant.Size15); } if (SignUpText != null) { SignUpText.Text = RSign.SignSignUpText; SignUpText.SetTextColor(ColorConstants.SelectorHome); SignUpText.SetFont(FontsConstant.RobotoRegular, FontsConstant.Size15); SignUpText.Click -= SignUp_Click; SignUpText.Click += SignUp_Click; } if (ConnectFacebookText != null) { ConnectFacebookText.Text = RSign.SignWithFacebook.ToUpperInvariant(); ConnectFacebookText.SetTextColor(ColorConstants.WhiteColor); ConnectFacebookText.SetBackgroundColor(ColorConstants.BlueFacebookColor); ConnectFacebookText.SetSelectedColor(ColorConstants.WhiteColor); ConnectFacebookText.SetFont(FontsConstant.MontserratBold, FontsConstant.Size12); } ConnectFacebookImage?.SetImageFromResource(DrawableConstants.FacebookLogo); FacebookContent?.SetBackgroundColor(ColorConstants.BlueFacebookColor); }
private void UpdateUiForConnectButtonClick() { //if prev was on if (_prevConnectionState) { //turn off //update button text ConnectButton.Content = "Connect"; //disable message entry MessageTextBox.IsEnabled = false; SendMessageButton.IsEnabled = false; StopButton.IsEnabled = false; //disable server and port text boxes ServerTextBox.IsEnabled = true; PortTextBox.IsEnabled = true; //create animations var ledBlurRadiusAnimation = new DoubleAnimation(LedBlurRadius, 0, TimeSpan.FromSeconds(LightToggleAnimLength)); var logoImageBlurRadiusAnimation = new DoubleAnimation(LogoBlurRadius, 0, TimeSpan.FromSeconds(LightToggleAnimLength)); var ledOpacityAnimation = new DoubleAnimation(LedOnOpacity, LedOffOpacity, TimeSpan.FromSeconds(LightToggleAnimLength)); var logoOpacityAnimation = new DoubleAnimation(LogoOnOpacity, LogoOffOpacity, TimeSpan.FromSeconds(LightToggleAnimLength)); //start animations _ledBlurEffect.BeginAnimation(BlurEffect.RadiusProperty, ledBlurRadiusAnimation); _logoBlurEffect.BeginAnimation(BlurEffect.RadiusProperty, logoImageBlurRadiusAnimation); ConnectionStatusLedImage.BeginAnimation(OpacityProperty, ledOpacityAnimation); LogoImageBlurLayer.BeginAnimation(OpacityProperty, logoOpacityAnimation); LogoImage.BeginAnimation(OpacityProperty, logoOpacityAnimation); } else { //else turn on // update button text ConnectButton.Content = "Disconnect"; //enable message entry MessageTextBox.IsEnabled = true; SendMessageButton.IsEnabled = true; StopButton.IsEnabled = true; //enable server and port text boxes ServerTextBox.IsEnabled = false; PortTextBox.IsEnabled = false; //create animations var ledBlurRadiusAnimation = new DoubleAnimation(0, LedBlurRadius, TimeSpan.FromSeconds(LightToggleAnimLength)); var logoImageBlurRadiusAnimation = new DoubleAnimation(0, LogoBlurRadius, TimeSpan.FromSeconds(LightToggleAnimLength)); var ledOpacityAnimation = new DoubleAnimation(LedOffOpacity, LedOnOpacity, TimeSpan.FromSeconds(LightToggleAnimLength)); var logoOpacityAnimation = new DoubleAnimation(LogoOffOpacity, LogoOnOpacity, TimeSpan.FromSeconds(LightToggleAnimLength)); //start animations _ledBlurEffect.BeginAnimation(BlurEffect.RadiusProperty, ledBlurRadiusAnimation); _logoBlurEffect.BeginAnimation(BlurEffect.RadiusProperty, logoImageBlurRadiusAnimation); ConnectionStatusLedImage.BeginAnimation(OpacityProperty, ledOpacityAnimation); LogoImageBlurLayer.BeginAnimation(OpacityProperty, logoOpacityAnimation); LogoImage.BeginAnimation(OpacityProperty, logoOpacityAnimation); } }