void ShowPopup() { if (_editorPopup == null) { CreatePopup(); } if (_editor.IsPassword != Control.IsPassword) { _editor.IsPassword = Control.IsPassword; } _editor.Text = Control.Text; var edjeObj = Control.EdjeObject; edjeObj.GetColorClass("layout/editfield/bg", out int r, out int g, out int b, out int a, out _, out _, out _, out _, out _, out _, out _, out _); _defaultColor = new ElmSharp.Color(r, g, b, a); _editor.TextColor = Control.TextColor; _editorPopup.Color = Control.BackgroundColor == default(ElmSharp.Color) ? _defaultColor : Control.BackgroundColor; _editor.MoveCursorEnd(); _editor.ShowInputPanel(); }
/// <summary> /// Returns a string representing the provided ElmSharp.Color instance in a hexagonal notation /// </summary> /// <returns>string value containing the encoded color</returns> /// <param name="c">The ElmSharp.Color class instance which will be serialized</param> internal static string ToHex(this EColor c) { if (c.IsDefault) { Log.Warn("Trying to convert the default color to hexagonal notation, it does not works as expected."); } return(string.Format("#{0:X2}{1:X2}{2:X2}{3:X2}", c.R, c.G, c.B, c.A)); }
protected override void OnAttached() { try { (Control as ElmSharp.Entry).BackgroundColor = backgroundColor = EColor.Lime; } catch (Exception ex) { Console.WriteLine("Cannot set property on attached control. Error: ", ex.Message); } }
/// <summary> /// Creates a polygon visual object. /// </summary> /// <since_tizen> 3 </since_tizen> /// <param name="coordinates">List of geographical coordinates.</param> /// <param name="color">Background color.</param> /// <exception cref="ArgumentException">Thrown when input values are invalid.</exception> public Polygon(IEnumerable <Geocoordinates> coordinates, Color color) : base() { var err = Interop.ErrorCode.InvalidParameter; if (coordinates == null || coordinates.Count() < 3) { err.ThrowIfFailed("given coordinates list should contain at least 3 coordinates"); } _coordinateList = coordinates.ToList(); var geocoordinateList = new GeocoordinatesList(_coordinateList, false); handle = new Interop.PolygonHandle(geocoordinateList.handle, color); }
/// <summary> /// Creates polyline visual object. /// </summary> /// <since_tizen> 3 </since_tizen> /// <param name="coordinates">List of geographical coordinates.</param> /// <param name="color">Line color.</param> /// <param name="width">The width of line [1 ~ 100] \(pixels).</param> /// <exception cref="ArgumentException">Thrown when input values are invalid.</exception> public Polyline(List <Geocoordinates> coordinates, Color color, int width) : base() { var err = Interop.ErrorCode.InvalidParameter; if (coordinates == null || coordinates.Count() < 2) { err.ThrowIfFailed("given coordinates list should contain at least 2 coordinates"); } _coordinateList = coordinates.ToList(); var geocoordinateList = new GeocoordinatesList(_coordinateList); handle = new Interop.PolylineHandle(geocoordinateList.handle, color, width); }
protected override void OnElementChanged(ElementChangedEventArgs <Slider> e) { if (Control == null) { SetNativeControl(new ESlider(Forms.NativeParent)); Control.ValueChanged += OnValueChanged; _defaultMinColor = Control.GetPartColor("bar"); _defaultMaxColor = Control.GetPartColor("bg"); _defaultThumbColor = Control.GetPartColor("handler"); } UpdateMinimum(); UpdateMaximum(); UpdateValue(); UpdateSliderColors(); base.OnElementChanged(e); }
protected override void OnElementChanged(ElementChangedEventArgs <Slider> e) { if (Control == null) { SetNativeControl(CreateNativeControl()); Control.ValueChanged += OnValueChanged; Control.DragStarted += OnDragStarted; Control.DragStopped += OnDragStopped; _defaultMinColor = Control.GetBarColor(); _defaultMaxColor = Control.GetBackgroundColor(); _defaultThumbColor = Control.GetHandlerColor(); } UpdateMinimum(); UpdateMaximum(); UpdateValue(); UpdateSliderColors(); base.OnElementChanged(e); }
void ShowPopup() { if (_editorPopup == null) { CreatePopup(); } if (_editor.IsPassword != Control.IsPassword) { _editor.IsPassword = Control.IsPassword; } _editor.Text = Control.Text; DefaultColor = new ElmSharp.Color(40, 40, 40, 255); //editfield bg default color _editor.TextColor = Control.TextColor; _editorPopup.Color = Control.BackgroundColor == default(ElmSharp.Color) ? DefaultColor : Control.BackgroundColor; _editor.MoveCursorEnd(); _editor.ShowInputPanel(); }
protected override void UpdateBackgroundColor(bool initialize) { if (Element.BackgroundColor != default(Xamarin.Forms.Color)) { _roundRectangle.Color = Element.BackgroundColor.ToNative(); } var pancake = Element as PancakeView; if ((pancake.BackgroundGradientStartColor != default(Xamarin.Forms.Color) && pancake.BackgroundGradientEndColor != default(Xamarin.Forms.Color))) { _evasMap = LocalInterop.evas_map_new(4); LocalInterop.evas_map_util_points_populate_from_object_full(_evasMap, _roundRectangle.Handle, 0); ElmSharp.Color startColor = pancake.BackgroundGradientStartColor.ToNative(); ElmSharp.Color endColor = pancake.BackgroundGradientEndColor.ToNative(); LocalInterop.evas_map_point_color_set(_evasMap, 0, startColor.R, startColor.G, startColor.B, startColor.A); LocalInterop.evas_map_point_color_set(_evasMap, 1, startColor.R, startColor.G, startColor.B, startColor.A); LocalInterop.evas_map_point_color_set(_evasMap, 2, endColor.R, endColor.G, endColor.B, endColor.A); LocalInterop.evas_map_point_color_set(_evasMap, 3, endColor.R, endColor.G, endColor.B, endColor.A); //LocalInterop.evas_map_util_points_color_set(_evasMap, 255, 0, 0, 255); LocalInterop.evas_object_map_set(_roundRectangle.Handle, _evasMap); LocalInterop.evas_object_map_enable_set(_roundRectangle.Handle, true); } }
public static Color ToSystemColor(this EColor color) => Color.FromArgb(color.A, color.R, color.G, color.B);
/// <summary> /// Creates an instance of Tizen.UIExtensions.Common.Color class based on provided ElmSharp.Color instance /// </summary> /// <returns>Tizen.UIExtensions.Common.Color instance representing a color which corresponds to the provided ElmSharp.Color</returns> /// <param name="c">The ElmSharp.Color instance which will be converted to a Tizen.UIExtensions.Common.Color</param> public static Color ToCommon(this EColor c) { return(c.IsDefault ? Color.Default : new Color((int)(255.0 * c.R), (int)(255.0 * c.G), (int)(255.0 * c.B), (int)(255.0 * c.A))); }