/*
* Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;
using System.ComponentModel;
using Tizen.NUI.Binding;
namespace Tizen.NUI.BaseComponents
{
///
/// CustomView provides some common functionality required by all views.
///
/// 3
public class CustomView : ViewWrapper
{
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty FocusNavigationSupportProperty = BindableProperty.Create(nameof(FocusNavigationSupport), typeof(bool), typeof(CustomView), false, propertyChanged: (bindable, oldValue, newValue) =>
{
var customView = (CustomView)bindable;
if (newValue != null)
{
customView.SetKeyboardNavigationSupport((bool)newValue);
}
},
defaultValueCreator: (bindable) =>
{
var customView = (CustomView)bindable;
return customView.IsKeyboardNavigationSupported();
});
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty FocusGroupProperty = BindableProperty.Create(nameof(FocusGroup), typeof(bool), typeof(CustomView), false, propertyChanged: (bindable, oldValue, newValue) =>
{
var customView = (CustomView)bindable;
if (newValue != null)
{
customView.SetAsKeyboardFocusGroup((bool)newValue);
}
},
defaultValueCreator: (bindable) =>
{
var customView = (CustomView)bindable;
return customView.IsKeyboardFocusGroup();
});
///
/// Create an instance of customView.
///
/// typename
/// CustomView Behaviour
/// CustomView ViewStyle
[EditorBrowsable(EditorBrowsableState.Never)]
public CustomView(string typeName, CustomViewBehaviour behaviour, ViewStyle viewStyle) : base(typeName, new ViewWrapperImpl(behaviour), viewStyle)
{
Initialize();
}
///
/// Create an instance of customView.
///
/// typename
/// CustomView Behaviour
/// 3
public CustomView(string typeName, CustomViewBehaviour behaviour) : base(typeName, new ViewWrapperImpl(behaviour))
{
Initialize();
}
///
/// Sets whether this control supports two dimensional keyboard navigation
/// (i.e., whether it knows how to handle the keyboard focus movement between its child views).
/// The control doesn't support it by default.
///
/// 3
public bool FocusNavigationSupport
{
get
{
return (bool)GetValue(FocusNavigationSupportProperty);
}
set
{
SetValue(FocusNavigationSupportProperty, value);
}
}
///
/// Sets or gets whether this control is a focus group for keyboard navigation.
///
/// True if this control is set as a focus group for keyboard navigation.
/// 3
public bool FocusGroup
{
get
{
return (bool)GetValue(FocusGroupProperty);
}
set
{
SetValue(FocusGroupProperty, value);
}
}
///
/// Sets the background with a property map.
///
/// The background property map.
/// 3
public void SetBackground(Tizen.NUI.PropertyMap map)
{
viewWrapperImpl.SetBackground(map);
}
///
/// Allows deriving classes to enable any of the gesture detectors that are available.
/// Gesture detection can be enabled one at a time or in a bitwise format.
///
/// The gesture type(s) to enable.
/// 3
public void EnableGestureDetection(Gesture.GestureType type)
{
viewWrapperImpl.EnableGestureDetection(type);
}
///
/// This method is called after the control has been initialized.
/// Derived classes should do any second phase initialization by overriding this method.
///
/// 3
public virtual void OnInitialize()
{
}
///
/// Called after the view has been connected to the stage.
/// When a view is connected, it will be directly or indirectly parented to the root view.
/// The root view is provided automatically by Tizen.NUI.Stage, and is always considered to be connected.
/// When the parent of a set of views is connected to the stage, then all of the children will receive this callback.
///
/// The depth in the hierarchy for the view.
/// 3
[Obsolete("Deprecated since API level 8 and will be removed in API level 10. Please use OnSceneConnection instead!")]
public virtual void OnStageConnection(int depth)
{
}
///
/// Called after the view has been disconnected from the stage.
/// If a view is disconnected, it either has no parent, or is parented to a disconnected view.
/// When the parent of a set of views is disconnected to the stage, then all of the children will receive this callback, starting with the leaf views.
///
/// 3
[Obsolete("Deprecated since API level 8 and will be removed in API level 10. Please use OnSceneDisconnection instead!")]
public virtual void OnStageDisconnection()
{
}
///
/// Called after the view has been connected to the scene.
/// When a view is connected, it will be directly or indirectly parented to the root view.
/// The root view is provided automatically by Tizen.NUI.Window, and is always considered to be connected.
/// When the parent of a set of views is connected to the scene, then all of the children will receive this callback.
///
/// The depth in the hierarchy for the view.
/// 8
public virtual void OnSceneConnection(int depth)
{
}
///
/// Called after the view has been disconnected from the scene.
/// If a view is disconnected, it either has no parent, or is parented to a disconnected view.
/// When the parent of a set of views is disconnected to the scene, then all of the children will receive this callback, starting with the leaf views.
///
/// 8
public virtual void OnSceneDisconnection()
{
}
///
/// Called after a child has been added to the owning view.
///
/// The child which has been added.
/// 3
public virtual void OnChildAdd(View view)
{
}
///
/// Called after the owning view has attempted to remove a child( regardless of whether it succeeded or not ).
///
/// The child being removed.
/// 3
public virtual void OnChildRemove(View view)
{
}
///
/// Called when the owning view property is set.
///
/// The property index that was set.
/// The value to set.
/// 3
public virtual void OnPropertySet(int index, Tizen.NUI.PropertyValue propertyValue)
{
}
///
/// Called when the owning view's size is set, for example, using View.SetSize().
///
/// The target size.
/// 3
public virtual void OnSizeSet(Vector3 targetSize)
{
}
///
/// Called when the owning view's size is animated, for example, using Animation::AnimateTo( Property ( view, View::Property::SIZE ), ... ).
///
/// The object which is animating the owning view.
/// The target size.
/// 3
public virtual void OnSizeAnimation(Animation animation, Vector3 targetSize)
{
}
///
/// Called after a touch event is received by the owning view.
/// CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
///
/// The touch event.
/// True if the event should be consumed.
/// 3
public virtual bool OnTouch(Touch touch)
{
return false; // Do not consume
}
///
/// Called after a hover event is received by the owning view.
/// CustomViewBehaviour.REQUIRES_HOVER_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
///
/// The hover event.
/// True if the hover event should be consumed.
/// 3
public virtual bool OnHover(Hover hover)
{
return false; // Do not consume
}
///
/// Called after a key event is received by the view that has had its focus set.
///
/// The key event.
/// True if the key event should be consumed.
/// 3
public virtual bool OnKey(Key key)
{
return false; // Do not consume
}
///
/// Called after a wheel event is received by the owning view.
/// CustomViewBehaviour.REQUIRES_WHEEL_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
///
/// The wheel event.
/// True if the wheel event should be consumed.
/// 3
public virtual bool OnWheel(Wheel wheel)
{
return false; // Do not consume
}
///
/// Called after the size negotiation has been finished for this control.
/// The control is expected to assign this given size to itself or its children.
/// Should be overridden by derived classes if they need to layout views differently after certain operations like add or remove views, resize, or after changing specific properties.
/// As this function is called from inside the size negotiation algorithm, you cannot call RequestRelayout (the call would just be ignored).
///
/// The allocated size.
/// The control should add views to this container that it is not able to allocate a size for.
/// 3
public virtual void OnRelayout(Vector2 size, RelayoutContainer container)
{
}
///
/// Notification for deriving classes.
///
/// The policy being set.
/// The policy is being set for.
/// 3
public virtual void OnSetResizePolicy(ResizePolicyType policy, DimensionType dimension)
{
}
///
/// Returns the natural size of the view.
///
/// The view's natural size
/// 3
public new virtual Size2D GetNaturalSize()
{
return sizeSetExplicitly; // Returns the size set explicitly on View unless Overridden.
}
///
/// Calculates the size for a child.
///
/// The child view to calculate the size for.
/// The dimension to calculate the size, for example, the width or the height.
/// Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found.
/// 3
public virtual float CalculateChildSize(View child, DimensionType dimension)
{
return viewWrapperImpl.CalculateChildSizeBase(child, dimension);
}
///
/// This method is called during size negotiation when a height is required for a given width.
/// Derived classes should override this if they wish to customize the height returned.
///
/// Width to use
/// The height based on the width
/// 3
public new virtual float GetHeightForWidth(float width)
{
return viewWrapperImpl.GetHeightForWidthBase(width);
}
///
/// This method is called during size negotiation when a width is required for a given height.
/// Derived classes should override this if they wish to customize the width returned.
///
/// Height to use
/// The width based on the width
/// 3
public new virtual float GetWidthForHeight(float height)
{
return viewWrapperImpl.GetWidthForHeightBase(height);
}
///
/// Determines if this view is dependent on it's children for relayout.
///
/// The dimension(s) to check for.
/// Return if the view is dependent on it's children.
/// 3
public virtual bool RelayoutDependentOnChildren(DimensionType dimension)
{
return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension);
}
///
/// Determines if this view is dependent on it's children for relayout from the base class.
///
/// Return true if the view is dependent on it's children.
/// 3
public virtual bool RelayoutDependentOnChildren()
{
return viewWrapperImpl.RelayoutDependentOnChildrenBase();
}
///
/// The virtual method to notify deriving classes that relayout dependencies have been
/// met and the size for this object is about to be calculated for the given dimension.
///
/// The dimension that is about to be calculated.
/// 3
public virtual void OnCalculateRelayoutSize(DimensionType dimension)
{
}
///
/// The virtual method to notify deriving classes that the size for a dimension has just been negotiated.
///
/// The new size for the given dimension.
/// The dimension that was just negotiated.
/// 3
public virtual void OnLayoutNegotiated(float size, DimensionType dimension)
{
}
///
/// This method should be overridden by deriving classes requiring notifications when the style changes.
///
/// The StyleManager object.
/// Information denoting what has changed.
/// 3
public virtual void OnStyleChange(StyleManager styleManager, StyleChangeType change)
{
}
///
/// Called when the control gain key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is gained.
///
/// 3
public virtual void OnFocusGained()
{
}
///
/// Called when the control loses key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is lost.
///
/// 3
public virtual void OnFocusLost()
{
}
///
/// Gets the next keyboard focusable view in this control towards the given direction.
/// A control needs to override this function in order to support two dimensional keyboard navigation.
///
/// The current focused view.
/// The direction to move the focus towards.
/// Whether the focus movement should be looped within the control.
/// The next keyboard focusable view in this control or an empty handle if no view can be focused.
/// 3
public virtual View GetNextFocusableView(View currentFocusedView, View.FocusDirection direction, bool loopEnabled)
{
return new View();
}
///
/// Informs this control that its chosen focusable view will be focused.
/// This allows the application to preform any actions it wishes before the focus is actually moved to the chosen view.
///
/// The commited focused view.
/// 3
public virtual void OnFocusChangeCommitted(View commitedFocusableView)
{
}
///
/// This method is called when the control has enter pressed on it.
/// Derived classes should override this to perform custom actions.
///
/// True if this control supported this action.
/// 3
public virtual bool OnKeyboardEnter()
{
return false;
}
///
/// Called whenever a pan gesture is detected on this control.
/// This should be overridden by deriving classes when pan detection is enabled.
/// There is no default behavior with panning.
/// Pan detection should be enabled via EnableGestureDetection().
///
/// The pan gesture.
/// 3
public virtual void OnPan(PanGesture pan)
{
}
///
/// Called whenever a tap gesture is detected on this control.
/// This should be overridden by deriving classes when tap detection is enabled.
/// There is no default behavior with a tap.
/// Tap detection should be enabled via EnableGestureDetection().
///
/// The tap gesture.
/// 3
public virtual void OnTap(TapGesture tap)
{
}
///
/// This method is called when the control accessibility is activated.
/// Derived classes should override this to perform custom accessibility activation.
///
/// Hidden-API
/// True if this control can perform accessibility activation.
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual bool OnAccessibilityActivated()
{
return false;
}
///
/// This method should be overridden by deriving classes when they wish to respond the accessibility.
///
/// The pan gesture.
/// True if the pan gesture has been consumed by this control.
internal virtual bool OnAccessibilityPan(PanGesture gestures)
{
return false;
}
///
/// This method should be overridden by deriving classes when they wish to respond the accessibility up and down action (i.e., value change of slider control).
///
/// Whether the value should be increased or decreased.
/// True if the value changed action has been consumed by this control.
internal virtual bool OnAccessibilityValueChange(bool isIncrease)
{
return false;
}
///
/// This method should be overridden by deriving classes when they wish to respond the accessibility zoom action.
///
/// True if the zoom action has been consumed by this control.
internal virtual bool OnAccessibilityZoom()
{
return false;
}
///
/// Allows deriving classes to disable any of the gesture detectors.
/// Like EnableGestureDetection, this can also be called using bitwise or one at a time.
///
/// The gesture type(s) to disable.
internal void DisableGestureDetection(Gesture.GestureType type)
{
viewWrapperImpl.DisableGestureDetection(type);
}
internal void SetKeyboardNavigationSupport(bool isSupported)
{
viewWrapperImpl.SetKeyboardNavigationSupport(isSupported);
}
///
/// Gets whether this control supports two-dimensional keyboard navigation.
///
/// True if this control supports two-dimensional keyboard navigation.
internal bool IsKeyboardNavigationSupported()
{
return viewWrapperImpl.IsKeyboardNavigationSupported();
}
///
/// Sets whether this control is a focus group for keyboard navigation.
/// (i.e., the scope of keyboard focus movement can be limitied to its child views). The control is not a focus group by default.
///
/// Whether this control is set as a focus group for keyboard navigation.
internal void SetAsKeyboardFocusGroup(bool isFocusGroup)
{
viewWrapperImpl.SetAsFocusGroup(isFocusGroup);
}
///
/// Gets whether this control is a focus group for keyboard navigation.
///
internal bool IsKeyboardFocusGroup()
{
return viewWrapperImpl.IsFocusGroup();
}
///
/// Called whenever a pinch gesture is detected on this control.
/// This can be overridden by deriving classes when pinch detection is enabled. The default behavior is to scale the control by the pinch scale.
/// If overridden, then the default behavior will not occur.
/// Pinch detection should be enabled via EnableGestureDetection().
///
/// The pinch tap gesture.
internal virtual void OnPinch(PinchGesture pinch)
{
}
///
/// Called whenever a long press gesture is detected on this control.
/// This should be overridden by deriving classes when long press detection is enabled.
/// There is no default behavior associated with a long press.
/// Long press detection should be enabled via EnableGestureDetection().
///
/// The long press gesture.
internal virtual void OnLongPress(LongPressGesture longPress)
{
}
///
/// Requests a relayout, which means performing a size negotiation on this view, its parent, and children (and potentially whole scene).
/// This method can also be called from a derived class every time it needs a different size.
/// At the end of event processing, the relayout process starts and all controls which requested relayout will have their sizes (re)negotiated.
/// It can be called multiple times; the size negotiation is still only performed once, i.e., there is no need to keep track of this in the calling side.
///
/// 3
protected void RelayoutRequest()
{
viewWrapperImpl.RelayoutRequest();
}
///
/// Provides the view implementation of GetHeightForWidth.
///
/// The width to use.
/// The height based on the width.
/// 3
protected float GetHeightForWidthBase(float width)
{
return viewWrapperImpl.GetHeightForWidthBase(width);
}
///
/// Provides the view implementation of GetWidthForHeight.
///
/// The height to use.
/// The width based on the height.
/// 3
protected float GetWidthForHeightBase(float height)
{
return viewWrapperImpl.GetWidthForHeightBase(height);
}
///
/// Calculates the size for a child using the base view object.
///
/// The child view to calculate the size for.
/// The dimension to calculate the size, for example, the width or the height.
/// Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found.
/// 3
protected float CalculateChildSizeBase(View child, DimensionType dimension)
{
return viewWrapperImpl.CalculateChildSizeBase(child, dimension);
}
///
/// Determines if this view is dependent on it's children for relayout from the base class.
///
/// The dimension(s) to check for.
/// Return if the view is dependent on it's children.
/// 3
protected bool RelayoutDependentOnChildrenBase(DimensionType dimension)
{
return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension);
}
///
/// Determines if this view is dependent on it's children for relayout from the base class.
///
/// Return if the view is dependent on it's children.
/// 3
protected bool RelayoutDependentOnChildrenBase()
{
return viewWrapperImpl.RelayoutDependentOnChildrenBase();
}
///
/// Registers a visual by property index, linking a view to visual when required.
/// In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.
/// No parenting is done during registration, this should be done by a derived class.
///
/// The property index of the visual used to reference visual.
/// The visual to register.
/// 3
protected void RegisterVisual(int index, VisualBase visual)
{
viewWrapperImpl.RegisterVisual(index, visual);
}
///
/// Registers a visual by the property index, linking a view to visual when required.
/// In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.
/// If enabled is false, then the visual is not set on the stage until enabled by the derived class.
///
/// The property index of the visual used to reference visual.
/// The visual to register.
/// False if derived class wants to control when the visual is set on the stage.
/// 3
protected void RegisterVisual(int index, VisualBase visual, bool enabled)
{
viewWrapperImpl.RegisterVisual(index, visual, enabled);
}
///
/// Erases the entry matching the given index from the list of registered visuals.
///
/// The property index of the visual used to reference visual.
/// 3
protected void UnregisterVisual(int index)
{
viewWrapperImpl.UnregisterVisual(index);
}
///
/// Retrieves the visual associated with the given property index.
/// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.
///
/// The property index of the visual used to reference visual.
/// The registered visual if exists, otherwise an empty handle.
/// 3
protected VisualBase GetVisual(int index)
{
return viewWrapperImpl.GetVisual(index);
}
///
/// Sets the given visual to be displayed or not when parent staged.
/// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.
///
/// The property index of the visual, used to reference visual.
/// Flag set to enabled or disabled.
/// 3
protected void EnableVisual(int index, bool enable)
{
viewWrapperImpl.EnableVisual(index, enable);
}
///
/// Queries if the given visual is to be displayed when parent staged.
/// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.
///
/// The property index of the visual.
/// Whether visual is enabled or not.
/// 3
protected bool IsVisualEnabled(int index)
{
return viewWrapperImpl.IsVisualEnabled(index);
}
///
/// Creates a transition effect on the control.
///
/// The transition data describing the effect to create.
/// A handle to an animation defined with the given effect, or an empty handle if no properties match.
/// 3
protected Animation CreateTransition(TransitionData transitionData)
{
return viewWrapperImpl.CreateTransition(transitionData);
}
///
/// Emits the KeyInputFocusGained signal if true, else, emits the KeyInputFocusLost signal.
/// Should be called last by the control after it acts on the input focus change.
///
/// True if gained, false if lost.
/// 3
protected void EmitFocusSignal(bool focusGained)
{
viewWrapperImpl.EmitFocusSignal(focusGained);
}
private void Initialize()
{
// Registering CustomView virtual functions to viewWrapperImpl delegates.
viewWrapperImpl.OnSceneConnection = new ViewWrapperImpl.OnSceneConnectionDelegate(OnSceneConnection);
viewWrapperImpl.OnSceneDisconnection = new ViewWrapperImpl.OnSceneDisconnectionDelegate(OnSceneDisconnection);
viewWrapperImpl.OnStageConnection = new ViewWrapperImpl.OnSceneConnectionDelegate(OnStageConnection);
viewWrapperImpl.OnStageDisconnection = new ViewWrapperImpl.OnSceneDisconnectionDelegate(OnStageDisconnection);
viewWrapperImpl.OnChildAdd = new ViewWrapperImpl.OnChildAddDelegate(OnChildAdd);
viewWrapperImpl.OnChildRemove = new ViewWrapperImpl.OnChildRemoveDelegate(OnChildRemove);
viewWrapperImpl.OnPropertySet = new ViewWrapperImpl.OnPropertySetDelegate(OnPropertySet);
viewWrapperImpl.OnSizeSet = new ViewWrapperImpl.OnSizeSetDelegate(OnSizeSet);
viewWrapperImpl.OnSizeAnimation = new ViewWrapperImpl.OnSizeAnimationDelegate(OnSizeAnimation);
viewWrapperImpl.OnTouch = new ViewWrapperImpl.OnTouchDelegate(OnTouch);
viewWrapperImpl.OnHover = new ViewWrapperImpl.OnHoverDelegate(OnHover);
viewWrapperImpl.OnKey = new ViewWrapperImpl.OnKeyDelegate(OnKey);
viewWrapperImpl.OnWheel = new ViewWrapperImpl.OnWheelDelegate(OnWheel);
viewWrapperImpl.OnRelayout = new ViewWrapperImpl.OnRelayoutDelegate(OnRelayout);
viewWrapperImpl.OnSetResizePolicy = new ViewWrapperImpl.OnSetResizePolicyDelegate(OnSetResizePolicy);
viewWrapperImpl.GetNaturalSize = new ViewWrapperImpl.GetNaturalSizeDelegate(GetNaturalSize);
viewWrapperImpl.CalculateChildSize = new ViewWrapperImpl.CalculateChildSizeDelegate(CalculateChildSize);
viewWrapperImpl.GetHeightForWidth = new ViewWrapperImpl.GetHeightForWidthDelegate(GetHeightForWidth);
viewWrapperImpl.GetWidthForHeight = new ViewWrapperImpl.GetWidthForHeightDelegate(GetWidthForHeight);
viewWrapperImpl.RelayoutDependentOnChildrenDimension = new ViewWrapperImpl.RelayoutDependentOnChildrenDimensionDelegate(RelayoutDependentOnChildren);
viewWrapperImpl.RelayoutDependentOnChildren = new ViewWrapperImpl.RelayoutDependentOnChildrenDelegate(RelayoutDependentOnChildren);
viewWrapperImpl.OnCalculateRelayoutSize = new ViewWrapperImpl.OnCalculateRelayoutSizeDelegate(OnCalculateRelayoutSize);
viewWrapperImpl.OnLayoutNegotiated = new ViewWrapperImpl.OnLayoutNegotiatedDelegate(OnLayoutNegotiated);
viewWrapperImpl.OnStyleChange = new ViewWrapperImpl.OnStyleChangeDelegate(OnStyleChange);
viewWrapperImpl.OnAccessibilityActivated = new ViewWrapperImpl.OnAccessibilityActivatedDelegate(OnAccessibilityActivated);
viewWrapperImpl.OnAccessibilityPan = new ViewWrapperImpl.OnAccessibilityPanDelegate(OnAccessibilityPan);
viewWrapperImpl.OnAccessibilityValueChange = new ViewWrapperImpl.OnAccessibilityValueChangeDelegate(OnAccessibilityValueChange);
viewWrapperImpl.OnAccessibilityZoom = new ViewWrapperImpl.OnAccessibilityZoomDelegate(OnAccessibilityZoom);
viewWrapperImpl.OnFocusGained = new ViewWrapperImpl.OnFocusGainedDelegate(OnFocusGained);
viewWrapperImpl.OnFocusLost = new ViewWrapperImpl.OnFocusLostDelegate(OnFocusLost);
viewWrapperImpl.GetNextFocusableView = new ViewWrapperImpl.GetNextFocusableViewDelegate(GetNextFocusableView);
viewWrapperImpl.OnFocusChangeCommitted = new ViewWrapperImpl.OnFocusChangeCommittedDelegate(OnFocusChangeCommitted);
viewWrapperImpl.OnKeyboardEnter = new ViewWrapperImpl.OnKeyboardEnterDelegate(OnKeyboardEnter);
viewWrapperImpl.OnPinch = new ViewWrapperImpl.OnPinchDelegate(OnPinch);
viewWrapperImpl.OnPan = new ViewWrapperImpl.OnPanDelegate(OnPan);
viewWrapperImpl.OnTap = new ViewWrapperImpl.OnTapDelegate(OnTap);
viewWrapperImpl.OnLongPress = new ViewWrapperImpl.OnLongPressDelegate(OnLongPress);
// Make sure CustomView is initialized.
OnInitialize();
// Set the StyleName the name of the View
// We have to do this because the StyleManager on Native side can't workout it out
// This will also ensure that the style of views/visuals initialized above are applied by the style manager.
SetStyleName(this.GetType().Name);
}
}
}