using System.IO;
using System.Runtime.InteropServices;
using Tizen.NUI.Binding;
-using Tizen.NUI.Xaml;
namespace Tizen.NUI.BaseComponents
{
/// View is the base class for all views.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public class View : Container, IResourcesProvider
+ public class View : Container
{
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.MARGIN).Get(temp);
return temp;
});
- /// 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 StyleProperty = BindableProperty.Create("Style", typeof(Style), typeof(View), default(Style), propertyChanged: (bindable, oldvalue, newvalue) => ((View)bindable)._mergedStyle.Style = (Style)newvalue);
/// <summary>
/// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
[EditorBrowsable(EditorBrowsableState.Never)]
public static bool layoutingDisabled{get; set;} = true;
- internal readonly MergedStyle _mergedStyle;
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
private LayoutItem _layout; // Exclusive layout assigned to this View.
private int _widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
{
PositionUsesPivotPoint = false;
}
- _mergedStyle = new MergedStyle(GetType(), this);
_onWindowSendEventCallback = SendViewAddedEventToWindow;
this.OnWindowSignal().Connect(_onWindowSendEventCallback);
/// Event when a child is removed.
/// </summary>
/// <since_tizen> 5 </since_tizen>
- public new event EventHandler<ChildRemovedEventArgs> ChildRemoved;
+ public event EventHandler<ChildRemovedEventArgs> ChildRemoved;
/// <summary>
/// Event when a child is added.
/// </summary>
/// <since_tizen> 5 </since_tizen>
- public new event EventHandler<ChildAddedEventArgs> ChildAdded;
+ public event EventHandler<ChildAddedEventArgs> ChildAdded;
/// <summary>
/// An event for the KeyInputFocusGained signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX + 1000
}
- /// 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 bool IsResourcesCreated
- {
- get
- {
- return Application.Current.IsResourcesCreated;
- }
- }
-
- /// 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 ResourceDictionary XamlResources
- {
- get
- {
- return Application.Current.XamlResources;
- }
- set
- {
- Application.Current.XamlResources = value;
- }
- }
-
/// <summary>
/// The StyleName, type string.
/// </summary>
}
}
- internal Style Style
- {
- get
- {
- return (Style)GetValue(StyleProperty);
- }
- set
- {
- SetValue(StyleProperty, value);
- }
- }
-
/// <summary>
/// Child property to specify desired width
/// </summary>
/// <since_tizen> 3 </since_tizen>
public bool HasFocus()
{
- bool ret = Interop.View.View_HasKeyInputFocus(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ bool ret = false;
+ if (swigCPtr.Handle != global::System.IntPtr.Zero)
+ {
+ ret = Interop.View.View_HasKeyInputFocus(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ else
+ {
+ Tizen.Log.Error("NUI", "swigCPtr of view is aleady disposed.");
+ }
return ret;
}
}
}
-
- private Dictionary<string, Transition> transDictionary = new Dictionary<string, Transition>();
-
- /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Transition GetTransition(string transitionName)
- {
- Transition trans = null;
- transDictionary.TryGetValue(transitionName, out trans);
- return trans;
- }
-
- private void LoadTransitions()
- {
- foreach (string str in transitionNames)
- {
- string resourceName = str + ".xaml";
- Transition trans = null;
-
- string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
-
- string likelyResourcePath = resource + "animation/" + resourceName;
-
- if (File.Exists(likelyResourcePath))
- {
- trans = Extensions.LoadObject<Transition>(likelyResourcePath);
- }
- if (trans)
- {
- transDictionary.Add(trans.Name, trans);
- }
- }
- }
-
- /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string[] TransitionNames
- {
- get
- {
- return transitionNames;
- }
- set
- {
- transitionNames = value;
- LoadTransitions();
- }
- }
- private string[] transitionNames;
-
internal class BackgroundResourceLoadedEventArgs : EventArgs
{
private ResourceLoadingStatusType status = ResourceLoadingStatusType.Invalid;