void RemoveCircleSurfaceItem(ICircleSurfaceItem item) { if (_circleSurfaceItems.TryGetValue(item, out var widget)) { ElmSharp.EvasObject obj = widget as ElmSharp.EvasObject; obj?.Unrealize(); _circleSurfaceItems.Remove(item); } }
partial void DisconnectingHandler(PlatformView platformView) { if (platformView == null) { return; } platformView.Deleted -= OnPlatformViewDeleted; }
/// <summary> /// Creates a view and links it to the instance of a map service. /// </summary> /// <since_tizen> 3 </since_tizen> /// <param name="parent">An instance of <see cref="EvasObject"/> object for which a map view will be drawn.</param> /// <param name="service">An instance of <see cref="MapService"/> object.</param> /// <privilege>http://tizen.org/privilege/mapservice</privilege> /// <exception cref="System.NotSupportedException">Thrown when the required feature is not supported.</exception> /// <exception cref="System.UnauthorizedAccessException">Thrown when application does not have some privilege to access this method.</exception> /// <exception cref="System.ArgumentException">Thrown when parameters are invalid.</exception> /// <exception cref="System.InvalidOperationException">Thrown when a native operation failed to allocate memory, and connect to the service.</exception> public MapView(EvasObject parent, MapService service) : base(parent) { handle = new Interop.ViewHandle(service.handle, this); service.handle.HasOwnership = false; Log.Info(string.Format("MapView is created")); _service = service; this.Resize(1, 1); // We need to keep Gesture Tap event enabled for object event to work handle.SetGestureEnabled(Interop.ViewGesture.Click, true); SetObjectEventCallback(); }
void OnContent(bool obj) { if (_content != null) { if (_content is Xamarin.Forms.Platform.Tizen.Native.Box contentBox) { contentBox.LayoutUpdated -= OnContentLayoutUpdated; } Control.SetContent(null, true); _content.Unrealize(); _content = null; } if (Element.Content != null) { _content = Xamarin.Forms.Platform.Tizen.Platform.GetOrCreateRenderer(Element.Content).NativeView; if (_content is Xamarin.Forms.Platform.Tizen.Native.Box contentBox) { contentBox.LayoutUpdated += OnContentLayoutUpdated; } Control.SetContent(_content, true); UpdateContentSize(); } }
/// <summary> /// Sets the content at a part of a given container widget. /// </summary> /// <param name="parent">The parent is a given container which will be attached by Layout as a child. It's <see cref="EvasObject"/> type.</param> /// <returns>The new object, otherwise null if it cannot be created</returns> /// <since_tizen> preview </since_tizen> protected override IntPtr CreateHandle(EvasObject parent) { return(Interop.Elementary.elm_layout_add(parent.Handle)); }
internal GenItem(object data, GenItemClass itemClass, EvasObject parent) : base(IntPtr.Zero, parent) { Data = data; ItemClass = itemClass; _tooltipCb = (d, obj, tooltip, item) => { return(TooltipContentDelegate()); }; }
void CreatePopup() { if (_popup != null) { return; } ElmSharp.EvasObject parent = null; if (Control?.Parent != null) { parent = Control.Parent; } if (parent == null) { parent = Xamarin.Forms.Platform.Tizen.Forms.NativeParent; } _popup = new SelectContextPopup(parent); _popup.Dismissed += (s, e) => _behavior.Visibility = false; _popup.Accepted += (s, e) => _behavior?.AcceptCommand?.Execute(_behavior?.AcceptCommandParameter); _popup.Canceled += (s, e) => _behavior?.CancelCommand?.Execute(_behavior?.CancelCommandParameter); string accept = _behavior.AcceptText ?? ""; var acceptItem = _popup.Append(accept); string cancel = _behavior.CancelText; if (!string.IsNullOrEmpty(cancel)) { var cancelItem = _popup.Append(cancel); acceptItem.Style = "select_mode/top"; cancelItem.Style = "select_mode/bottom"; cancelItem.Selected += (s, e) => _popup.Cancel(); } acceptItem.Selected += (s, e) => _popup.Accept(); var option = _behavior.PositionOption; var offset = _behavior.Offset; int x = 0, y = 0; Rect rect; Rect ctxRect = _popup.Geometry; switch (option) { case PositionOption.Absolute: x = Xamarin.Forms.Platform.Tizen.Forms.ConvertToPixel(offset.X); y = Xamarin.Forms.Platform.Tizen.Forms.ConvertToPixel(offset.Y); break; case PositionOption.BottomOfView: rect = Control.Geometry; x = rect.X + rect.Width / 2 + Xamarin.Forms.Platform.Tizen.Forms.ConvertToPixel(offset.X); y = rect.Y + rect.Height + Xamarin.Forms.Platform.Tizen.Forms.ConvertToPixel(offset.Y); break; case PositionOption.CenterOfParent: rect = Xamarin.Forms.Platform.Tizen.Forms.NativeParent.Geometry; x = rect.Width / 2 + Xamarin.Forms.Platform.Tizen.Forms.ConvertToPixel(offset.X); y = rect.Height / 2 - ctxRect.Height / 2 + Xamarin.Forms.Platform.Tizen.Forms.ConvertToPixel(offset.Y); break; case PositionOption.Relative: rect = Xamarin.Forms.Platform.Tizen.Forms.NativeParent.Geometry; x = (int)(rect.Width * offset.X); y = (int)(rect.Height * offset.Y); break; } var window = Xamarin.Forms.Platform.Tizen.Forms.NativeParent.Geometry; if (y + ctxRect.Height > window.Height) { y = window.Height - ctxRect.Height; } _popup.Move(x, y); }
/// <summary> /// Creates and initializes a new instance of the Naviframe class. /// </summary> /// <param name="parent">The parent is a given container which will be attached by Naviframe as a child. It's <see cref="EvasObject"/> type.</param> /// <since_tizen> preview </since_tizen> public Naviframe(EvasObject parent) : base(parent) { _transitionFinished = new SmartEvent(this, this.RealHandle, "transition,finished"); _transitionFinished.On += (s, e) => AnimationFinished?.Invoke(this, EventArgs.Empty); }
/// <summary> /// Inserts a new item into the naviframe after the item. /// The title is "" and the style is null. /// </summary> /// <param name="after">The item for which a new item is inserted after.</param> /// <param name="content">The main content object. The name of the content part is "elm.swallow.content".</param> /// <returns>The created item, or null upon failure.</returns> /// <since_tizen> preview </since_tizen> public NaviItem InsertAfter(NaviItem after, EvasObject content) { return(InsertAfter(after, content, "")); }
/// <summary> /// Inserts a new item into the naviframe before the item. /// The title is "" and the style is null. /// </summary> /// <param name="before">The item for which a new item is inserted before.</param> /// <param name="content">The main content object. The name of the content part is "elm.swallow.content".</param> /// <returns>The created item, or null upon failure.</returns> /// <since_tizen> preview </since_tizen> public NaviItem InsertBefore(NaviItem before, EvasObject content) { return(InsertBefore(before, content, "")); }
internal ContextPopupItem(string text, EvasObject icon) : base(IntPtr.Zero) { Text = text; Icon = icon; }
internal void RemoveChild(EvasObject obj) { _referenceHolder.Remove(obj); }
internal void AddChild(EvasObject obj) { _referenceHolder.Add(obj); }
/// <summary> /// Creates a widget handle. /// </summary> /// <param name="parent">Parent EvasObject.</param> /// <returns>Handle IntPtr.</returns> /// <since_tizen> preview </since_tizen> protected override IntPtr CreateHandle(EvasObject parent) { Interop.Elementary.elm_config_accel_preference_set("3d"); return(Interop.Elementary.elm_win_add(parent != null ? parent.Handle : IntPtr.Zero, Name, (int)Type)); }
/// <summary> /// Adds an object as a resize object of the window. /// </summary> /// <remarks> /// Setting an object as a resize object of the window means that the object child's size and /// position is controlled by the window directly. That is, the object is resized to match the window size /// and should never be moved or resized manually by the developer. In addition, /// resize objects of the window control the minimum size of it as well as whether it can or cannot be resized by the user. /// </remarks> /// <param name="obj"> /// Resize object. /// </param> /// <since_tizen> preview </since_tizen> public void AddResizeObject(EvasObject obj) { Interop.Elementary.elm_win_resize_object_add(Handle, obj); }
/// <summary> /// Deletes the subobj as a resize object of the window object. /// This function removes the object subobj from the resize objects of the window object. /// It will not delete the object itself, which will be left unmanaged and should be deleted by the developer, manually handled, or set as child of some other container. /// </summary> /// <param name="obj">Resize object.</param> /// <since_tizen> preview </since_tizen> public void DeleteResizeObject(EvasObject obj) { Interop.Elementary.elm_win_resize_object_del(Handle, obj); }
internal static void SendEvasObjectRealized(EvasObject obj) { EvasObjectRealized?.Invoke(obj, EventArgs.Empty); }
/// <summary> /// Pushes a new item to the top of the naviframe stack and shows it. /// The title and style are null. /// </summary> /// <param name="content">The main content object. The name of the content part is "elm.swallow.content".</param> /// <returns>The created item, or null upon failure.</returns> /// <since_tizen> preview </since_tizen> public NaviItem Push(EvasObject content) { return(Push(content, null)); }
/// <summary> /// Pushes a new item to the top of the naviframe stack and shows it. /// The style is null. /// </summary> /// <param name="content">The main content object. The name of the content part is "elm.swallow.content".</param> /// <param name="title">The current item title. Null would be default.</param> /// <returns></returns> /// <since_tizen> preview </since_tizen> public NaviItem Push(EvasObject content, string title) { return(Push(content, title, null)); }
/// <summary> /// Prepend child to layout box part. /// Once the object is prepended, it will become child of the layout. /// Its lifetime will be bound to the layout, whenever the layout dies the child will be deleted automatically. /// </summary> /// <param name="part">The part</param> /// <param name="child">The Object to prepend</param> /// <returns>Sucess is true</returns> /// <since_tizen> preview </since_tizen> public bool BoxPrepend(string part, EvasObject child) { AddChild(child); return(Interop.Elementary.elm_layout_box_prepend(RealHandle, part, child.Handle)); }
/// <summary> /// Inserts a new item into the naviframe before the item. /// The style is null. /// </summary> /// <param name="before">The item for which a new item is inserted before.</param> /// <param name="content">The main content object. The name of the content part is "elm.swallow.content".</param> /// <param name="title">The current item title. Null would be default.</param> /// <returns>The created item, or null upon failure.</returns> /// <since_tizen> preview </since_tizen> public NaviItem InsertBefore(NaviItem before, EvasObject content, string title) { return(InsertBefore(before, content, title, null)); }
/// <summary> /// Remove a child of the given part box. /// The object will be removed from the box part and its lifetime will not be handled by the layout anymore. /// </summary> /// <param name="part">The part</param> /// <param name="child">The Object to remove</param> /// <returns>Sucess is true</returns> /// <since_tizen> preview </since_tizen> public bool BoxRemove(string part, EvasObject child) { RemoveChild(child); return(Interop.Elementary.elm_layout_box_remove(RealHandle, part, child.Handle) != null); }
/// <summary> /// Inserts a new item into the naviframe after the item. /// The style is null. /// </summary> /// <param name="after">The item which a new item is inserted after.</param> /// <param name="content">The main content object. The name of the content part is "elm.swallow.content".</param> /// <param name="title">The current item title. Null would be default.</param> /// <returns>The created item, or null upon failure.</returns> /// <since_tizen> preview </since_tizen> public NaviItem InsertAfter(NaviItem after, EvasObject content, string title) { return(InsertAfter(after, content, title, null)); }
/// <summary> /// Insert child to layout box part at a given position. /// Once the object is inserted, it will become child of the layout. /// Its lifetime will be bound to the layout, whenever the layout dies the child will be deleted automatically. /// </summary> /// <param name="part">The part</param> /// <param name="child">The child object to insert into box.</param> /// <param name="position">The numeric position >=0 to insert the child.</param> /// <returns>Sucess is true</returns> /// <since_tizen> preview </since_tizen> public bool BoxInsertAt(string part, EvasObject child, uint position) { AddChild(child); return(Interop.Elementary.elm_layout_box_insert_at(RealHandle, part, child.Handle, position)); }
/// <summary> /// Attach a gesture layer widget to an Evas object (setting the widget's target). /// A gesture layer's target may be any Evas object. This object will be used to listen to mouse and key events. /// </summary> /// <param name="target">The object to attach.</param> /// <since_tizen> preview </since_tizen> public void Attach(EvasObject target) { Interop.Elementary.elm_gesture_layer_attach(Handle, target.Handle); }
/// <summary> /// Insert child to layout box part before a reference object. /// Once the object is inserted, it will become child of the layout. /// Its lifetime will be bound to the layout, whenever the layout dies the child will be deleted automatically. /// </summary> /// <param name="part"></param> /// <param name="child">The child object to insert into box.</param> /// <param name="reference">Another reference object to insert before in box.</param> /// <returns>Sucess is true</returns> /// <since_tizen> preview </since_tizen> public bool BoxInsertBefore(string part, EvasObject child, EvasObject reference) { AddChild(child); return(Interop.Elementary.elm_layout_box_insert_before(RealHandle, part, child.Handle, reference.Handle)); }
/// <summary> /// Stacks immediately below anchor. /// </summary> /// <param name="anchor">The object below which to stack.</param> /// <since_tizen> preview </since_tizen> public void StackBelow(EvasObject anchor) { Interop.Evas.evas_object_stack_below(Handle, anchor); }
/// <summary> /// Creates and initializes a new instance of Layout class. /// </summary> /// <param name="parent">The parent is a given container which will be attached by Layout as a child. It's <see cref="EvasObject"/> type.</param> /// <since_tizen> preview </since_tizen> public Layout(EvasObject parent) : base(parent) { }
/// <summary> /// Sets the layout content. /// </summary> /// <param name="part">The swallow part name in the edje file</param> /// <param name="content">The child that will be added in this layout object.</param> /// <returns>TRUE on success, FALSE otherwise</returns> /// <since_tizen> preview </since_tizen> public override bool SetPartContent(string part, EvasObject content) { return(SetPartContent(part, content, false)); }
/// <summary> /// Stacks immediately above anchor. /// </summary> /// <param name="anchor">The object above which to stack.</param> /// <since_tizen> preview </since_tizen> public void StackAbove(EvasObject anchor) { Interop.Evas.evas_object_stack_above(Handle, anchor); }