Пример #1
0
 protected override void Dispose(bool disposing)
 {
     base.Dispose(disposing);
     try {
         if (disposing)
         {
             if (_renderer != null)
             {
                 _renderer.Dispose();
                 _renderer = null;
             }
         }
     }
     catch (Exception ex) {
         Debugger.Break();
         System.Diagnostics.Debug.WriteLine($"ERROR: {ex.Message}");
     }
 }
Пример #2
0
        private void UpdateBackground(EntryExtended entryEx)
        {
            try {
                _renderer = new BorderRenderer();

                Control.Background = _renderer.GetBorderBackground(entryEx.BorderColor, entryEx.BackgroundColor, entryEx.BorderWidth, entryEx.BorderRadius);
            }
            catch (Exception ex) {
                Debugger.Break();
                System.Diagnostics.Debug.WriteLine($"ERROR: {ex.Message}");
            }
            if (_renderer != null)
            {
                _renderer.Dispose();
                _renderer = null;
            }
            //Control.Background = new Android.Graphics.Drawables.ColorDrawable(BaseSingleton<ValuesResolver>.Instance.ResolveNativeColor(entryEx.BackgroundColor));
            //Control.Background.SetColorFilter(BaseSingleton<ValuesResolver>.Instance.ResolveNativeColor(entryEx.BackgroundColor), PorterDuff.Mode.SrcAtop);
            //Control.Background.SetColorFilter(Android.Graphics.Color.ParseColor("#fefefe"), PorterDuff.Mode.SrcAtop);
        }