}
}
- internal class Application : BaseHandle, IResourcesProvider, IApplicationController, IElementConfiguration<Application>
+ internal class Application : BaseHandle, IResourcesProvider, IElementConfiguration<Application>
{
static Application s_current;
- Task<IDictionary<string, object>> _propertiesTask;
- readonly Lazy<PlatformConfigurationRegistry<Application>> _platformConfigurationRegistry;
-
- IAppIndexingProvider _appIndexProvider;
ReadOnlyCollection<Element> _logicalChildren;
- Page _mainPage;
-
static SemaphoreSlim SaveSemaphore = new SemaphoreSlim(1, 1);
- public IAppLinks AppLinks
- {
- get
- {
- if (_appIndexProvider == null)
- throw new ArgumentException("No IAppIndexingProvider was provided");
- if (_appIndexProvider.AppLinks == null)
- throw new ArgumentException("No AppLinks implementation was found, if in Android make sure you installed the Xamarin.Forms.AppLinks");
- return _appIndexProvider.AppLinks;
- }
- }
-
[EditorBrowsable(EditorBrowsableState.Never)]
public static void SetCurrentApplication(Application value) => Current = value;
}
}
- public Page MainPage
- {
- get { return _mainPage; }
- set
- {
- if (value == null)
- throw new ArgumentNullException("value");
-
- if (_mainPage == value)
- return;
-
- OnPropertyChanging();
- if (_mainPage != null)
- {
- InternalChildren.Remove(_mainPage);
- _mainPage.Parent = null;
- }
-
- _mainPage = value;
-
- if (_mainPage != null)
- {
- _mainPage.Parent = this;
- _mainPage.NavigationProxy.Inner = NavigationProxy;
- InternalChildren.Add(_mainPage);
- }
- OnPropertyChanged();
- }
- }
-
- public IDictionary<string, object> Properties
- {
- get
- {
- if (_propertiesTask == null)
- {
- _propertiesTask = GetPropertiesAsync();
- }
-
- return _propertiesTask.Result;
- }
- }
-
internal override ReadOnlyCollection<Element> LogicalChildrenInternal
{
get { return _logicalChildren ?? (_logicalChildren = new ReadOnlyCollection<Element>(InternalChildren)); }
}
- [EditorBrowsable(EditorBrowsableState.Never)]
- public new NavigationProxy NavigationProxy { get; }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int PanGestureId { get; set; }
-
internal IResourceDictionary SystemResources { get; }
ObservableCollection<Element> InternalChildren { get; } = new ObservableCollection<Element>();
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void SetAppIndexingProvider(IAppIndexingProvider provider)
- {
- _appIndexProvider = provider;
- }
-
ResourceDictionary _resources;
public bool IsResourcesCreated => _resources != null;
}
}
- public event EventHandler<ModalPoppedEventArgs> ModalPopped;
-
- public event EventHandler<ModalPoppingEventArgs> ModalPopping;
-
- public event EventHandler<ModalPushedEventArgs> ModalPushed;
-
- public event EventHandler<ModalPushingEventArgs> ModalPushing;
-
- public event EventHandler<Page> PageAppearing;
-
- public event EventHandler<Page> PageDisappearing;
-
-
- async void SaveProperties()
- {
- try
- {
- await SetPropertiesAsync();
- }
- catch (Exception exc)
- {
- Console.WriteLine(nameof(Application), $"Exception while saving Application Properties: {exc}");
- }
- }
-
- public async Task SavePropertiesAsync()
- {
- if (Device.IsInvokeRequired)
- {
- Device.BeginInvokeOnMainThread(SaveProperties);
- }
- else
- {
- await SetPropertiesAsync();
- }
- }
-
- // Don't use this unless there really is no better option
- internal void SavePropertiesAsFireAndForget()
- {
- if (Device.IsInvokeRequired)
- {
- Device.BeginInvokeOnMainThread(SaveProperties);
- }
- else
- {
- SaveProperties();
- }
- }
-
- public IPlatformElementConfiguration<T, Application> On<T>() where T : IConfigPlatform
- {
- return _platformConfigurationRegistry.Value.On<T>();
- }
-
- protected virtual void OnAppLinkRequestReceived(Uri uri)
- {
- }
-
protected override void OnParentSet()
{
throw new InvalidOperationException("Setting a Parent on Application is invalid.");
}
- protected virtual void OnResume()
- {
- }
-
- protected virtual void OnSleep()
- {
- }
-
- protected virtual void OnStart()
- {
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static void ClearCurrent()
- {
- s_current = null;
- }
-
[EditorBrowsable(EditorBrowsableState.Never)]
public static bool IsApplicationOrNull(Element element)
{
OnResourcesChanged(changedResources);
}
- internal event EventHandler PopCanceled;
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void SendOnAppLinkRequestReceived(Uri uri)
- {
- OnAppLinkRequestReceived(uri);
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void SendResume()
- {
- s_current = this;
- OnResume();
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void SendSleep()
- {
- OnSleep();
- SavePropertiesAsFireAndForget();
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Task SendSleepAsync()
- {
- OnSleep();
- return SavePropertiesAsync();
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void SendStart()
- {
- OnStart();
- }
-
- async Task<IDictionary<string, object>> GetPropertiesAsync()
- {
- var deserializer = DependencyService.Get<IDeserializer>();
- if (deserializer == null)
- {
- Console.WriteLine("Startup", "No IDeserialzier was found registered");
- return new Dictionary<string, object>(4);
- }
-
- IDictionary<string, object> properties = await deserializer.DeserializePropertiesAsync().ConfigureAwait(false);
- if (properties == null)
- properties = new Dictionary<string, object>(4);
-
- return properties;
- }
-
- internal void OnPageAppearing(Page page)
- => PageAppearing?.Invoke(this, page);
-
- internal void OnPageDisappearing(Page page)
- => PageDisappearing?.Invoke(this, page);
-
- void OnModalPopped(Page modalPage)
- => ModalPopped?.Invoke(this, new ModalPoppedEventArgs(modalPage));
-
- bool OnModalPopping(Page modalPage)
- {
- var args = new ModalPoppingEventArgs(modalPage);
- ModalPopping?.Invoke(this, args);
- return args.Cancel;
- }
-
- void OnModalPushed(Page modalPage)
- => ModalPushed?.Invoke(this, new ModalPushedEventArgs(modalPage));
-
- void OnModalPushing(Page modalPage)
- => ModalPushing?.Invoke(this, new ModalPushingEventArgs(modalPage));
-
- void OnPopCanceled()
- => PopCanceled?.Invoke(this, EventArgs.Empty);
-
- async Task SetPropertiesAsync()
- {
- await SaveSemaphore.WaitAsync();
- try
- {
- await DependencyService.Get<IDeserializer>()?.SerializePropertiesAsync(Properties);
- }
- finally
- {
- SaveSemaphore.Release();
- }
-
- }
-
- class NavigationImpl : NavigationProxy
- {
- readonly Application _owner;
-
- public NavigationImpl(Application owner)
- {
- _owner = owner;
- }
-
- protected override async Task<Page> OnPopModal(bool animated)
- {
- Page modal = ModalStack[ModalStack.Count - 1];
- if (_owner.OnModalPopping(modal))
- {
- _owner.OnPopCanceled();
- return null;
- }
- Page result = await base.OnPopModal(animated);
- result.Parent = null;
- _owner.OnModalPopped(result);
- return result;
- }
-
- protected override async Task OnPushModal(Page modal, bool animated)
- {
- _owner.OnModalPushing(modal);
-
- modal.Parent = _owner;
-
- if (modal.NavigationProxy.ModalStack.Count == 0)
- {
- modal.NavigationProxy.Inner = this;
- await base.OnPushModal(modal, animated);
- }
- else
- {
- await base.OnPushModal(modal, animated);
- modal.NavigationProxy.Inner = this;
- }
-
- _owner.OnModalPushed(modal);
- }
- }
-
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
internal Application(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Application_SWIGUpcast(cPtr), cMemoryOwn)
{
- NavigationProxy = new NavigationImpl(this);
SetCurrentApplication(this);
- _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Application>>(() => new PlatformConfigurationRegistry<Application>(this));
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
- SendResume();
+ s_current = this;
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Application obj)
{
Application ret = new Application(Interop.Application.Application_New__SWIG_3(argc, stylesheet, (int)windowMode), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- ret.SendResume();
+ s_current = ret;
return ret;
}
var elementType = element.GetType();
var binding = value.ConvertTo(typeof(BindingBase),pinfoRetriever:null,serviceProvider:null) as BindingBase;
var bindable = element as BindableObject;
- var nativeBindingService = DependencyService.Get<INativeBindingService>();
if (binding == null)
return false;
return true;
}
- if (nativeBindingService != null && property != null && nativeBindingService.TrySetBinding(element, property, binding))
- return true;
-
- if (nativeBindingService != null && nativeBindingService.TrySetBinding(element, localName, binding))
- return true;
-
if (property != null)
exception = new XamlParseException($"{elementType.Name} is not a BindableObject or does not support native bindings", lineInfo);
var elementType = element.GetType();
var bindable = element as BindableObject;
- var nativeBindingService = DependencyService.Get<INativeBindingService>();
if (property == null)
return false;
return TryAddValue(bindable, property, value, serviceProvider);
}
- if (nativeBindingService != null && nativeBindingService.TrySetValue(element, property, convertedValue))
- return true;
-
exception = new XamlParseException($"{elementType.Name} is not a BindableObject or does not support setting native BindableProperties", lineInfo);
return false;
}
if (!node.Properties.ContainsKey(XmlName.xFactoryMethod))
{
//non-default ctor
- object ret = Activator.CreateInstance(nodeType, BindingFlags.CreateInstance | BindingFlags.Public | BindingFlags.Instance | BindingFlags.OptionalParamBinding, null, arguments, CultureInfo.CurrentCulture); ;
+ object ret = Activator.CreateInstance(nodeType, BindingFlags.CreateInstance | BindingFlags.Public | BindingFlags.Instance | BindingFlags.OptionalParamBinding, null, arguments, CultureInfo.CurrentCulture);
if (ret is Element)
{
if (null != Application.Current)
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Xaml
-{
- internal interface IMarkupExtension<out T> : IMarkupExtension
- {
- new T ProvideValue(IServiceProvider serviceProvider);
- }
-
- internal interface IMarkupExtension
- {
- object ProvideValue(IServiceProvider serviceProvider);
- }
-
- [AttributeUsage(AttributeTargets.Class, Inherited = false)]
- internal sealed class AcceptEmptyServiceProviderAttribute : Attribute
- {
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Xaml.Internals
-{
- internal interface INativeValueConverterService
- {
- bool ConvertTo(object value, Type toType, out object nativeValue);
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace Tizen.NUI.Xaml
-{
- internal interface IProvideValueTarget
- {
- object TargetObject { get; }
- object TargetProperty { get; }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace Tizen.NUI.Xaml
-{
- internal interface IReferenceProvider
- {
- object FindByName(string name);
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace Tizen.NUI.Xaml
-{
- internal interface IRootObjectProvider
- {
- object RootObject { get; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Xaml
-{
- internal interface IValueProvider
- {
- object ProvideValue(IServiceProvider serviceProvider);
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Xaml
-{
- internal interface IXamlTypeResolver
- {
- Type Resolve(string qualifiedTypeName, IServiceProvider serviceProvider = null);
- bool TryResolve(string qualifiedTypeName, out Type type);
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.Xml;
-
-namespace Tizen.NUI.Xaml
-{
- internal interface IXmlLineInfoProvider
- {
- IXmlLineInfo XmlLineInfo { get; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using Tizen.NUI.Binding.Internals;
-using Tizen.NUI.Binding;
-
-namespace Tizen.NUI.Xaml
-{
- [ContentProperty("Path")]
- [AcceptEmptyServiceProvider]
- internal sealed class BindingExtension : IMarkupExtension<BindingBase>
- {
- public string Path { get; set; } = Binding.Binding.SelfPath;
- public BindingMode Mode { get; set; } = BindingMode.Default;
-
- public IValueConverter Converter { get; set; }
-
- public object ConverterParameter { get; set; }
-
- public string StringFormat { get; set; }
-
- public object Source { get; set; }
-
- public string UpdateSourceEventName { get; set; }
-
- public object TargetNullValue { get; set; }
-
- public object FallbackValue { get; set; }
-
- public TypedBindingBase TypedBinding { get; set; }
-
- BindingBase IMarkupExtension<BindingBase>.ProvideValue(IServiceProvider serviceProvider)
- {
- if (TypedBinding == null)
- return new Tizen.NUI.Binding.Binding(Path, Mode, Converter, ConverterParameter, StringFormat, Source)
- {
- UpdateSourceEventName = UpdateSourceEventName,
- FallbackValue = FallbackValue,
- TargetNullValue = TargetNullValue,
- };
-
- TypedBinding.Mode = Mode;
- TypedBinding.Converter = Converter;
- TypedBinding.ConverterParameter = ConverterParameter;
- TypedBinding.StringFormat = StringFormat;
- TypedBinding.Source = Source;
- TypedBinding.UpdateSourceEventName = UpdateSourceEventName;
- TypedBinding.FallbackValue = FallbackValue;
- TypedBinding.TargetNullValue = TargetNullValue;
- return TypedBinding;
- }
-
- object IMarkupExtension.ProvideValue(IServiceProvider serviceProvider)
- {
- return (this as IMarkupExtension<BindingBase>).ProvideValue(serviceProvider);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Xaml
-{
- [ProvideCompiled("Tizen.NUI.Xaml.Build.Tasks.NullExtension")]
- [AcceptEmptyServiceProvider]
- internal class NullExtension : IMarkupExtension
- {
- public object ProvideValue(IServiceProvider serviceProvider)
- {
- return null;
- }
- }
-}
+++ /dev/null
-using System;
-using Tizen.NUI.Binding;
-
-namespace Tizen.NUI.Xaml
-{
- [ContentProperty("Path")]
- [AcceptEmptyServiceProvider]
- internal sealed class TemplateBindingExtension : IMarkupExtension<BindingBase>
- {
- internal TemplateBindingExtension()
- {
- Mode = BindingMode.Default;
- Path = Tizen.NUI.Binding.Binding.SelfPath;
- }
-
- public string Path { get; set; }
-
- public BindingMode Mode { get; set; }
-
- public IValueConverter Converter { get; set; }
-
- public object ConverterParameter { get; set; }
-
- public string StringFormat { get; set; }
-
- BindingBase IMarkupExtension<BindingBase>.ProvideValue(IServiceProvider serviceProvider)
- {
- return new TemplateBinding(Path, Mode, Converter, ConverterParameter, StringFormat);
- }
-
- object IMarkupExtension.ProvideValue(IServiceProvider serviceProvider)
- {
- return (this as IMarkupExtension<BindingBase>).ProvideValue(serviceProvider);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Xaml
-{
- [System.AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)]
- internal sealed class TypeConversionAttribute : Attribute
- {
- public Type TargetType { get; private set; }
-
- public TypeConversionAttribute(Type targetType)
- {
- TargetType = targetType;
- }
- }
-}
\ No newline at end of file
}
}
- var nativeValueConverterService = DependencyService.Get<INativeValueConverterService>();
-
- object nativeValue = null;
- if (nativeValueConverterService != null && nativeValueConverterService.ConvertTo(value, toType, out nativeValue))
- return nativeValue;
-
return value;
}
+++ /dev/null
-using System;
-using System.Runtime.CompilerServices;
-
-namespace Tizen.NUI.Xaml
-{
- [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
- internal sealed class XamlFilePathAttribute : Attribute
- {
- public XamlFilePathAttribute([CallerFilePath] string filePath = "")
- {
- }
- }
-}
\ No newline at end of file
namespace Tizen.NUI.Xaml.Internals
{
- [Obsolete("Replaced by ResourceLoader")]
- internal static class XamlLoader
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [Obsolete ("Replaced by ResourceLoader")]
+ public static class XamlLoader
{
static Func<Type, string> xamlFileProvider;
- public static Func<Type, string> XamlFileProvider
- {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static Func<Type, string> XamlFileProvider {
get { return xamlFileProvider; }
internal set
{
foreach (var kvp in xmlns) {
var prefix = kvp.Key;
- string typeName = null, ns = null, asm = null, targetPlatform = null;
- XmlnsHelper.ParseXmlns(kvp.Value, out typeName, out ns, out asm, out targetPlatform);
- if (targetPlatform == null)
- continue;
- try {
- if (targetPlatform != Device.RuntimePlatform)
- {
- // Special case for Windows backward compatibility
- if (targetPlatform == "Windows" && Device.RuntimePlatform == Device.UWP)
- continue;
-
- prefixes.Add(prefix);
- }
- } catch (InvalidOperationException) {
- prefixes.Add(prefix);
- }
+ string typeName = null, ns = null, asm = null;
+ XmlnsHelper.ParseXmlns(kvp.Value, out typeName, out ns, out asm);
}
return prefixes;
}
if (lookupAssemblies.Count == 0) {
string ns, asmstring, _;
- XmlnsHelper.ParseXmlns(namespaceURI, out _, out ns, out asmstring, out _);
+ XmlnsHelper.ParseXmlns(namespaceURI, out _, out ns, out asmstring);
lookupAssemblies.Add(new XmlnsDefinitionAttribute(namespaceURI, ns) {
AssemblyName = asmstring ?? currentAssembly.FullName
});
+++ /dev/null
-using System.Xml;
-
-namespace Tizen.NUI.Xaml
-{
- internal class XmlLineInfo : IXmlLineInfo
- {
- readonly bool _hasLineInfo;
-
- public XmlLineInfo()
- {
- }
-
- public XmlLineInfo(int linenumber, int lineposition)
- {
- _hasLineInfo = true;
- LineNumber = linenumber;
- LinePosition = lineposition;
- }
-
- public bool HasLineInfo()
- {
- return _hasLineInfo;
- }
-
- public int LineNumber { get; }
-
- public int LinePosition { get; }
- }
-}
\ No newline at end of file
string typeName;
string ns;
string asm;
- string targetPlatform;
-
- ParseXmlns(xmlns, out typeName, out ns, out asm, out targetPlatform);
+ ParseXmlns(xmlns, out typeName, out ns, out asm);
return ns;
}
- public static void ParseXmlns(string xmlns, out string typeName, out string ns, out string asm, out string targetPlatform)
+ public static void ParseXmlns(string xmlns, out string typeName, out string ns, out string asm)
{
- typeName = ns = asm = targetPlatform = null;
+ typeName = ns = asm = null;
xmlns = xmlns.Trim();
if (xmlns.StartsWith("using:", StringComparison.Ordinal)) {
- ParseUsing(xmlns, out typeName, out ns, out asm, out targetPlatform);
+ ParseUsing(xmlns, out typeName, out ns, out asm);
return;
}
- ParseClrNamespace(xmlns, out typeName, out ns, out asm, out targetPlatform);
+ ParseClrNamespace(xmlns, out typeName, out ns, out asm);
}
- static void ParseClrNamespace(string xmlns, out string typeName, out string ns, out string asm, out string targetPlatform)
+ static void ParseClrNamespace(string xmlns, out string typeName, out string ns, out string asm)
{
- typeName = ns = asm = targetPlatform = null;
+ typeName = ns = asm = null;
foreach (var decl in xmlns.Split(';'))
{
ns = decl.Substring(14, decl.Length - 14);
continue;
}
+
if (decl.StartsWith("assembly=", StringComparison.Ordinal))
{
asm = decl.Substring(9, decl.Length - 9);
continue;
}
- if (decl.StartsWith("targetPlatform=", StringComparison.Ordinal)) {
- targetPlatform = decl.Substring(15, decl.Length - 15);
- continue;
- }
+
var nsind = decl.LastIndexOf(".", StringComparison.Ordinal);
if (nsind > 0)
{
}
}
- static void ParseUsing(string xmlns, out string typeName, out string ns, out string asm, out string targetPlatform)
+ static void ParseUsing(string xmlns, out string typeName, out string ns, out string asm)
{
- typeName = ns = asm = targetPlatform = null;
+ typeName = ns = asm = null;
foreach (var decl in xmlns.Split(';')) {
if (decl.StartsWith("using:", StringComparison.Ordinal)) {
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-
-namespace Tizen.NUI.Binding
-{
- [System.ComponentModel.TypeConverter(typeof(AcceleratorTypeConverter))]
- internal class Accelerator
- {
- const char Separator = '+';
- string _text;
-
- internal Accelerator(string text)
- {
- if (string.IsNullOrEmpty(text))
- throw new ArgumentNullException(nameof(text));
- _text = text;
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public IEnumerable<string> Modifiers { get; set; }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public IEnumerable<string> Keys { get; set; }
-
- public static Accelerator FromString(string text)
- {
- var accelarat = new Accelerator(text);
-
- var acceleratorParts = text.Split(Separator);
-
- if (acceleratorParts.Length > 1)
- {
- var modifiers = new List<string>();
- for (int i = 0; i < acceleratorParts.Length; i++)
- {
- var modifierMask = acceleratorParts[i];
- var modiferMaskLower = modifierMask.ToLower();
- switch (modiferMaskLower)
- {
- case "ctrl":
- case "cmd":
- case "alt":
- case "shift":
- case "fn":
- case "win":
- modifiers.Add(modiferMaskLower);
- text = text.Replace(modifierMask, "");
- break;
- }
- }
- accelarat.Modifiers = modifiers;
-
- }
-
- var keys = text.Split(new char[] { Separator }, StringSplitOptions.RemoveEmptyEntries);
- accelarat.Keys = keys;
- return accelarat;
- }
-
- public override string ToString()
- {
- return _text;
- }
-
- public override bool Equals(object obj)
- {
- return obj != null && obj is Accelerator && Equals((Accelerator)obj);
- }
-
- bool Equals(Accelerator other)
- {
- return other.ToString() == ToString();
- }
-
- public override int GetHashCode()
- {
- return ToString().GetHashCode();
- }
-
- public static implicit operator Accelerator(string accelerator)
- {
- return FromString(accelerator);
- }
- }
-}
+++ /dev/null
-namespace Tizen.NUI.Binding
-{
- internal class AcceleratorTypeConverter : TypeConverter
- {
- public override object ConvertFromInvariantString(string value)
- {
- if (value == null)
- return null;
-
- return Accelerator.FromString(value);
- }
- }
-}
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Threading;
-using System.ComponentModel;
-using System.Threading.Tasks;
-using Tizen.NUI.Binding.Internals;
-
-namespace Tizen.NUI.Binding
-{
- internal class Application : Element, IResourcesProvider, IApplicationController, IElementConfiguration<Application>
- {
- static Application s_current;
- Task<IDictionary<string, object>> _propertiesTask;
- readonly Lazy<PlatformConfigurationRegistry<Application>> _platformConfigurationRegistry;
-
- IAppIndexingProvider _appIndexProvider;
-
- ReadOnlyCollection<Element> _logicalChildren;
-
- Page _mainPage;
-
- static SemaphoreSlim SaveSemaphore = new SemaphoreSlim(1, 1);
-
- public Application()
- {
- // var f = false;
- // if (f)
- // Loader.Load();
- NavigationProxy = new NavigationImpl(this);
- SetCurrentApplication(this);
-
- SystemResources = DependencyService.Get<ISystemResourcesProvider>()?.GetSystemResources();
- SystemResources.ValuesChanged += OnParentResourcesChanged;
- _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Application>>(() => new PlatformConfigurationRegistry<Application>(this));
- }
-
- public void Quit()
- {
- Device.PlatformServices?.QuitApplication();
- }
-
- public IAppLinks AppLinks
- {
- get
- {
- if (_appIndexProvider == null)
- throw new ArgumentException("No IAppIndexingProvider was provided");
- if (_appIndexProvider.AppLinks == null)
- throw new ArgumentException("No AppLinks implementation was found, if in Android make sure you installed the Tizen.NUI.Binding.AppLinks");
- return _appIndexProvider.AppLinks;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static void SetCurrentApplication(Application value) => Current = value;
-
- public static Application Current
- {
- get { return s_current; }
- set
- {
- if (s_current == value)
- return;
- if (value == null)
- s_current = null; //Allow to reset current for unittesting
- s_current = value;
- }
- }
-
- public Page MainPage
- {
- get { return _mainPage; }
- set
- {
- if (value == null)
- throw new ArgumentNullException("value");
-
- if (_mainPage == value)
- return;
-
- OnPropertyChanging();
- if (_mainPage != null)
- {
- InternalChildren.Remove(_mainPage);
- _mainPage.Parent = null;
- }
-
- _mainPage = value;
-
- if (_mainPage != null)
- {
- _mainPage.Parent = this;
- _mainPage.NavigationProxy.Inner = NavigationProxy;
- InternalChildren.Add(_mainPage);
- }
- OnPropertyChanged();
- }
- }
-
- public IDictionary<string, object> Properties
- {
- get
- {
- if (_propertiesTask == null)
- {
- _propertiesTask = GetPropertiesAsync();
- }
-
- return _propertiesTask.Result;
- }
- }
-
- internal override ReadOnlyCollection<Element> LogicalChildrenInternal
- {
- get { return _logicalChildren ?? (_logicalChildren = new ReadOnlyCollection<Element>(InternalChildren)); }
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public NavigationProxy NavigationProxy { get; }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int PanGestureId { get; set; }
-
- internal IResourceDictionary SystemResources { get; }
-
- ObservableCollection<Element> InternalChildren { get; } = new ObservableCollection<Element>();
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void SetAppIndexingProvider(IAppIndexingProvider provider)
- {
- _appIndexProvider = provider;
- }
-
- ResourceDictionary _resources;
- bool IResourcesProvider.IsResourcesCreated => _resources != null;
-
- public ResourceDictionary XamlResources
- {
- get
- {
- if (_resources != null)
- return _resources;
-
- _resources = new ResourceDictionary();
- ((IResourceDictionary)_resources).ValuesChanged += OnResourcesChanged;
- return _resources;
- }
- set
- {
- if (_resources == value)
- return;
- OnPropertyChanging();
- if (_resources != null)
- ((IResourceDictionary)_resources).ValuesChanged -= OnResourcesChanged;
- _resources = value;
- OnResourcesChanged(value);
- if (_resources != null)
- ((IResourceDictionary)_resources).ValuesChanged += OnResourcesChanged;
- OnPropertyChanged();
- }
- }
-
- public event EventHandler<ModalPoppedEventArgs> ModalPopped;
-
- public event EventHandler<ModalPoppingEventArgs> ModalPopping;
-
- public event EventHandler<ModalPushedEventArgs> ModalPushed;
-
- public event EventHandler<ModalPushingEventArgs> ModalPushing;
-
- public event EventHandler<Page> PageAppearing;
-
- public event EventHandler<Page> PageDisappearing;
-
-
- async void SaveProperties()
- {
- try
- {
- await SetPropertiesAsync();
- }
- catch (Exception exc)
- {
- Console.WriteLine(nameof(Application), $"Exception while saving Application Properties: {exc}");
- }
- }
-
- public async Task SavePropertiesAsync()
- {
- if (Device.IsInvokeRequired)
- {
- Device.BeginInvokeOnMainThread(SaveProperties);
- }
- else
- {
- await SetPropertiesAsync();
- }
- }
-
- // Don't use this unless there really is no better option
- internal void SavePropertiesAsFireAndForget()
- {
- if (Device.IsInvokeRequired)
- {
- Device.BeginInvokeOnMainThread(SaveProperties);
- }
- else
- {
- SaveProperties();
- }
- }
-
- public IPlatformElementConfiguration<T, Application> On<T>() where T : IConfigPlatform
- {
- return _platformConfigurationRegistry.Value.On<T>();
- }
-
- protected virtual void OnAppLinkRequestReceived(Uri uri)
- {
- }
-
- protected override void OnParentSet()
- {
- throw new InvalidOperationException("Setting a Parent on Application is invalid.");
- }
-
- protected virtual void OnResume()
- {
- }
-
- protected virtual void OnSleep()
- {
- }
-
- protected virtual void OnStart()
- {
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static void ClearCurrent()
- {
- s_current = null;
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static bool IsApplicationOrNull(Element element)
- {
- return element == null || element is Application;
- }
-
- internal override void OnParentResourcesChanged(IEnumerable<KeyValuePair<string, object>> values)
- {
- if (!((IResourcesProvider)this).IsResourcesCreated || XamlResources.Count == 0)
- {
- base.OnParentResourcesChanged(values);
- return;
- }
-
- var innerKeys = new HashSet<string>();
- var changedResources = new List<KeyValuePair<string, object>>();
- foreach (KeyValuePair<string, object> c in XamlResources)
- innerKeys.Add(c.Key);
- foreach (KeyValuePair<string, object> value in values)
- {
- if (innerKeys.Add(value.Key))
- changedResources.Add(value);
- }
- OnResourcesChanged(changedResources);
- }
-
- internal event EventHandler PopCanceled;
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void SendOnAppLinkRequestReceived(Uri uri)
- {
- OnAppLinkRequestReceived(uri);
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void SendResume()
- {
- s_current = this;
- OnResume();
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void SendSleep()
- {
- OnSleep();
- SavePropertiesAsFireAndForget();
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Task SendSleepAsync()
- {
- OnSleep();
- return SavePropertiesAsync();
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void SendStart()
- {
- OnStart();
- }
-
- async Task<IDictionary<string, object>> GetPropertiesAsync()
- {
- var deserializer = DependencyService.Get<IDeserializer>();
- if (deserializer == null)
- {
- Console.WriteLine("Startup", "No IDeserialzier was found registered");
- return new Dictionary<string, object>(4);
- }
-
- IDictionary<string, object> properties = await deserializer.DeserializePropertiesAsync().ConfigureAwait(false);
- if (properties == null)
- properties = new Dictionary<string, object>(4);
-
- return properties;
- }
-
- internal void OnPageAppearing(Page page)
- => PageAppearing?.Invoke(this, page);
-
- internal void OnPageDisappearing(Page page)
- => PageDisappearing?.Invoke(this, page);
-
- void OnModalPopped(Page modalPage)
- => ModalPopped?.Invoke(this, new ModalPoppedEventArgs(modalPage));
-
- bool OnModalPopping(Page modalPage)
- {
- var args = new ModalPoppingEventArgs(modalPage);
- ModalPopping?.Invoke(this, args);
- return args.Cancel;
- }
-
- void OnModalPushed(Page modalPage)
- => ModalPushed?.Invoke(this, new ModalPushedEventArgs(modalPage));
-
- void OnModalPushing(Page modalPage)
- => ModalPushing?.Invoke(this, new ModalPushingEventArgs(modalPage));
-
- void OnPopCanceled()
- => PopCanceled?.Invoke(this, EventArgs.Empty);
-
- async Task SetPropertiesAsync()
- {
- await SaveSemaphore.WaitAsync();
- try
- {
- await DependencyService.Get<IDeserializer>()?.SerializePropertiesAsync(Properties);
- }
- finally
- {
- SaveSemaphore.Release();
- }
-
- }
-
- class NavigationImpl : NavigationProxy
- {
- readonly Application _owner;
-
- public NavigationImpl(Application owner)
- {
- _owner = owner;
- }
-
- protected override async Task<Page> OnPopModal(bool animated)
- {
- Page modal = ModalStack[ModalStack.Count - 1];
- if (_owner.OnModalPopping(modal))
- {
- _owner.OnPopCanceled();
- return null;
- }
- Page result = await base.OnPopModal(animated);
- result.Parent = null;
- _owner.OnModalPopped(result);
- return result;
- }
-
- protected override async Task OnPushModal(Page modal, bool animated)
- {
- _owner.OnModalPushing(modal);
-
- modal.Parent = _owner;
-
- if (modal.NavigationProxy.ModalStack.Count == 0)
- {
- modal.NavigationProxy.Inner = this;
- await base.OnPushModal(modal, animated);
- }
- else
- {
- await base.OnPushModal(modal, animated);
- modal.NavigationProxy.Inner = this;
- }
-
- _owner.OnModalPushed(modal);
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using Tizen.NUI.Binding;
-
-namespace Tizen.NUI.Binding
-{
- internal abstract class BaseMenuItem : Element
- {
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace Tizen.NUI.Binding
-{
- [Xaml.ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.BindingTypeConverter")]
- [Xaml.TypeConversion(typeof(Binding))]
- internal sealed class BindingTypeConverter : TypeConverter
- {
- public override object ConvertFromInvariantString(string value)
- {
- return new Binding(value);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections;
-
-namespace Tizen.NUI.Binding
-{
- internal delegate void CollectionSynchronizationCallback(IEnumerable collection, object context, Action accessMethod, bool writeAccess);
-}
\ No newline at end of file
+++ /dev/null
-
-namespace Tizen.NUI.Binding
-{
- internal class Configuration<TPlatform, TElement> : IPlatformElementConfiguration<TPlatform, TElement>
- where TPlatform : IConfigPlatform
- where TElement : Element
-
- {
- public Configuration(TElement element)
- {
- Element = element;
- }
-
- public TElement Element { get; }
-
- public static Configuration<TPlatform, TElement> Create(TElement element)
- {
- return new Configuration<TPlatform, TElement>(element);
- }
- }
-}
catch (System.IO.FileNotFoundException)
{
// Sometimes the previewer doesn't actually have everything required for these loads to work
- Console.WriteLine(nameof(Registrar), "Could not load assembly: {0} for Attibute {1} | Some renderers may not be loaded", assembly.FullName, targetAttrType.FullName);
+ Tizen.Log.Fatal("NUI", "Could not load assembly: {0} for Attibute {1} | Some renderers may not be loaded", assembly.FullName, targetAttrType.FullName);
continue;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public static DeviceInfo info;
- static IPlatformServices s_platformServices;
-
[EditorBrowsable(EditorBrowsableState.Never)]
public static void SetIdiom(TargetIdiom value) => Idiom = value;
public static TargetIdiom Idiom { get; internal set; }
}
#pragma warning restore 0618
- public static string RuntimePlatform => PlatformServices?.RuntimePlatform;
+ public static string RuntimePlatform => null;
[EditorBrowsable(EditorBrowsableState.Never)]
public static DeviceInfo Info
public static FlowDirection FlowDirection { get; internal set; }
[EditorBrowsable(EditorBrowsableState.Never)]
- public static bool IsInvokeRequired
- {
- get { return PlatformServices.IsInvokeRequired; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static IPlatformServices PlatformServices
- {
- get
- {
- if (s_platformServices == null)
- throw new InvalidOperationException("You MUST call Tizen.NUI.Init(); prior to using it.");
- return s_platformServices;
- }
- set
- {
- s_platformServices = value;
- Console.WriteLine("Device s_platformServices : " + s_platformServices );
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
public static IReadOnlyList<string> Flags { get; private set; }
[EditorBrowsable(EditorBrowsableState.Never)]
public static void BeginInvokeOnMainThread(Action action)
{
- PlatformServices?.BeginInvokeOnMainThread(action);
action();
Console.WriteLine("Device BeginInvokeOnMainThread action called");
}
// return GetNamedSize(size, targetElementType, false);
// }
- [Obsolete("OnPlatform is obsolete as of version 2.3.4. Please use switch(RuntimePlatform) instead.")]
- public static void OnPlatform(Action iOS = null, Action Android = null, Action WinPhone = null, Action Default = null)
- {
- switch (OS)
- {
- case TargetPlatform.iOS:
- if (iOS != null)
- iOS();
- else if (Default != null)
- Default();
- break;
- case TargetPlatform.Android:
- if (Android != null)
- Android();
- else if (Default != null)
- Default();
- break;
- case TargetPlatform.Windows:
- case TargetPlatform.WinPhone:
- if (WinPhone != null)
- WinPhone();
- else if (Default != null)
- Default();
- break;
- case TargetPlatform.Other:
- if (Default != null)
- Default();
- break;
- }
- }
-
[Obsolete("OnPlatform<> (generic) is obsolete as of version 2.3.4. Please use switch(RuntimePlatform) instead.")]
public static T OnPlatform<T>(T iOS, T Android, T WinPhone)
{
// PlatformServices?.OpenUriAction(uri);
}
- public static void StartTimer(TimeSpan interval, Func<bool> callback)
- {
- PlatformServices.StartTimer(interval, callback);
- }
-
[EditorBrowsable(EditorBrowsableState.Never)]
public static Assembly[] GetAssemblies()
{
- return PlatformServices?.GetAssemblies();
+ return null;
}
// [EditorBrowsable(EditorBrowsableState.Never)]
// return PlatformServices.GetNamedSize(size, targetElementType, useOldSizes);
// }
- internal static Task<Stream> GetStreamAsync(Uri uri, CancellationToken cancellationToken)
- {
- return PlatformServices?.GetStreamAsync(uri, cancellationToken);
- }
-
public static class Styles
{
public static readonly string TitleStyleKey = "TitleStyle";
+++ /dev/null
-using System;
-using System.ComponentModel;
-using Tizen.NUI.Binding.Internals;
-
-namespace Tizen.NUI.Binding
-{
- /// <summary>
- /// A collection of styles and properties that can be added to an element at run time.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- internal abstract class Effect
- {
- internal Effect()
- {
- }
-
- /// <summary>
- /// Gets the element to which the style is attached.
- /// </summary>
- public Element Element { get; internal set; }
-
- /// <summary>
- /// Gets a value that tells whether the effect is attached to an element.
- /// </summary>
- public bool IsAttached { get; private set; }
-
- /// <summary>
- /// Gets the ID that is used to resolve this effect at runtime.
- /// </summary>
- public string ResolveId { get; internal set; }
-
- #region Statics
- /// <summary>
- /// Returns an Effect for the specified name, which is of the form ResolutionGroupName.ExportEffect.
- /// </summary>
- /// <param name="name">The name of the effect to get.</param>
- /// <returns>The uniquely identified effect.</returns>
- public static Effect Resolve(string name)
- {
- Effect result = null;
- if (Tizen.NUI.Binding.Internals.Registrar.Effects.TryGetValue(name, out Type effectType))
- {
- result = (Effect)DependencyResolver.ResolveOrCreate(effectType);
- }
-
- if (result == null)
- result = new NullEffect();
- result.ResolveId = name;
- return result;
- }
-
- #endregion
-
- /// <summary>
- /// Method that is called after the effect is attached and made valid.
- /// </summary>
- protected abstract void OnAttached();
-
- /// <summary>
- /// Method that is called after the effect is detached and invalidated.
- /// </summary>
- protected abstract void OnDetached();
-
- internal virtual void ClearEffect()
- {
- if (IsAttached)
- SendDetached();
- Element = null;
- }
-
- internal virtual void SendAttached()
- {
- if (IsAttached)
- return;
- OnAttached();
- IsAttached = true;
- }
-
- internal virtual void SendDetached()
- {
- if (!IsAttached)
- return;
- OnDetached();
- IsAttached = false;
- }
-
- internal virtual void SendOnElementPropertyChanged(PropertyChangedEventArgs args)
- {
- }
- }
-}
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Binding
-{
- [Flags]
- internal enum EffectiveFlowDirection
- {
- RightToLeft = 1 << 0,
- Explicit = 1 << 1,
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.ComponentModel;
-using Tizen.NUI.Binding;
-
-namespace Tizen.NUI.Binding
-{
- [EditorBrowsable(EditorBrowsableState.Never)]
- internal static class EffectiveFlowDirectionExtensions
- {
- internal static EffectiveFlowDirection ToEffectiveFlowDirection(this FlowDirection self, bool isExplicit = false)
- {
- switch (self)
- {
- case FlowDirection.MatchParent:
- return default(EffectiveFlowDirection);
-
-
- case FlowDirection.LeftToRight:
- if (isExplicit)
- {
- return EffectiveFlowDirection.Explicit;
- }
- else
- {
- return default(EffectiveFlowDirection);
- }
-
- case FlowDirection.RightToLeft:
- if (isExplicit)
- {
- return EffectiveFlowDirection.RightToLeft | EffectiveFlowDirection.Explicit;
- }
- else
- {
- return EffectiveFlowDirection.RightToLeft;
- }
-
- default:
- throw new InvalidOperationException($"Cannot convert {self} to {nameof(EffectiveFlowDirection)}.");
- }
- }
-
- internal static FlowDirection ToFlowDirection(this EffectiveFlowDirection self)
- {
- if (self.IsLeftToRight())
- return FlowDirection.LeftToRight;
- else
- return FlowDirection.RightToLeft;
-
- throw new InvalidOperationException($"Cannot convert {self} to {nameof(FlowDirection)}.");
- }
-
- public static bool IsRightToLeft(this EffectiveFlowDirection self)
- {
- return (self & EffectiveFlowDirection.RightToLeft) == EffectiveFlowDirection.RightToLeft;
- }
-
- public static bool IsLeftToRight(this EffectiveFlowDirection self)
- {
- return (self & EffectiveFlowDirection.RightToLeft) != EffectiveFlowDirection.RightToLeft;
- }
-
- public static bool IsImplicit(this EffectiveFlowDirection self)
- {
- return (self & EffectiveFlowDirection.Explicit) != EffectiveFlowDirection.Explicit;
- }
-
- public static bool IsExplicit(this EffectiveFlowDirection self)
- {
- return (self & EffectiveFlowDirection.Explicit) == EffectiveFlowDirection.Explicit;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.Collections.ObjectModel;
-
-namespace Tizen.NUI.Binding
-{
- internal class ElementCollection<T> : ObservableWrapper<Element, T> where T : Element
- {
- public ElementCollection(ObservableCollection<Element> list) : base(list)
- {
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Binding
-{
- internal class ElementEventArgs : EventArgs
- {
- public ElementEventArgs(Element element)
- {
- if (element == null)
- throw new ArgumentNullException("element");
-
- Element = element;
- }
-
- public Element Element { get; private set; }
- }
-}
+++ /dev/null
-using System.Threading.Tasks;
-
-namespace Tizen.NUI.Binding
-{
- [TypeConverter(typeof(FileImageSourceConverter))]
- internal sealed class FileImageSource : ImageSource
- {
- public static readonly BindableProperty FileProperty = BindableProperty.Create("File", typeof(string), typeof(FileImageSource), default(string));
-
- public string File
- {
- get { return (string)GetValue(FileProperty); }
- set { SetValue(FileProperty, value); }
- }
-
- public override Task<bool> Cancel()
- {
- return Task.FromResult(false);
- }
-
- public override string ToString()
- {
- return $"File: {File}";
- }
-
- public static implicit operator FileImageSource(string file)
- {
- return (FileImageSource)FromFile(file);
- }
-
- public static implicit operator string(FileImageSource file)
- {
- return file != null ? file.File : null;
- }
-
- protected override void OnPropertyChanged(string propertyName = null)
- {
- if (propertyName == FileProperty.PropertyName)
- OnSourceChanged();
- base.OnPropertyChanged(propertyName);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Binding
-{
- [Xaml.TypeConversion(typeof(FileImageSource))]
- internal sealed class FileImageSourceConverter : TypeConverter
- {
- public override object ConvertFromInvariantString(string value)
- {
- if (value != null)
- return (FileImageSource)ImageSource.FromFile(value);
-
- throw new InvalidOperationException(string.Format("Cannot convert \"{0}\" into {1}", value, typeof(FileImageSource)));
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace Tizen.NUI.Binding
-{
- internal interface IAppIndexingProvider
- {
- IAppLinks AppLinks { get; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-
-namespace Tizen.NUI.Binding
-{
- internal interface IAppLinkEntry
- {
- Uri AppLinkUri { get; set; }
-
- string Description { get; set; }
-
- bool IsLinkActive { get; set; }
-
- IDictionary<string, string> KeyValues { get; }
-
- ImageSource Thumbnail { get; set; }
-
- string Title { get; set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Binding
-{
- internal interface IAppLinks
- {
- void DeregisterLink(IAppLinkEntry appLink);
- void DeregisterLink(Uri appLinkUri);
- void RegisterLink(IAppLinkEntry appLink);
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace Tizen.NUI.Binding
-{
- internal interface IApplicationController
- {
- void SetAppIndexingProvider(IAppIndexingProvider appIndexing);
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.ComponentModel;
-
-namespace Tizen.NUI.Binding
-{
- /// <summary>
- /// When implemented in a renderer, registers a platform-specific effect on an element.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- internal interface IEffectControlProvider
- {
- /// <summary>
- /// Registers the effect with the element by establishing the parent-child relations needed for rendering on the specific platform.
- /// </summary>
- /// <param name="effect">The effect to register.</param>
- void RegisterEffect(Effect effect);
- }
-}
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Binding
-{
- internal interface ILayout
- {
- event EventHandler LayoutChanged;
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.Collections.Generic;
-
-namespace Tizen.NUI.Binding
-{
- internal interface ILayoutController
- {
- IReadOnlyList<Element> Children { get; }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace Tizen.NUI.Binding
-{
- internal interface IMenuItemController
- {
- bool IsEnabled { get; set; }
- string IsEnabledPropertyName { get; }
-
- void Activate();
- }
-}
+++ /dev/null
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using System.ComponentModel;
-
-namespace Tizen.NUI.Binding
-{
- /// <summary>
- /// Interface abstracting platform-specific navigation.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- internal interface INavigation
- {
- /// <summary>
- /// Gets the modal navigation stack.
- /// </summary>
- IReadOnlyList<Page> ModalStack { get; }
-
- /// <summary>
- /// Gets the stack of pages in the navigation.
- /// </summary>
- IReadOnlyList<Page> NavigationStack { get; }
-
- /// <summary>
- /// Inserts a page in the navigation stack before an existing page in the stack.
- /// </summary>
- /// <param name="page">The page to add.</param>
- /// <param name="before">The existing page, before which page will be inserted.</param>
- void InsertPageBefore(Page page, Page before);
-
- /// <summary>
- /// Asynchronously removes the most recent Page from the navigation stack.
- /// </summary>
- /// <returns>The Page that had been at the top of the navigation stack.</returns>
- Task<Page> PopAsync();
-
- /// <summary>
- /// Asynchronously removes the most recent Page from the navigation stack, with optional animation.
- /// </summary>
- /// <param name="animated">Whether to animate the pop.</param>
- /// <returns>The Page that had been at the top of the navigation stack.</returns>
- Task<Page> PopAsync(bool animated);
-
- /// <summary>
- /// Asynchronously dismisses the most recent modally presented Page.
- /// </summary>
- /// <returns>An awaitable instance, indicating the PopModalAsync completion. The Task.Result is the Page that has been popped.</returns>
- Task<Page> PopModalAsync();
-
- /// <summary>
- /// Asynchronously dismisses the most recent modally presented Page, with optional animation.
- /// </summary>
- /// <param name="animated">Whether to animate the pop.</param>
- /// <returns>An awaitable, indicating the PopModalAsync completion. The Task.Result is the Page that has been popped.</returns>
- Task<Page> PopModalAsync(bool animated);
-
- /// <summary>
- /// Pops all but the root Page off the navigation stack.
- /// </summary>
- /// <returns>A task representing the asynchronous dismiss operation.</returns>
- Task PopToRootAsync();
-
- /// <summary>
- /// Pops all but the root Page off the navigation stack, with optional animation.
- /// </summary>
- /// <param name="animated">Whether to animate the pop.</param>
- /// <returns>A task representing the asynchronous dismiss operation.</returns>
- Task PopToRootAsync(bool animated);
-
- /// <summary>
- /// Asynchronously adds a Page to the top of the navigation stack.
- /// </summary>
- /// <param name="page">The Page to be pushed on top of the navigation stack.</param>
- /// <returns>A task that represents the asynchronous push operation.</returns>
- Task PushAsync(Page page);
-
- /// <summary>
- /// Asynchronously adds a Page to the top of the navigation stack, with optional animation.
- /// </summary>
- /// <param name="page">The page to push.</param>
- /// <param name="animated">Whether to animate the push.</param>
- /// <returns>A task that represents the asynchronous push operation.</returns>
- Task PushAsync(Page page, bool animated);
-
- /// <summary>
- /// Presents a Page modally.
- /// </summary>
- /// <param name="page">The Page to present modally.</param>
- /// <returns>An awaitable Task, indicating the PushModal completion.</returns>
- Task PushModalAsync(Page page);
-
- /// <summary>
- /// Presents a Page modally, with optional animation.
- /// </summary>
- /// <param name="page">The page to push.</param>
- /// <param name="animated">Whether to animate the push.</param>
- /// <returns>An awaitable Task, indicating the PushModal completion.</returns>
- Task PushModalAsync(Page page, bool animated);
-
- /// <summary>
- /// Removes the specified page from the navigation stack.
- /// </summary>
- /// <param name="page">The page to remove.</param>
- void RemovePage(Page page);
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace Tizen.NUI.Binding
-{
- internal interface INavigationMenuController : IViewController
- {
- void SendTargetSelected(Page target);
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using Tizen.NUI.Binding.Internals;
-
-namespace Tizen.NUI.Binding
-{
- internal interface INavigationPageController
- {
- Task<Page> RemoveAsyncInner(Page page, bool animated, bool fast);
-
- Page Peek(int depth = 0);
-
- IEnumerable<Page> Pages { get; }
-
- int StackDepth { get; }
-
- Task<Page> PopAsyncInner(bool animated, bool fast = false);
-
- event EventHandler<NavigationRequestedEventArgs> InsertPageBeforeRequested;
-
- event EventHandler<NavigationRequestedEventArgs> PopRequested;
-
- event EventHandler<NavigationRequestedEventArgs> PopToRootRequested;
-
- event EventHandler<NavigationRequestedEventArgs> PushRequested;
-
- event EventHandler<NavigationRequestedEventArgs> RemovePageRequested;
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace Tizen.NUI.Binding
-{
- interface IPaddingElement
- {
- //note to implementor: implement this property publicly
- // Thickness Padding { get; }
-
- //note to implementor: but implement this method explicitly
- void OnPaddingPropertyChanged(Thickness oldValue, Thickness newValue);
- Thickness PaddingDefaultValueCreator();
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.ComponentModel;
-
-namespace Tizen.NUI.Binding
-{
- /// <summary>
- /// For internal use.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- internal interface IPlatform
- {
- /// <summary>
- /// Returns the native size.
- /// </summary>
- /// <param name="view">The view</param>
- /// <param name="widthConstraint">The width constraint.</param>
- /// <param name="heightConstraint">The height constraint.</param>
- /// <returns>The native size.</returns>
- SizeRequest GetNativeSize(BaseHandle view, double widthConstraint, double heightConstraint);
- }
-}
+++ /dev/null
-using System.ComponentModel;
-
-namespace Tizen.NUI.Binding
-{
- /// <summary>
- /// Marker interface for returning platform-specific configuration elements.
- /// </summary>
- /// <typeparam name="TPlatform">The platform type.</typeparam>
- /// <typeparam name="TElement">The element type.</typeparam>
- [EditorBrowsable(EditorBrowsableState.Never)]
- internal interface IPlatformElementConfiguration<out TPlatform, out TElement> : IConfigElement<TElement>
- where TPlatform : IConfigPlatform
- where TElement : Element
- {
- }
-}
void BeginInvokeOnMainThread(Action action);
- Ticker CreateTicker();
-
Assembly[] GetAssemblies();
string GetMD5Hash(string input);
+++ /dev/null
-namespace Tizen.NUI.Binding
-{
- internal interface IRegisterable
- {
- }
-}
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Binding
-{
- //this will go once Timer is included in Pcl profiles
- internal interface ITimer
- {
- void Change(int dueTime, int period);
- void Change(long dueTime, long period);
- void Change(TimeSpan dueTime, TimeSpan period);
- void Change(uint dueTime, uint period);
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.Collections.Generic;
-
-namespace Tizen.NUI.Binding
-{
- internal interface IViewContainer<T> where T : /*VisualElement*/BaseHandle
- {
- IList<T> Children { get; }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace Tizen.NUI.Binding
-{
- internal interface IViewController : IVisualElementController
- {
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using Tizen.NUI.Binding.Internals;
-
-namespace Tizen.NUI.Binding
-{
- internal interface IVisualElementController : IElementController
- {
- void NativeSizeChanged();
- void InvalidateMeasure(InvalidationTrigger trigger);
- bool Batched { get; }
- bool DisableLayout { get; set; }
- EffectiveFlowDirection EffectiveFlowDirection { get; }
- bool IsInNativeLayout { get; set; }
- bool IsNativeStateConsistent { get; set; }
- bool IsPlatformEnabled { get; set; }
- NavigationProxy NavigationProxy { get; }
- event EventHandler<EventArg</*VisualElement*/BaseHandle>> BatchCommitted;
- event EventHandler<BaseHandle.FocusRequestArgs> FocusChangeRequested;
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-using System.Reflection;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace Tizen.NUI.Binding
-{
- [TypeConverter(typeof(ImageSourceConverter))]
- internal abstract class ImageSource : Element
- {
- readonly object _synchandle = new object();
- CancellationTokenSource _cancellationTokenSource;
-
- TaskCompletionSource<bool> _completionSource;
-
- readonly WeakEventManager _weakEventManager = new WeakEventManager();
-
- protected ImageSource()
- {
- }
-
- protected CancellationTokenSource CancellationTokenSource
- {
- get { return _cancellationTokenSource; }
- private set
- {
- if (_cancellationTokenSource == value)
- return;
- if (_cancellationTokenSource != null)
- _cancellationTokenSource.Cancel();
- _cancellationTokenSource = value;
- }
- }
-
- bool IsLoading
- {
- get { return _cancellationTokenSource != null; }
- }
-
- public virtual Task<bool> Cancel()
- {
- if (!IsLoading)
- return Task.FromResult(false);
-
- var tcs = new TaskCompletionSource<bool>();
- TaskCompletionSource<bool> original = Interlocked.CompareExchange(ref _completionSource, tcs, null);
- if (original == null)
- {
- _cancellationTokenSource.Cancel();
- }
- else
- tcs = original;
-
- return tcs.Task;
- }
-
- public static ImageSource FromFile(string file)
- {
- return new FileImageSource { File = file };
- }
-
- public static ImageSource FromResource(string resource, Type resolvingType)
- {
- return FromResource(resource, resolvingType.GetTypeInfo().Assembly);
- }
-
- public static ImageSource FromResource(string resource, Assembly sourceAssembly = null)
- {
-#if NETSTANDARD2_0
- sourceAssembly = sourceAssembly ?? Assembly.GetCallingAssembly();
-#else
- if (sourceAssembly == null)
- {
- MethodInfo callingAssemblyMethod = typeof(Assembly).GetTypeInfo().GetDeclaredMethod("GetCallingAssembly");
- if (callingAssemblyMethod != null)
- {
- sourceAssembly = (Assembly)callingAssemblyMethod.Invoke(null, new object[0]);
- }
- else
- {
- Internals.Log.Warning("Warning", "Can not find CallingAssembly, pass resolvingType to FromResource to ensure proper resolution");
- return null;
- }
- }
-#endif
- return FromStream(() => sourceAssembly.GetManifestResourceStream(resource));
- }
-
- public static ImageSource FromStream(Func<Stream> stream)
- {
- // return new StreamImageSource { Stream = token => Task.Run(stream, token) };
- return null;
- }
-
- public static ImageSource FromUri(Uri uri)
- {
- if (!uri.IsAbsoluteUri)
- throw new ArgumentException("uri is relative");
- // return new UriImageSource { Uri = uri };
- return null;
- }
-
- public static implicit operator ImageSource(string source)
- {
- Uri uri;
- return Uri.TryCreate(source, UriKind.Absolute, out uri) && uri.Scheme != "file" ? FromUri(uri) : FromFile(source);
- }
-
- public static implicit operator ImageSource(Uri uri)
- {
- if (!uri.IsAbsoluteUri)
- throw new ArgumentException("uri is relative");
- return FromUri(uri);
- }
-
- protected void OnLoadingCompleted(bool cancelled)
- {
- if (!IsLoading || _completionSource == null)
- return;
-
- TaskCompletionSource<bool> tcs = Interlocked.Exchange(ref _completionSource, null);
- if (tcs != null)
- tcs.SetResult(cancelled);
-
- lock (_synchandle)
- {
- CancellationTokenSource = null;
- }
- }
-
- protected void OnLoadingStarted()
- {
- lock (_synchandle)
- {
- CancellationTokenSource = new CancellationTokenSource();
- }
- }
-
- protected void OnSourceChanged()
- {
- _weakEventManager.HandleEvent(this, EventArgs.Empty, nameof(SourceChanged));
- }
-
- internal event EventHandler SourceChanged
- {
- add { _weakEventManager.AddEventHandler(nameof(SourceChanged), value); }
- remove { _weakEventManager.RemoveEventHandler(nameof(SourceChanged), value); }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Binding
-{
- [Xaml.TypeConversion(typeof(ImageSource))]
- internal sealed class ImageSourceConverter : TypeConverter
- {
- public override object ConvertFromInvariantString(string value)
- {
- if (value != null)
- {
- Uri uri;
- return Uri.TryCreate(value, UriKind.Absolute, out uri) && uri.Scheme != "file" ? ImageSource.FromUri(uri) : ImageSource.FromFile(value);
- }
-
- throw new InvalidOperationException(string.Format("Cannot convert \"{0}\" into {1}", value, typeof(ImageSource)));
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Reflection;
-
-namespace Tizen.NUI.Binding
-{
- internal abstract class Behavior : BindableObject, IAttachedObject
- {
- internal Behavior(Type associatedType)
- {
- if (associatedType == null)
- throw new ArgumentNullException("associatedType");
- AssociatedType = associatedType;
- }
-
- protected Type AssociatedType { get; }
-
- void IAttachedObject.AttachTo(BindableObject bindable)
- {
- if (bindable == null)
- throw new ArgumentNullException("bindable");
- if (!AssociatedType.IsInstanceOfType(bindable))
- throw new InvalidOperationException("bindable not an instance of AssociatedType");
- OnAttachedTo(bindable);
- }
-
- void IAttachedObject.DetachFrom(BindableObject bindable)
- {
- OnDetachingFrom(bindable);
- }
-
- protected virtual void OnAttachedTo(BindableObject bindable)
- {
- }
-
- protected virtual void OnDetachingFrom(BindableObject bindable)
- {
- }
- }
-
- internal abstract class Behavior<T> : Behavior where T : BindableObject
- {
- protected Behavior() : base(typeof(T))
- {
- }
-
- protected override void OnAttachedTo(BindableObject bindable)
- {
- base.OnAttachedTo(bindable);
- OnAttachedTo((T)bindable);
- }
-
- protected virtual void OnAttachedTo(T bindable)
- {
- }
-
- protected override void OnDetachingFrom(BindableObject bindable)
- {
- OnDetachingFrom((T)bindable);
- base.OnDetachingFrom(bindable);
- }
-
- protected virtual void OnDetachingFrom(T bindable)
- {
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-
-namespace Tizen.NUI.Binding
-{
- [ContentProperty("Setters")]
- internal sealed class MultiTrigger : TriggerBase
- {
- public MultiTrigger([TypeConverter(typeof(TypeTypeConverter))] [Parameter("TargetType")] Type targetType) : base(new MultiCondition(), targetType)
- {
- }
-
- public IList<Condition> Conditions
- {
- get { return ((MultiCondition)Condition).Conditions; }
- }
-
- public new IList<Setter> Setters
- {
- get { return base.Setters; }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.ComponentModel;
-using System.Reflection;
-using Tizen.NUI.Binding;
-
-namespace Tizen.NUI.Xaml
-{
- [ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.PassthroughValueProvider")]
- [AcceptEmptyServiceProvider]
- internal sealed class PropertyCondition : Condition, IValueProvider
- {
- readonly BindableProperty _stateProperty;
-
- BindableProperty _property;
- object _triggerValue;
-
- public PropertyCondition()
- {
- _stateProperty = BindableProperty.CreateAttached("State", typeof(bool), typeof(PropertyCondition), false, propertyChanged: OnStatePropertyChanged);
- }
-
- public BindableProperty Property
- {
- get { return _property; }
- set
- {
- if (_property == value)
- return;
- if (IsSealed)
- throw new InvalidOperationException("Can not change Property once the Trigger has been applied.");
- _property = value;
-
- //convert the value
- if (_property != null && s_valueConverter != null)
- {
- Func<MemberInfo> minforetriever = () => Property.DeclaringType.GetRuntimeProperty(Property.PropertyName);
- Value = s_valueConverter.Convert(Value, Property.ReturnType, minforetriever, null);
- }
- }
- }
-
- public object Value
- {
- get { return _triggerValue; }
- set
- {
- if (_triggerValue == value)
- return;
- if (IsSealed)
- throw new InvalidOperationException("Can not change Value once the Trigger has been applied.");
-
- //convert the value
- if (_property != null && s_valueConverter != null)
- {
- Func<MemberInfo> minforetriever = () => Property.DeclaringType.GetRuntimeProperty(Property.PropertyName);
- value = s_valueConverter.Convert(value, Property.ReturnType, minforetriever, null);
- }
- _triggerValue = value;
- }
- }
-
- object IValueProvider.ProvideValue(IServiceProvider serviceProvider)
- {
- //This is no longer required
- return this;
- }
-
- internal override bool GetState(BindableObject bindable)
- {
- return (bool)bindable.GetValue(_stateProperty);
- }
-
- static IValueConverterProvider s_valueConverter = DependencyService.Get<IValueConverterProvider>();
-
- internal override void SetUp(BindableObject bindable)
- {
- object newvalue = bindable.GetValue(Property);
- bool newState = (newvalue == Value) || (newvalue != null && newvalue.Equals(Value));
- bindable.SetValue(_stateProperty, newState);
- bindable.PropertyChanged += OnAttachedObjectPropertyChanged;
- }
-
- internal override void TearDown(BindableObject bindable)
- {
- bindable.ClearValue(_stateProperty);
- bindable.PropertyChanged -= OnAttachedObjectPropertyChanged;
- }
-
- void OnAttachedObjectPropertyChanged(object sender, PropertyChangedEventArgs e)
- {
- var bindable = (BindableObject)sender;
- var oldState = (bool)bindable.GetValue(_stateProperty);
-
- if (Property == null)
- return;
- if (e.PropertyName != Property.PropertyName)
- return;
- object newvalue = bindable.GetValue(Property);
- bool newstate = (newvalue == Value) || (newvalue != null && newvalue.Equals(Value));
- if (oldState != newstate)
- bindable.SetValue(_stateProperty, newstate);
- }
-
- void OnStatePropertyChanged(BindableObject bindable, object oldValue, object newValue)
- {
- if ((bool)oldValue == (bool)newValue)
- return;
-
- ConditionChanged?.Invoke(bindable, (bool)oldValue, (bool)newValue);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.ComponentModel;
-
-namespace Tizen.NUI.Binding.Internals
-{
- internal class DynamicResource
- {
- public DynamicResource(string key)
- {
- Key = key;
- }
-
- public string Key { get; private set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.ComponentModel;
-using Tizen.NUI.Binding;
-
-namespace Tizen.NUI.Binding.Internals
-{
- internal interface IDynamicResourceHandler
- {
- void SetDynamicResource(BindableProperty property, string key);
- }
-}
+++ /dev/null
-using System;
-using System.ComponentModel;
-using System.Xml;
-
-namespace Tizen.NUI.Binding.Internals
-{
- internal interface INameScope
- {
- object FindByName(string name);
- void RegisterName(string name, object scopedElement);
- void UnregisterName(string name);
- [Obsolete]void RegisterName(string name, object scopedElement, IXmlLineInfo xmlLineInfo);
- }
-}
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Linq;
-using Tizen.NUI.Binding;
-
-namespace Tizen.NUI.Binding.Internals
-{
- internal abstract class Ticker
- {
- static Ticker s_ticker;
- readonly Stopwatch _stopwatch;
- readonly List<Tuple<int, Func<long, bool>>> _timeouts;
-
- int _count;
- bool _enabled;
-
- protected Ticker()
- {
- _count = 0;
- _timeouts = new List<Tuple<int, Func<long, bool>>>();
-
- _stopwatch = new Stopwatch();
- }
-
- public static void SetDefault(Ticker ticker) => Default = ticker;
- public static Ticker Default
- {
- internal set { s_ticker = value; }
- get { return s_ticker ?? (s_ticker = Device.PlatformServices.CreateTicker()); }
- }
-
- public virtual int Insert(Func<long, bool> timeout)
- {
- _count++;
- _timeouts.Add(new Tuple<int, Func<long, bool>>(_count, timeout));
-
- if (!_enabled)
- {
- _enabled = true;
- Enable();
- }
-
- return _count;
- }
-
- public virtual void Remove(int handle)
- {
- Device.BeginInvokeOnMainThread(() =>
- {
- _timeouts.RemoveAll(t => t.Item1 == handle);
-
- if (!_timeouts.Any())
- {
- _enabled = false;
- Disable();
- }
- });
- }
-
- protected abstract void DisableTimer();
-
- protected abstract void EnableTimer();
-
- protected void SendSignals(int timestep = -1)
- {
- long step = timestep >= 0 ? timestep : _stopwatch.ElapsedMilliseconds;
- _stopwatch.Reset();
- _stopwatch.Start();
-
- var localCopy = new List<Tuple<int, Func<long, bool>>>(_timeouts);
- foreach (Tuple<int, Func<long, bool>> timeout in localCopy)
- {
- bool remove = !timeout.Item2(step);
- if (remove)
- _timeouts.RemoveAll(t => t.Item1 == timeout.Item1);
- }
-
- if (!_timeouts.Any())
- {
- _enabled = false;
- Disable();
- }
- }
-
- void Disable()
- {
- _stopwatch.Reset();
- DisableTimer();
- }
-
- void Enable()
- {
- _stopwatch.Start();
- EnableTimer();
- }
- }
-}
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Collections.Specialized;
-using System.ComponentModel;
-using System.Linq;
-using Tizen.NUI.Binding.Internals;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI.Binding
-{
- [ContentProperty("Children")]
- internal abstract class Layout<T> : Layout, IViewContainer<T> where T : View
- {
- readonly ElementCollection<T> _children;
-
- protected Layout()
- {
- _children = new ElementCollection<T>(InternalChildren);
- }
-
- public new IList<T> Children
- {
- get { return _children; }
- }
-
- protected virtual void OnAdded(T view)
- {
- }
-
- protected override void OnChildAdded(Element child)
- {
- base.OnChildAdded(child);
-
- var typedChild = child as T;
- if (typedChild != null)
- OnAdded(typedChild);
- }
-
- protected override void OnChildRemoved(Element child)
- {
- base.OnChildRemoved(child);
-
- var typedChild = child as T;
- if (typedChild != null)
- OnRemoved(typedChild);
- }
-
- protected virtual void OnRemoved(T view)
- {
- }
- }
-
- internal abstract class Layout : View, ILayout, ILayoutController, IPaddingElement
- {
- public static readonly BindableProperty IsClippedToBoundsProperty = BindableProperty.Create("IsClippedToBounds", typeof(bool), typeof(Layout), false);
-
- public static readonly BindableProperty CascadeInputTransparentProperty = BindableProperty.Create(
- nameof(CascadeInputTransparent), typeof(bool), typeof(Layout), true);
-
- public static new readonly BindableProperty PaddingProperty = PaddingElement.PaddingProperty;
-
- static IList<KeyValuePair<Layout, int>> s_resolutionList = new List<KeyValuePair<Layout, int>>();
- static bool s_relayoutInProgress;
-
- bool _hasDoneLayout;
- Size _lastLayoutSize = new Size(-1, -1, 0);
-
- ReadOnlyCollection<Element> _logicalChildren;
-
- protected Layout()
- {
- //if things were added in base ctor (through implicit styles), the items added aren't properly parented
- if (InternalChildren.Count > 0)
- InternalChildrenOnCollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, InternalChildren));
-
- InternalChildren.CollectionChanged += InternalChildrenOnCollectionChanged;
- }
-
- public bool IsClippedToBounds
- {
- get { return (bool)GetValue(IsClippedToBoundsProperty); }
- set { SetValue(IsClippedToBoundsProperty, value); }
- }
-
- public new Thickness Padding
- {
- get { return (Thickness)GetValue(PaddingElement.PaddingProperty); }
- set { SetValue(PaddingElement.PaddingProperty, value); }
- }
-
- public bool CascadeInputTransparent
- {
- get { return (bool)GetValue(CascadeInputTransparentProperty); }
- set { SetValue(CascadeInputTransparentProperty, value); }
- }
-
- Thickness IPaddingElement.PaddingDefaultValueCreator()
- {
- return default(Thickness);
- }
-
- void IPaddingElement.OnPaddingPropertyChanged(Thickness oldValue, Thickness newValue)
- {
- UpdateChildrenLayout();
- }
-
- internal ObservableCollection<Element> InternalChildren { get; } = new ObservableCollection<Element>();
-
- internal override ReadOnlyCollection<Element> LogicalChildrenInternal
- {
- get { return _logicalChildren ?? (_logicalChildren = new ReadOnlyCollection<Element>(InternalChildren)); }
- }
-
- /// <summary>
- /// Raised when the layout of the Page has changed.
- /// </summary>
- public event EventHandler LayoutChanged;
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public new IReadOnlyList<Element> Children
- {
- get { return InternalChildren; }
- }
-
- public void ForceLayout()
- {
- }
-
-
- public static void LayoutChildIntoBoundingRegion(BaseHandle child, Rectangle region)
- {
- var view = child as View;
- if (view == null)
- {
- return;
- }
- }
-
- public void LowerChild(View view)
- {
- if (!InternalChildren.Contains(view) || (InternalChildren.First() as BaseHandle) == view)
- return;
-
- InternalChildren.Move(InternalChildren.IndexOf(view), 0);
- }
-
- public void RaiseChild(View view)
- {
- if (!InternalChildren.Contains(view) || (InternalChildren.Last() as BaseHandle) == view)
- return;
-
- InternalChildren.Move(InternalChildren.IndexOf(view), InternalChildren.Count - 1);
- }
-
- protected virtual void InvalidateLayout()
- {
- _hasDoneLayout = false;
- if (!_hasDoneLayout)
- ForceLayout();
- }
-
- protected abstract void LayoutChildren(double x, double y, double width, double height);
-
- protected void OnChildMeasureInvalidated(object sender, EventArgs e)
- {
- InvalidationTrigger trigger = (e as InvalidationEventArgs)?.Trigger ?? InvalidationTrigger.Undefined;
- OnChildMeasureInvalidated((BaseHandle)sender, trigger);
- OnChildMeasureInvalidated();
- }
-
- protected virtual void OnChildMeasureInvalidated()
- {
- }
-
- protected virtual bool ShouldInvalidateOnChildAdded(View child)
- {
- return true;
- }
-
- protected virtual bool ShouldInvalidateOnChildRemoved(View child)
- {
- return true;
- }
-
- protected void UpdateChildrenLayout()
- {
- _hasDoneLayout = true;
-
- if (!ShouldLayoutChildren())
- return;
-
- LayoutChanged?.Invoke(this, EventArgs.Empty);
- }
-
- internal static void LayoutChildIntoBoundingRegion(View child, Rectangle region, SizeRequest childSizeRequest)
- {
- }
-
- internal virtual void OnChildMeasureInvalidated(BaseHandle child, InvalidationTrigger trigger)
- {
- ReadOnlyCollection<Element> children = LogicalChildrenInternal;
- int count = children.Count;
- for (var index = 0; index < count; index++)
- {
- var v = LogicalChildrenInternal[index] as BaseHandle;
- if (v != null)
- {
- return;
- }
- }
-
- var view = child as View;
- if (view != null)
- {
- //we can ignore the request if we are either fully constrained or when the size request changes and we were already fully constrainted
- if ((trigger == InvalidationTrigger.MeasureChanged) ||
- (trigger == InvalidationTrigger.SizeRequestChanged))
- {
- return;
- }
- }
-
- s_resolutionList.Add(new KeyValuePair<Layout, int>(this, GetElementDepth(this)));
- if (!s_relayoutInProgress)
- {
- s_relayoutInProgress = true;
- Device.BeginInvokeOnMainThread(() =>
- {
- // if thread safety mattered we would need to lock this and compareexchange above
- IList<KeyValuePair<Layout, int>> copy = s_resolutionList;
- s_resolutionList = new List<KeyValuePair<Layout, int>>();
- s_relayoutInProgress = false;
- });
- }
- }
-
- static int GetElementDepth(Element view)
- {
- var result = 0;
- while (view.Parent != null)
- {
- result++;
- view = view.Parent;
- }
- return result;
- }
-
- void InternalChildrenOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
- {
- if (e.Action == NotifyCollectionChangedAction.Move)
- {
- return;
- }
-
- if (e.OldItems != null)
- {
- foreach (object item in e.OldItems)
- {
- var v = item as View;
- if (v == null)
- continue;
-
- OnInternalRemoved(v);
- }
- }
-
- if (e.NewItems != null)
- {
- foreach (object item in e.NewItems)
- {
- var v = item as View;
- if (v == null)
- continue;
-
- if ((item as BaseHandle) == this)
- throw new InvalidOperationException("Can not add self to own child collection.");
-
- OnInternalAdded(v);
- }
- }
- }
-
- void OnInternalAdded(View view)
- {
- var parent = view.GetParent() as Layout;
- parent?.InternalChildren.Remove(view);
-
- OnChildAdded(view);
- if (ShouldInvalidateOnChildAdded(view))
- InvalidateLayout();
- }
-
- void OnInternalRemoved(View view)
- {
- OnChildRemoved(view);
- if (ShouldInvalidateOnChildRemoved(view))
- InvalidateLayout();
- }
-
- bool ShouldLayoutChildren()
- {
- if ( !LogicalChildrenInternal.Any() )
- {
- return false;
- }
-
- foreach (Element element in VisibleDescendants())
- {
- var visual = element as BaseHandle;
- if (visual == null)
- {
- continue;
- }
- }
- return true;
- }
- }
-}
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Binding
-{
- [Flags]
- internal enum LayoutAlignment
- {
- Start = 0,
- Center = 1,
- End = 2,
- Fill = 3
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Binding
-{
- [Flags]
- internal enum LayoutExpandFlag
- {
- Expand = 4
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Binding
-{
- [TypeConverter(typeof(LayoutOptionsConverter))]
- internal struct LayoutOptions
- {
- int _flags;
-
- public static readonly LayoutOptions Start = new LayoutOptions(LayoutAlignment.Start, false);
- public static readonly LayoutOptions Center = new LayoutOptions(LayoutAlignment.Center, false);
- public static readonly LayoutOptions End = new LayoutOptions(LayoutAlignment.End, false);
- public static readonly LayoutOptions Fill = new LayoutOptions(LayoutAlignment.Fill, false);
- public static readonly LayoutOptions StartAndExpand = new LayoutOptions(LayoutAlignment.Start, true);
- public static readonly LayoutOptions CenterAndExpand = new LayoutOptions(LayoutAlignment.Center, true);
- public static readonly LayoutOptions EndAndExpand = new LayoutOptions(LayoutAlignment.End, true);
- public static readonly LayoutOptions FillAndExpand = new LayoutOptions(LayoutAlignment.Fill, true);
-
- public LayoutOptions(LayoutAlignment alignment, bool expands)
- {
- var a = (int)alignment;
- if (a < 0 || a > 3)
- throw new ArgumentOutOfRangeException();
- _flags = (int)alignment | (expands ? (int)LayoutExpandFlag.Expand : 0);
- }
-
- public LayoutAlignment Alignment
- {
- get { return (LayoutAlignment)(_flags & 3); }
- set { _flags = (_flags & ~3) | (int)value; }
- }
-
- public bool Expands
- {
- get { return (_flags & (int)LayoutExpandFlag.Expand) != 0; }
- set { _flags = (_flags & 3) | (value ? (int)LayoutExpandFlag.Expand : 0); }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Linq;
-using System.Reflection;
-using Tizen.NUI.Binding.Internals;
-
-using Tizen.NUI;
-
-namespace Tizen.NUI.Binding
-{
- [Xaml.ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.LayoutOptionsConverter")]
- [Xaml.TypeConversion(typeof(LayoutOptions))]
- internal sealed class LayoutOptionsConverter : TypeConverter
- {
- public override object ConvertFromInvariantString(string value)
- {
- if (value != null) {
- var parts = value.Split('.');
- if (parts.Length > 2 || (parts.Length == 2 && parts [0] != "LayoutOptions"))
- throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(LayoutOptions)}");
- value = parts [parts.Length - 1];
- switch (value) {
- case "Start": return LayoutOptions.Start;
- case "Center": return LayoutOptions.Center;
- case "End": return LayoutOptions.End;
- case "Fill": return LayoutOptions.Fill;
- case "StartAndExpand": return LayoutOptions.StartAndExpand;
- case "CenterAndExpand": return LayoutOptions.CenterAndExpand;
- case "EndAndExpand": return LayoutOptions.EndAndExpand;
- case "FillAndExpand": return LayoutOptions.FillAndExpand;
- }
- FieldInfo field = typeof(LayoutOptions).GetFields().FirstOrDefault(fi => fi.IsStatic && fi.Name == value);
- if (field != null)
- return (LayoutOptions)field.GetValue(null);
- }
-
- throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(LayoutOptions)}");
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Windows.Input;
-
-namespace Tizen.NUI.Binding
-{
-
- internal class MenuItem : BaseMenuItem, IMenuItemController
- {
- public static readonly BindableProperty AcceleratorProperty = BindableProperty.CreateAttached(nameof(Accelerator), typeof(Accelerator), typeof(MenuItem), null);
-
- public static Accelerator GetAccelerator(BindableObject bindable) => (Accelerator)bindable.GetValue(AcceleratorProperty);
-
- public static void SetAccelerator(BindableObject bindable, Accelerator value) => bindable.SetValue(AcceleratorProperty, value);
-
- public static readonly BindableProperty TextProperty = BindableProperty.Create("Text", typeof(string), typeof(MenuItem), null);
-
- public static readonly BindableProperty CommandProperty = BindableProperty.Create("Command", typeof(ICommand), typeof(MenuItem), null,
- propertyChanging: (bo, o, n) => ((MenuItem)bo).OnCommandChanging(), propertyChanged: (bo, o, n) => ((MenuItem)bo).OnCommandChanged());
-
- public static readonly BindableProperty CommandParameterProperty = BindableProperty.Create("CommandParameter", typeof(object), typeof(MenuItem), null,
- propertyChanged: (bo, o, n) => ((MenuItem)bo).OnCommandParameterChanged());
-
- public static readonly BindableProperty IsDestructiveProperty = BindableProperty.Create("IsDestructive", typeof(bool), typeof(MenuItem), false);
-
- public static readonly BindableProperty IconProperty = BindableProperty.Create("Icon", typeof(FileImageSource), typeof(MenuItem), default(FileImageSource));
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty IsEnabledProperty = BindableProperty.Create("IsEnabled", typeof(bool), typeof(ToolbarItem), true);
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string IsEnabledPropertyName
- {
- get
- {
- return IsEnabledProperty.PropertyName;
- }
- }
-
- public ICommand Command
- {
- get { return (ICommand)GetValue(CommandProperty); }
- set { SetValue(CommandProperty, value); }
- }
-
- public object CommandParameter
- {
- get { return GetValue(CommandParameterProperty); }
- set { SetValue(CommandParameterProperty, value); }
- }
-
- public FileImageSource Icon
- {
- get { return (FileImageSource)GetValue(IconProperty); }
- set { SetValue(IconProperty, value); }
- }
-
- public bool IsDestructive
- {
- get { return (bool)GetValue(IsDestructiveProperty); }
- set { SetValue(IsDestructiveProperty, value); }
- }
-
- public string Text
- {
- get { return (string)GetValue(TextProperty); }
- set { SetValue(TextProperty, value); }
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool IsEnabled
- {
- get { return (bool)GetValue(IsEnabledProperty); }
- set { SetValue(IsEnabledProperty, value); }
- }
-
- bool IsEnabledCore
- {
- set { SetValueCore(IsEnabledProperty, value); }
- }
-
- public event EventHandler Clicked;
-
- protected virtual void OnClicked()
- => Clicked?.Invoke(this, EventArgs.Empty);
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void Activate()
- {
- if (Command != null)
- {
- if (IsEnabled)
- Command.Execute(CommandParameter);
- }
-
- OnClicked();
- }
-
- void OnCommandCanExecuteChanged(object sender, EventArgs eventArgs)
- {
- IsEnabledCore = Command.CanExecute(CommandParameter);
- }
-
- void OnCommandChanged()
- {
- if (Command == null)
- {
- IsEnabledCore = true;
- return;
- }
-
- IsEnabledCore = Command.CanExecute(CommandParameter);
-
- Command.CanExecuteChanged += OnCommandCanExecuteChanged;
- }
-
- void OnCommandChanging()
- {
- if (Command == null)
- return;
-
- Command.CanExecuteChanged -= OnCommandCanExecuteChanged;
- }
-
- void OnCommandParameterChanged()
- {
- if (Command == null)
- return;
-
- IsEnabledCore = Command.CanExecute(CommandParameter);
- }
- }
-}
\ No newline at end of file
{
////If the base type is one of these, stop registering dynamic resources further
////The last one (typeof(Element)) is a safety guard as we might be creating VisualElement directly in internal code
- static readonly IList<Type> s_stopAtTypes = new List<Type> { typeof(View), typeof(Layout<>), typeof(Element) };
+ static readonly IList<Type> s_stopAtTypes = new List<Type> { typeof(View), typeof(Element) };
IList<BindableProperty> _classStyleProperties;
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Binding
-{
- internal abstract class ModalEventArgs : EventArgs
- {
- protected ModalEventArgs(Page modal)
- {
- Modal = modal;
- }
-
- public Page Modal { get; private set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace Tizen.NUI.Binding
-{
- internal class ModalPoppedEventArgs : ModalEventArgs
- {
- public ModalPoppedEventArgs(Page modal) : base(modal)
- {
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace Tizen.NUI.Binding
-{
- internal class ModalPoppingEventArgs : ModalEventArgs
- {
- public ModalPoppingEventArgs(Page modal) : base(modal)
- {
- }
-
- public bool Cancel { get; set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace Tizen.NUI.Binding
-{
- internal class ModalPushedEventArgs : ModalEventArgs
- {
- public ModalPushedEventArgs(Page modal) : base(modal)
- {
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace Tizen.NUI.Binding
-{
- internal class ModalPushingEventArgs : ModalEventArgs
- {
- public ModalPushingEventArgs(Page modal) : base(modal)
- {
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace Tizen.NUI.Binding
-{
- internal enum NamedSize
- {
- Default = 0,
- Micro = 1,
- Small = 2,
- Medium = 3,
- Large = 4
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.ComponentModel;
-
-namespace Tizen.NUI.Binding
-{
- /// <summary>
- /// EventArgs for the NavigationPage's navigation events.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- internal class NavigationEventArgs : EventArgs
- {
- /// <summary>
- /// Create a NavigationEventArgs instance.
- /// </summary>
- /// <param name="page">The page that was popped or is newly visible.</param>
- public NavigationEventArgs(Page page)
- {
- if (page == null)
- throw new ArgumentNullException("page");
-
- Page = page;
- }
-
- /// <summary>
- /// Gets the page that was removed or is newly visible.
- /// </summary>
- public Page Page { get; private set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Linq;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI.Binding
-{
- // Mark as internal until renderers are ready for release after 1.0
- // [RenderWith(typeof(_NavigationMenuRenderer))]
- [EditorBrowsable(EditorBrowsableState.Never)]
- internal class NavigationMenu : View, /*INavigationMenuController,*/ IElementConfiguration<NavigationMenu>
- {
- readonly List<Page> _targets = new List<Page>();
-
- readonly Lazy<PlatformConfigurationRegistry<NavigationMenu>> _platformConfigurationRegistry;
-
- public NavigationMenu()
- {
- _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<NavigationMenu>>(() => new PlatformConfigurationRegistry<NavigationMenu>(this));
- }
-
- public IEnumerable<Page> Targets
- {
- get { return _targets; }
- set
- {
- if (_targets.AsEnumerable().SequenceEqual(value))
- return;
-
- foreach (Page page in value)
- {
- VerifyTarget(page);
- }
-
- OnPropertyChanging();
- _targets.Clear();
- _targets.AddRange(value);
- OnPropertyChanged();
- }
- }
-
- public void Add(Page target)
- {
- if (_targets.Contains(target))
- return;
- VerifyTarget(target);
-
- OnPropertyChanging("Targets");
- _targets.Add(target);
- OnPropertyChanged("Targets");
- }
-
- public void Remove(Page target)
- {
- if (_targets.Contains(target))
- {
- OnPropertyChanging("Targets");
- if (_targets.Remove(target))
- OnPropertyChanged("Targets");
- }
- }
-
- public IPlatformElementConfiguration<T, NavigationMenu> On<T>() where T : IConfigPlatform
- {
- return _platformConfigurationRegistry.Value.On<T>();
- }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void SendTargetSelected(Page target)
- {
- Navigation.PushAsync(target);
- }
-
- void VerifyTarget(Page target)
- {
- if (target.Icon == null || string.IsNullOrWhiteSpace(target.Icon.File))
- throw new Exception("Icon must be set for each page before adding them to a Navigation Menu");
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Linq;
-
-namespace Tizen.NUI.Binding
-{
- [EditorBrowsable(EditorBrowsableState.Never)]
- internal class NavigationModel
- {
- readonly List<Page> _modalStack = new List<Page>();
- readonly List<List<Page>> _navTree = new List<List<Page>>();
-
- public Page CurrentPage
- {
- get
- {
- if (_navTree.Any())
- return _navTree.Last().Last();
- return null;
- }
- }
-
- public IEnumerable<Page> Modals
- {
- get { return _modalStack; }
- }
-
- public IEnumerable<Page> Roots
- {
- get
- {
- foreach (List<Page> list in _navTree)
- {
- yield return list[0];
- }
- }
- }
-
- public IReadOnlyList<IReadOnlyList<Page>> Tree
- {
- get { return _navTree; }
- }
-
- public void Clear()
- {
- _navTree.Clear();
- _modalStack.Clear();
- }
-
- public void InsertPageBefore(Page page, Page before)
- {
- List<Page> currentStack = _navTree.Last();
- int index = currentStack.IndexOf(before);
-
- if (index == -1)
- throw new ArgumentException("before must be in the current navigation context");
-
- currentStack.Insert(index, page);
- }
-
- public Page Pop(Page ancestralNav)
- {
- ancestralNav = AncestorToRoot(ancestralNav);
- foreach (List<Page> stack in _navTree)
- {
- if (stack.Contains(ancestralNav))
- {
- if (stack.Count <= 1)
- throw new InvalidNavigationException("Can not pop final item in stack");
- Page result = stack.Last();
- stack.Remove(result);
- return result;
- }
- }
-
- throw new InvalidNavigationException("Popped from unpushed item?");
- }
-
- public Page PopModal()
- {
- if (_navTree.Count <= 1)
- throw new InvalidNavigationException("Can't pop modal without any modals pushed");
- Page modal = _navTree.Last().First();
- _modalStack.Remove(modal);
- _navTree.Remove(_navTree.Last());
- return modal;
- }
-
- public Page PopTopPage()
- {
- Page itemToRemove;
- if (_navTree.Count == 1)
- {
- if (_navTree[0].Count > 1)
- {
- itemToRemove = _navTree[0].Last();
- _navTree[0].Remove(itemToRemove);
- return itemToRemove;
- }
- return null;
- }
- itemToRemove = _navTree.Last().Last();
- _navTree.Last().Remove(itemToRemove);
- if (!_navTree.Last().Any())
- {
- _navTree.RemoveAt(_navTree.Count - 1);
- }
- return itemToRemove;
- }
-
- public void PopToRoot(Page ancestralNav)
- {
- ancestralNav = AncestorToRoot(ancestralNav);
- foreach (List<Page> stack in _navTree)
- {
- if (stack.Contains(ancestralNav))
- {
- if (stack.Count <= 1)
- throw new InvalidNavigationException("Can not pop final item in stack");
- stack.RemoveRange(1, stack.Count - 1);
- return;
- }
- }
-
- throw new InvalidNavigationException("Popped from unpushed item?");
- }
-
- public void Push(Page page, Page ancestralNav)
- {
- if (ancestralNav == null)
- {
- if (_navTree.Any())
- throw new InvalidNavigationException("Ancestor must be provided for all pushes except first");
- _navTree.Add(new List<Page> { page });
- return;
- }
-
- ancestralNav = AncestorToRoot(ancestralNav);
-
- foreach (List<Page> stack in _navTree)
- {
- if (stack.Contains(ancestralNav))
- {
- stack.Add(page);
- return;
- }
- }
-
- throw new InvalidNavigationException("Invalid ancestor passed");
- }
-
- public void PushModal(Page page)
- {
- _navTree.Add(new List<Page> { page });
- _modalStack.Add(page);
- }
-
- public bool RemovePage(Page page)
- {
- bool found;
- List<Page> currentStack = _navTree.Last();
- var i = 0;
- while (!(found = currentStack.Remove(page)) && i < _navTree.Count - 1)
- {
- currentStack = _navTree[i++];
- }
-
- return found;
- }
-
- Page AncestorToRoot(Page ancestor)
- {
- Page result = ancestor;
- // while (!Application.IsApplicationOrNull(result.RealParent))
- result = (Page)result.RealParent;
- return result;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Linq;
-using System.Threading.Tasks;
-using Tizen.NUI.Binding.Internals;
-using Tizen.NUI.Binding;
-
-namespace Tizen.NUI
-{
- /// <summary>
- /// A Page that manages the navigation and user-experience of a stack of other pages.
- /// </summary>
- // [RenderWith(typeof(_NavigationPageRenderer))]
- [EditorBrowsable(EditorBrowsableState.Never)]
- internal class NavigationPage : Page, IPageContainer<Page>, INavigationPageController, IElementConfiguration<NavigationPage>
- {
- /// <summary>
- /// Identifies the property associated with the title of the back button.
- /// </summary>
- public static readonly BindableProperty BackButtonTitleProperty = BindableProperty.CreateAttached("BackButtonTitle", typeof(string), typeof(Page), null);
-
- /// <summary>
- /// Backing store for the HasNavigationBar property.
- /// </summary>
- public static readonly BindableProperty HasNavigationBarProperty = BindableProperty.CreateAttached("HasNavigationBar", typeof(bool), typeof(Page), true);
-
- /// <summary>
- /// Backing store for the HasBackButton property.
- /// </summary>
- public static readonly BindableProperty HasBackButtonProperty = BindableProperty.CreateAttached("HasBackButton", typeof(bool), typeof(NavigationPage), true);
-
- /// <summary>
- /// Identifies the Tint bindable property.
- /// </summary>
- [Obsolete("TintProperty is obsolete as of version 1.2.0. Please use BarBackgroundColorProperty and BarTextColorProperty to change NavigationPage bar color properties.")]
- public static readonly BindableProperty TintProperty = BindableProperty.Create("Tint", typeof(Color), typeof(NavigationPage), /*Color.Default*/Color.Black);
-
- /// <summary>
- /// Identifies the property associated with the color of the NavigationPage's bar background color.
- /// </summary>
- public static readonly BindableProperty BarBackgroundColorProperty = BindableProperty.Create("BarBackgroundColor", typeof(Color), typeof(NavigationPage), /*Color.Default*/Color.Black);
-
- /// <summary>
- /// Identifies the property associated with the color of the NavigationPage's bar text color.
- /// </summary>
- public static readonly BindableProperty BarTextColorProperty = BindableProperty.Create("BarTextColor", typeof(Color), typeof(NavigationPage), /*Color.Default*/Color.Black);
-
- /// <summary>
- /// Indicates the NavigationPage.SetTitleIcon/NavigationPage.GetTitleIcon property.
- /// </summary>
- public static readonly BindableProperty TitleIconProperty = BindableProperty.CreateAttached("TitleIcon", typeof(FileImageSource), typeof(NavigationPage), default(FileImageSource));
-
- static readonly BindablePropertyKey CurrentPagePropertyKey = BindableProperty.CreateReadOnly("CurrentPage", typeof(Page), typeof(NavigationPage), null);
-
- /// <summary>
- /// Identifies the property associated with NavigationPage.CurrentPage
- /// </summary>
- public static readonly BindableProperty CurrentPageProperty = CurrentPagePropertyKey.BindableProperty;
-
- static readonly BindablePropertyKey RootPagePropertyKey = BindableProperty.CreateReadOnly(nameof(RootPage), typeof(Page), typeof(NavigationPage), null);
- /// <summary>
- /// Identifies the property associated with NavigationPage.RootPage
- /// </summary>
- public static readonly BindableProperty RootPageProperty = RootPagePropertyKey.BindableProperty;
-
- /// <summary>
- /// Initializes a new NavigationPage object.
- /// </summary>
- public NavigationPage()
- {
- _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<NavigationPage>>(() => new PlatformConfigurationRegistry<NavigationPage>(this));
-
- Navigation = new NavigationImpl(this);
- }
-
- /// <summary>
- /// Creates a new NavigationPage element with root as its root element.
- /// </summary>
- /// <param name="root">The root page.</param>
- public NavigationPage(Page root) : this()
- {
- PushPage(root);
- }
-
- /// <summary>
- /// Gets or sets the background color for the bar at the top of the NavigationPage.
- /// </summary>
- public Color BarBackgroundColor
- {
- get { return (Color)GetValue(BarBackgroundColorProperty); }
- set { SetValue(BarBackgroundColorProperty, value); }
- }
-
- /// <summary>
- /// Gets or sets the text that appears on the bar at the top of the NavigationPage.
- /// </summary>
- public Color BarTextColor
- {
- get { return (Color)GetValue(BarTextColorProperty); }
- set { SetValue(BarTextColorProperty, value); }
- }
-
- /// <summary>
- /// The color to be used as the Tint of the NavigationPage.
- /// </summary>
- [Obsolete("Tint is obsolete as of version 1.2.0. Please use BarBackgroundColor and BarTextColor to change NavigationPage bar color properties.")]
- public Color Tint
- {
- get { return (Color)GetValue(TintProperty); }
- set { SetValue(TintProperty, value); }
- }
-
- internal Task CurrentNavigationTask { get; set; }
-
- /// <summary>
- /// For internal use
- /// </summary>
- /// <param name="depth">The depth</param>
- /// <returns>The page instance</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Page Peek(int depth)
- {
- if (depth < 0)
- {
- return null;
- }
-
- if (InternalChildren.Count <= depth)
- {
- return null;
- }
-
- return (Page)InternalChildren[InternalChildren.Count - depth - 1];
- }
-
- /// <summary>
- /// For internal use.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public IEnumerable<Page> Pages => InternalChildren.Cast<Page>();
-
- /// <summary>
- /// For internal use
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int StackDepth
- {
- get { return InternalChildren.Count; }
- }
-
- /// <summary>
- /// The Page that is currently top-most on the navigation stack.
- /// </summary>
- public Page CurrentPage
- {
- get { return (Page)GetValue(CurrentPageProperty); }
- private set { SetValue(CurrentPagePropertyKey, value); }
- }
-
- /// <summary>
- /// The Page that is the root of the navigation stack.
- /// </summary>
- public Page RootPage
- {
- get { return (Page)GetValue(RootPageProperty); }
- private set { SetValue(RootPagePropertyKey, value); }
- }
-
- /// <summary>
- /// The title of the back button for the specified page.
- /// </summary>
- /// <param name="page">The Page whose back-button's title is being requested.</param>
- /// <returns>The title of the back button that would be shown if the specified page were the Tizen.NUI.Xaml.CurrentPage.</returns>
- public static string GetBackButtonTitle(BindableObject page)
- {
- return (string)page.GetValue(BackButtonTitleProperty);
- }
-
- /// <summary>
- /// Returns a value that indicates whether page has a back button.
- /// </summary>
- /// <param name="page">The page to be checked</param>
- /// <returns>true if the page has a back button.</returns>
- public static bool GetHasBackButton(Page page)
- {
- if (page == null)
- throw new ArgumentNullException("page");
- return (bool)page.GetValue(HasBackButtonProperty);
- }
-
- /// <summary>
- /// Returns a value that indicates whether the page has a navigation bar.
- /// </summary>
- /// <param name="page">The Page being queried.</param>
- /// <returns>true if page would display a navigation bar were it the CurrentPage.</returns>
- public static bool GetHasNavigationBar(BindableObject page)
- {
- return (bool)page.GetValue(HasNavigationBarProperty);
- }
-
- internal static FileImageSource GetTitleIcon(BindableObject bindable)
- {
- return (FileImageSource)bindable.GetValue(TitleIconProperty);
- }
-
- /// <summary>
- /// Asynchronously removes the top Page from the navigation stack.
- /// </summary>
- /// <returns>The Page that had been at the top of the navigation stack.</returns>
- public Task<Page> PopAsync()
- {
- return PopAsync(true);
- }
-
- /// <summary>
- /// Asynchronously removes the top Page from the navigation stack, with optional animation.
- /// </summary>
- /// <param name="animated">Whether to animate the pop.</param>
- /// <returns>The Page that had been at the top of the navigation stack.</returns>
- public async Task<Page> PopAsync(bool animated)
- {
- var tcs = new TaskCompletionSource<bool>();
- if (CurrentNavigationTask != null && !CurrentNavigationTask.IsCompleted)
- {
- var oldTask = CurrentNavigationTask;
- CurrentNavigationTask = tcs.Task;
- await oldTask;
- }
- else
- CurrentNavigationTask = tcs.Task;
-
- var result = await PopAsyncInner(animated, false);
- tcs.SetResult(true);
- return result;
- }
-
- /// <summary>
- /// Event that is raised after a page is popped from this NavigationPage element.
- /// </summary>
- public event EventHandler<NavigationEventArgs> Popped;
-
- /// <summary>
- /// Pops all but the root Page off the navigation stack.
- /// </summary>
- /// <returns>A task that represents the asynchronous dismiss operation.</returns>
- public Task PopToRootAsync()
- {
- return PopToRootAsync(true);
- }
-
- /// <summary>
- /// A task for asynchronously popping all pages off of the navigation stack.
- /// </summary>
- /// <param name="animated">Whether to animate the pop.</param>
- /// <returns>A task that represents the asynchronous dismiss operation.</returns>
- public async Task PopToRootAsync(bool animated)
- {
- if (CurrentNavigationTask != null && !CurrentNavigationTask.IsCompleted)
- {
- var tcs = new TaskCompletionSource<bool>();
- Task oldTask = CurrentNavigationTask;
- CurrentNavigationTask = tcs.Task;
- await oldTask;
-
- await PopToRootAsyncInner(animated);
- tcs.SetResult(true);
- return;
- }
-
- Task result = PopToRootAsyncInner(animated);
- CurrentNavigationTask = result;
- await result;
- }
-
- /// <summary>
- /// Presents a Page modally.
- /// </summary>
- /// <param name="page">The Page to present modally.</param>
- /// <returns>An awaitable Task, indicating the PushModal completion.</returns>
- public Task PushAsync(Page page)
- {
- return PushAsync(page, true);
- }
-
- /// <summary>
- /// A task for asynchronously pushing a page onto the navigation stack, with optional animation.
- /// </summary>
- /// <param name="page">The Page to present modally.</param>
- /// <param name="animated">Whether to animate the pop.</param>
- /// <returns>An awaitable Task, indicating the PushModal completion.</returns>
- public async Task PushAsync(Page page, bool animated)
- {
- if (CurrentNavigationTask != null && !CurrentNavigationTask.IsCompleted)
- {
- var tcs = new TaskCompletionSource<bool>();
- Task oldTask = CurrentNavigationTask;
- CurrentNavigationTask = tcs.Task;
- await oldTask;
-
- await PushAsyncInner(page, animated);
- tcs.SetResult(true);
- return;
- }
-
- CurrentNavigationTask = PushAsyncInner(page, animated);
- await CurrentNavigationTask;
- }
-
- /// <summary>
- /// Event that is raised when a page is pushed onto this NavigationPage element.
- /// </summary>
- public event EventHandler<NavigationEventArgs> Pushed;
-
- /// <summary>
- /// Sets the title that appears on the back button for page.
- /// </summary>
- /// <param name="page">The BindableObject object.</param>
- /// <param name="value">The value to set.</param>
- public static void SetBackButtonTitle(BindableObject page, string value)
- {
- page.SetValue(BackButtonTitleProperty, value);
- }
-
- /// <summary>
- /// Adds or removes a back button to page, with optional animation.
- /// </summary>
- /// <param name="page">The page object.</param>
- /// <param name="value">The value to set.</param>
- public static void SetHasBackButton(Page page, bool value)
- {
- if (page == null)
- throw new ArgumentNullException("page");
- page.SetValue(HasBackButtonProperty, value);
- }
-
- /// <summary>
- /// Sets a value that indicates whether or not this NavigationPage element has a navigation bar.
- /// </summary>
- /// <param name="page">The BindableObject object</param>
- /// <param name="value">The value to set</param>
- public static void SetHasNavigationBar(BindableObject page, bool value)
- {
- page.SetValue(HasNavigationBarProperty, value);
- }
-
- internal static void SetTitleIcon(BindableObject bindable, FileImageSource value)
- {
- bindable.SetValue(TitleIconProperty, value);
- }
-
- /// <summary>
- /// Event that is raised when the hardware back button is pressed.
- /// </summary>
- /// <returns>true if consumed</returns>
- protected override bool OnBackButtonPressed()
- {
- if (CurrentPage.SendBackButtonPressed())
- return true;
-
- if (StackDepth > 1)
- {
- SafePop();
- return true;
- }
-
- return base.OnBackButtonPressed();
- }
-
- /// <summary>
- /// For internal use
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<NavigationRequestedEventArgs> InsertPageBeforeRequested;
-
- /// <summary>
- /// For internal use
- /// </summary>
- /// <param name="animated">Whether animate the pop.</param>
- /// <param name="fast"></param>
- /// <returns>A task that represents the asynchronous dismiss operation.</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public async Task<Page> PopAsyncInner(bool animated, bool fast)
- {
- if (StackDepth == 1)
- {
- return null;
- }
-
- var page = (Page)InternalChildren.Last();
-
- return await (this as INavigationPageController).RemoveAsyncInner(page, animated, fast);
- }
-
- async Task<Page> INavigationPageController.RemoveAsyncInner(Page page, bool animated, bool fast)
- {
- if (StackDepth == 1)
- {
- return null;
- }
-
- var args = new NavigationRequestedEventArgs(page, animated);
-
- var removed = true;
-
- EventHandler<NavigationRequestedEventArgs> requestPop = PopRequested;
- if (requestPop != null)
- {
- requestPop(this, args);
-
- if (args.Task != null && !fast)
- removed = await args.Task;
- }
-
- if (!removed && !fast)
- return CurrentPage;
-
- InternalChildren.Remove(page);
-
- CurrentPage = (Page)InternalChildren.Last();
-
- if (Popped != null)
- Popped(this, args);
-
- return page;
- }
-
- /// <summary>
- /// For internal use.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<NavigationRequestedEventArgs> PopRequested;
-
- /// <summary>
- /// For internal use.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<NavigationRequestedEventArgs> PopToRootRequested;
-
- /// <summary>
- /// For internal use.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<NavigationRequestedEventArgs> PushRequested;
-
- /// <summary>
- /// For internal use.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<NavigationRequestedEventArgs> RemovePageRequested;
-
- void InsertPageBefore(Page page, Page before)
- {
- if (page == null)
- throw new ArgumentNullException($"{nameof(page)} cannot be null.");
-
- if (before == null)
- throw new ArgumentNullException($"{nameof(before)} cannot be null.");
-
- if (!InternalChildren.Contains(before))
- throw new ArgumentException($"{nameof(before)} must be a child of the NavigationPage", nameof(before));
-
- if (InternalChildren.Contains(page))
- throw new ArgumentException("Cannot insert page which is already in the navigation stack");
-
- EventHandler<NavigationRequestedEventArgs> handler = InsertPageBeforeRequested;
- handler?.Invoke(this, new NavigationRequestedEventArgs(page, before, false));
-
- int index = InternalChildren.IndexOf(before);
- InternalChildren.Insert(index, page);
-
- if (index == 0)
- RootPage = page;
-
- // Shouldn't be required?
- // if (Width > 0 && Height > 0)
- ForceLayout();
- }
-
- async Task PopToRootAsyncInner(bool animated)
- {
- if (StackDepth == 1)
- return;
-
- Element[] childrenToRemove = InternalChildren.Skip(1).ToArray();
- foreach (Element child in childrenToRemove)
- InternalChildren.Remove(child);
-
- CurrentPage = RootPage;
-
- var args = new NavigationRequestedEventArgs(RootPage, animated);
-
- EventHandler<NavigationRequestedEventArgs> requestPopToRoot = PopToRootRequested;
- if (requestPopToRoot != null)
- {
- requestPopToRoot(this, args);
-
- if (args.Task != null)
- await args.Task;
- }
-
- // PoppedToRoot?.Invoke(this, new PoppedToRootEventArgs(RootPage, childrenToRemove.OfType<Page>().ToList()));
- }
-
- async Task PushAsyncInner(Page page, bool animated)
- {
- if (InternalChildren.Contains(page))
- return;
-
- PushPage(page);
-
- var args = new NavigationRequestedEventArgs(page, animated);
-
- EventHandler<NavigationRequestedEventArgs> requestPush = PushRequested;
- if (requestPush != null)
- {
- requestPush(this, args);
-
- if (args.Task != null)
- await args.Task;
- }
-
- Pushed?.Invoke(this, args);
- }
-
- void PushPage(Page page)
- {
- InternalChildren.Add(page);
-
- if (InternalChildren.Count == 1)
- RootPage = page;
-
- CurrentPage = page;
- }
-
- void RemovePage(Page page)
- {
- if (page == null)
- throw new ArgumentNullException($"{nameof(page)} cannot be null.");
-
- if (page == CurrentPage && CurrentPage == RootPage)
- throw new InvalidOperationException("Cannot remove root page when it is also the currently displayed page.");
- if (page == CurrentPage)
- {
- // Log.Warning("NavigationPage", "RemovePage called for CurrentPage object. This can result in undesired behavior, consider calling PopAsync instead.");
- PopAsync();
- return;
- }
-
- if (!InternalChildren.Contains(page))
- throw new ArgumentException("Page to remove must be contained on this Navigation Page");
-
- EventHandler<NavigationRequestedEventArgs> handler = RemovePageRequested;
- handler?.Invoke(this, new NavigationRequestedEventArgs(page, true));
-
- InternalChildren.Remove(page);
- if (RootPage == page)
- RootPage = (Page)InternalChildren.First();
- }
-
- void SafePop()
- {
- PopAsync(true).ContinueWith(t =>
- {
- if (t.IsFaulted)
- throw t.Exception;
- });
- }
-
- class NavigationImpl : NavigationProxy
- {
- // readonly Lazy<ReadOnlyCastingList<Page, Element>> _castingList;
-
- public NavigationImpl(NavigationPage owner)
- {
- Owner = owner;
- // _castingList = new Lazy<ReadOnlyCastingList<Page, Element>>(() => new ReadOnlyCastingList<Page, Element>(Owner.InternalChildren));
- }
-
- NavigationPage Owner { get; }
-
- protected override IReadOnlyList<Page> GetNavigationStack()
- {
- // return _castingList.Value;
- return null;
- }
-
- protected override void OnInsertPageBefore(Page page, Page before)
- {
- Owner.InsertPageBefore(page, before);
- }
-
- protected override Task<Page> OnPopAsync(bool animated)
- {
- return Owner.PopAsync(animated);
- }
-
- protected override Task OnPopToRootAsync(bool animated)
- {
- return Owner.PopToRootAsync(animated);
- }
-
- protected override Task OnPushAsync(Page root, bool animated)
- {
- return Owner.PushAsync(root, animated);
- }
-
- protected override void OnRemovePage(Page page)
- {
- Owner.RemovePage(page);
- }
- }
-
- readonly Lazy<PlatformConfigurationRegistry<NavigationPage>> _platformConfigurationRegistry;
-
- /// <summary>
- /// Returns the platform-specific instance of this NavigationPage, on which a platform-specific method may be called.
- /// </summary>
- /// <typeparam name="T">The platform for which to return an instance.</typeparam>
- /// <returns>The platform-specific instance of this NavigationPage</returns>
- public new IPlatformElementConfiguration<T, NavigationPage> On<T>() where T : IConfigPlatform
- {
- return _platformConfigurationRegistry.Value.On<T>();
- }
- }
-}
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Tizen.NUI.Binding
-{
- /// <summary>
- /// For internal use.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- internal class NavigationProxy : INavigation
- {
- INavigation _inner;
- Lazy<List<Page>> _modalStack = new Lazy<List<Page>>(() => new List<Page>());
-
- Lazy<List<Page>> _pushStack = new Lazy<List<Page>>(() => new List<Page>());
-
- internal INavigation Inner
- {
- get { return _inner; }
- set
- {
- if (_inner == value)
- return;
- _inner = value;
- // reverse so that things go into the new stack in the same order
- // null out to release memory that will likely never be needed again
-
- if (ReferenceEquals(_inner, null))
- {
- _pushStack = new Lazy<List<Page>>(() => new List<Page>());
- _modalStack = new Lazy<List<Page>>(() => new List<Page>());
- }
- else
- {
- if (_pushStack != null && _pushStack.IsValueCreated)
- {
- foreach (Page page in _pushStack.Value)
- {
- _inner.PushAsync(page);
- }
- }
-
- if (_modalStack != null && _modalStack.IsValueCreated)
- {
- foreach (Page page in _modalStack.Value)
- {
- _inner.PushModalAsync(page);
- }
- }
-
- _pushStack = null;
- _modalStack = null;
- }
- }
- }
-
- /// <summary>
- /// Inserts a page in the navigation stack before an existing page in the stack.
- /// </summary>
- /// <param name="page">The page to add.</param>
- /// <param name="before">The existing page, before which page will be inserted.</param>
- public void InsertPageBefore(Page page, Page before)
- {
- OnInsertPageBefore(page, before);
- }
-
- /// <summary>
- /// Gets the modal navigation stack.
- /// </summary>
- public IReadOnlyList<Page> ModalStack
- {
- get { return GetModalStack(); }
- }
-
- /// <summary>
- /// Gets the stack of pages in the navigation.
- /// </summary>
- public IReadOnlyList<Page> NavigationStack
- {
- get { return GetNavigationStack(); }
- }
-
- /// <summary>
- /// Asynchronously removes the most recent Page from the navigation stack.
- /// </summary>
- /// <returns>The Page that had been at the top of the navigation stack.</returns>
- public Task<Page> PopAsync()
- {
- return OnPopAsync(true);
- }
-
- /// <summary>
- /// Asynchronously removes the top Page from the navigation stack, with optional animation.
- /// </summary>
- /// <param name="animated">Whether to animate the pop.</param>
- /// <returns>The Page that had been at the top of the navigation stack.</returns>
- public Task<Page> PopAsync(bool animated)
- {
- return OnPopAsync(animated);
- }
-
- /// <summary>
- /// Asynchronously dismisses the most recent modally presented Page.
- /// </summary>
- /// <returns>An awaitable instance, indicating the PopModalAsync completion. The Task.Result is the Page that has been popped.</returns>
- public Task<Page> PopModalAsync()
- {
- return OnPopModal(true);
- }
-
- /// <summary>
- /// Asynchronously removes the top Page from the navigation stack, with optional animation.
- /// </summary>
- /// <param name="animated">Whether to animate the pop.</param>
- /// <returns>The Page that had been at the top of the navigation stack.</returns>
- public Task<Page> PopModalAsync(bool animated)
- {
- return OnPopModal(animated);
- }
-
- /// <summary>
- /// Pops all but the root Page off the navigation stack.
- /// </summary>
- /// <returns>A task representing the asynchronous dismiss operation.</returns>
- public Task PopToRootAsync()
- {
- return OnPopToRootAsync(true);
- }
-
- /// <summary>
- /// Pops all but the root Page off the navigation stack, with optional animation.
- /// </summary>
- /// <param name="animated">Whether to animate the pop.</param>
- /// <returns>A task representing the asynchronous dismiss operation.</returns>
- public Task PopToRootAsync(bool animated)
- {
- return OnPopToRootAsync(animated);
- }
-
- /// <summary>
- /// Asynchronously adds a Page to the top of the navigation stack.
- /// </summary>
- /// <param name="root">The Page to be pushed on top of the navigation stack.</param>
- /// <returns>A task that represents the asynchronous push operation.</returns>
- public Task PushAsync(Page root)
- {
- return PushAsync(root, true);
- }
-
- /// <summary>
- /// Asynchronously adds a Page to the top of the navigation stack, with optional animation.
- /// </summary>
- /// <param name="root">The page to push.</param>
- /// <param name="animated">Whether to animate the push.</param>
- /// <returns>A task that represents the asynchronous push operation.</returns>
- public Task PushAsync(Page root, bool animated)
- {
- if (root.RealParent != null)
- throw new InvalidOperationException("Page must not already have a parent.");
- return OnPushAsync(root, animated);
- }
-
- /// <summary>
- /// Presents a Page modally.
- /// </summary>
- /// <param name="modal">The Page to present modally.</param>
- /// <returns>An awaitable Task, indicating the PushModal completion.</returns>
- public Task PushModalAsync(Page modal)
- {
- return PushModalAsync(modal, true);
- }
-
- /// <summary>
- /// Presents a Page modally, with optional animation.
- /// </summary>
- /// <param name="modal">The page to push.</param>
- /// <param name="animated">Whether to animate the push.</param>
- /// <returns>An awaitable Task, indicating the PushModal completion.</returns>
- public Task PushModalAsync(Page modal, bool animated)
- {
- if (modal.RealParent != null)
- throw new InvalidOperationException("Page must not already have a parent.");
- return OnPushModal(modal, animated);
- }
-
- /// <summary>
- /// Removes the specified page from the navigation stack.
- /// </summary>
- /// <param name="page">The page to remove.</param>
- public void RemovePage(Page page)
- {
- OnRemovePage(page);
- }
-
- /// <summary>
- /// For internal use. Returns the modal navigation stack.
- /// </summary>
- /// <returns>The modal navigation stack.</returns>
- protected virtual IReadOnlyList<Page> GetModalStack()
- {
- INavigation currentInner = Inner;
- return currentInner == null ? _modalStack.Value : currentInner.ModalStack;
- }
-
- /// <summary>
- /// For internal use. Returns the stack of pages in the navigation.
- /// </summary>
- /// <returns>The stack of pages in the navigation.</returns>
- protected virtual IReadOnlyList<Page> GetNavigationStack()
- {
- INavigation currentInner = Inner;
- return currentInner == null ? _pushStack.Value : currentInner.NavigationStack;
- }
-
- /// <summary>
- /// The method called when insert a page in the navigation stack before an existing page in the stack.
- /// </summary>
- /// <param name="page">The page to add.</param>
- /// <param name="before">The existing page, before which page will be inserted.</param>
- protected virtual void OnInsertPageBefore(Page page, Page before)
- {
- INavigation currentInner = Inner;
- if (currentInner == null)
- {
- int index = _pushStack.Value.IndexOf(before);
- if (index == -1)
- throw new ArgumentException("before must be in the pushed stack of the current context");
- _pushStack.Value.Insert(index, page);
- }
- else
- {
- currentInner.InsertPageBefore(page, before);
- }
- }
-
- /// <summary>
- /// This method calls when removes the top Page from the navigation stack
- /// </summary>
- /// <param name="animated">Whether to animate the pop.</param>
- /// <returns></returns>
- protected virtual Task<Page> OnPopAsync(bool animated)
- {
- INavigation inner = Inner;
- return inner == null ? Task.FromResult(Pop()) : inner.PopAsync(animated);
- }
-
- /// <summary>
- /// This method calls when removes the top Page from the navigation stack
- /// </summary>
- /// <param name="animated">Whether to animate the pop.</param>
- /// <returns>An awaitable instance, indicating the PopModalAsync completion</returns>
- protected virtual Task<Page> OnPopModal(bool animated)
- {
- INavigation innerNav = Inner;
- return innerNav == null ? Task.FromResult(PopModal()) : innerNav.PopModalAsync(animated);
- }
-
- /// <summary>
- /// This method calls when Pops all but the root Page off the navigation stack.
- /// </summary>
- /// <param name="animated">Whether to animate the pop.</param>
- /// <returns>A task representing the asynchronous dismiss operation.</returns>
- protected virtual Task OnPopToRootAsync(bool animated)
- {
- INavigation currentInner = Inner;
- if (currentInner == null)
- {
- Page root = _pushStack.Value.Last();
- _pushStack.Value.Clear();
- _pushStack.Value.Add(root);
- return Task.FromResult(root);
- }
- return currentInner.PopToRootAsync(animated);
- }
-
- /// <summary>
- /// This method calls when adds a Page to the top of the navigation stack, with optional animation.
- /// </summary>
- /// <param name="page">The page to add</param>
- /// <param name="animated">Whether to animate the pop.</param>
- /// <returns>A task that represents the asynchronous push operation.</returns>
- protected virtual Task OnPushAsync(Page page, bool animated)
- {
- INavigation currentInner = Inner;
- if (currentInner == null)
- {
- _pushStack.Value.Add(page);
- return Task.FromResult(page);
- }
- return currentInner.PushAsync(page, animated);
- }
-
- /// <summary>
- /// This method calls when Presents a Page modally, with optional animation.
- /// </summary>
- /// <param name="modal">The page to push.</param>
- /// <param name="animated">Whether to animate the pop.</param>
- /// <returns>An awaitable Task, indicating the PushModal completion.</returns>
- protected virtual Task OnPushModal(Page modal, bool animated)
- {
- INavigation currentInner = Inner;
- if (currentInner == null)
- {
- _modalStack.Value.Add(modal);
- return Task.FromResult<object>(null);
- }
- return currentInner.PushModalAsync(modal, animated);
- }
-
- /// <summary>
- /// This method calls when Removes the specified page from the navigation stack.
- /// </summary>
- /// <param name="page">The page to add.</param>
- protected virtual void OnRemovePage(Page page)
- {
- INavigation currentInner = Inner;
- if (currentInner == null)
- {
- _pushStack.Value.Remove(page);
- }
- else
- {
- currentInner.RemovePage(page);
- }
- }
-
- Page Pop()
- {
- List<Page> list = _pushStack.Value;
- Page result = list[list.Count - 1];
- list.RemoveAt(list.Count - 1);
- return result;
- }
-
- Page PopModal()
- {
- List<Page> list = _modalStack.Value;
- Page result = list[list.Count - 1];
- list.RemoveAt(list.Count - 1);
- return result;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.ComponentModel;
-using System.Threading.Tasks;
-using Tizen.NUI;
-
-namespace Tizen.NUI.Binding
-{
- /// <summary>
- /// For internal use.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- internal class NavigationRequestedEventArgs : NavigationEventArgs
- {
- /// <summary>
- /// Constructor.
- /// </summary>
- /// <param name="page"></param>
- /// <param name="animated"></param>
- /// <param name="realize"></param>
- public NavigationRequestedEventArgs(Page page, bool animated, bool realize = true) : base(page)
- {
- Animated = animated;
- Realize = realize;
- }
-
- /// <summary>
- /// Constructor.
- /// </summary>
- /// <param name="page"></param>
- /// <param name="before"></param>
- /// <param name="animated"></param>
- public NavigationRequestedEventArgs(Page page, Page before, bool animated) : this(page, animated)
- {
- BeforePage = before;
- }
-
- /// <summary>
- /// Gets or Sets the whether animate.
- /// </summary>
- public bool Animated { get; set; }
-
- /// <summary>
- /// Gets or Sets the before page.
- /// </summary>
- public Page BeforePage { get; set; }
-
- /// <summary>
- /// Gets or Sets the realize.
- /// </summary>
- public bool Realize { get; set; }
-
- /// <summary>
- /// Gets or Sets the Task.
- /// </summary>
- public Task<bool> Task { get; set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace Tizen.NUI.Binding
-{
- internal class NullEffect : Effect
- {
- protected override void OnAttached()
- {
- }
-
- protected override void OnDetached()
- {
- }
- }
-}
+++ /dev/null
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Collections.Specialized;
-using System.Linq;
-
-namespace Tizen.NUI.Binding
-{
- internal class ObservableWrapper<TTrack, TRestrict> : IList<TRestrict>, INotifyCollectionChanged where TTrack : Element where TRestrict : TTrack
- {
- readonly ObservableCollection<TTrack> _list;
-
- public ObservableWrapper(ObservableCollection<TTrack> list)
- {
- if (list == null)
- throw new ArgumentNullException("list");
-
- _list = list;
-
- list.CollectionChanged += ListOnCollectionChanged;
- }
-
- public void Add(TRestrict item)
- {
- if (item == null)
- throw new ArgumentNullException("item");
- if (IsReadOnly)
- throw new NotSupportedException("The collection is read-only.");
-
- if (_list.Contains(item))
- return;
-
- item.Owned = true;
- _list.Add(item);
- }
-
- public void Clear()
- {
- if (IsReadOnly)
- throw new NotSupportedException("The collection is read-only.");
-
- foreach (TRestrict item in _list.OfType<TRestrict>().ToArray())
- {
- _list.Remove(item);
- item.Owned = false;
- }
- }
-
- public bool Contains(TRestrict item)
- {
- return item.Owned && _list.Contains(item);
- }
-
- public void CopyTo(TRestrict[] array, int destIndex)
- {
- if (array.Length - destIndex < Count)
- throw new ArgumentException("Destination array was not long enough. Check destIndex and length, and the array's lower bounds.");
- foreach (TRestrict item in this)
- {
- array[destIndex] = item;
- destIndex++;
- }
- }
-
- public int Count
- {
- get { return _list.Where(i => i.Owned).OfType<TRestrict>().Count(); }
- }
-
- public bool IsReadOnly { get; internal set; }
-
- public bool Remove(TRestrict item)
- {
- if (item == null)
- throw new ArgumentNullException("item");
- if (IsReadOnly)
- throw new NotSupportedException("The collection is read-only.");
-
- if (!item.Owned)
- return false;
-
- if (_list.Remove(item))
- {
- item.Owned = false;
- return true;
- }
- return false;
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
-
- public IEnumerator<TRestrict> GetEnumerator()
- {
- return _list.Where(i => i.Owned).OfType<TRestrict>().GetEnumerator();
- }
-
- public int IndexOf(TRestrict value)
- {
- int innerIndex = _list.IndexOf(value);
- if (innerIndex == -1)
- return -1;
- return ToOuterIndex(innerIndex);
- }
-
- public void Insert(int index, TRestrict item)
- {
- if (item == null)
- throw new ArgumentNullException("item");
- if (IsReadOnly)
- throw new NotSupportedException("The collection is read-only.");
-
- item.Owned = true;
- _list.Insert(ToInnerIndex(index), item);
- }
-
- public TRestrict this[int index]
- {
- get { return (TRestrict)_list[ToInnerIndex(index)]; }
- set
- {
- int innerIndex = ToInnerIndex(index);
- if (value != null)
- value.Owned = true;
- TTrack old = _list[innerIndex];
- _list[innerIndex] = value;
-
- if (old != null)
- old.Owned = false;
- }
- }
-
- public void RemoveAt(int index)
- {
- if (IsReadOnly)
- throw new NotSupportedException("The collection is read-only");
- int innerIndex = ToInnerIndex(index);
- TTrack item = _list[innerIndex];
- if (item != null && item.Owned)
- {
- _list.RemoveAt(innerIndex);
- item.Owned = false;
- }
- }
-
- public event NotifyCollectionChangedEventHandler CollectionChanged;
-
- void ListOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
- {
- NotifyCollectionChangedEventHandler handler = CollectionChanged;
- if (handler == null)
- return;
-
- switch (e.Action)
- {
- case NotifyCollectionChangedAction.Add:
- if (e.NewStartingIndex == -1 || e.NewItems?.Count > 1)
- goto case NotifyCollectionChangedAction.Reset;
-
- var newItem = e.NewItems?[0] as TRestrict;
- if (newItem == null || !newItem.Owned)
- break;
-
- int outerIndex = ToOuterIndex(e.NewStartingIndex);
- handler(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, e.NewItems, outerIndex));
- break;
- case NotifyCollectionChangedAction.Move:
- if (e.NewStartingIndex == -1 || e.OldStartingIndex == -1 || e.NewItems?.Count > 1)
- goto case NotifyCollectionChangedAction.Reset;
-
- var movedItem = e.NewItems?[0] as TRestrict;
- if (movedItem == null || !movedItem.Owned)
- break;
-
- int outerOldIndex = ToOuterIndex(e.OldStartingIndex);
- int outerNewIndex = ToOuterIndex(e.NewStartingIndex);
- handler(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move, e.NewItems, outerNewIndex, outerOldIndex));
- break;
- case NotifyCollectionChangedAction.Remove:
- if (e.OldStartingIndex == -1 || e.OldItems?.Count > 1)
- goto case NotifyCollectionChangedAction.Reset;
-
- var removedItem = e.OldItems?[0] as TRestrict;
- if (removedItem == null || !removedItem.Owned)
- break;
-
- int outerRemovedIndex = ToOuterIndex(e.OldStartingIndex);
- var args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, removedItem, outerRemovedIndex);
- handler(this, args);
- break;
- case NotifyCollectionChangedAction.Replace:
- if (e.NewStartingIndex == -1 || e.OldStartingIndex == -1 || e.NewItems?.Count > 1)
- goto case NotifyCollectionChangedAction.Reset;
-
- var newReplaceItem = e.NewItems?[0] as TRestrict;
- var oldReplaceItem = e.OldItems?[0] as TRestrict;
-
- if ((newReplaceItem == null || !newReplaceItem.Owned) && (oldReplaceItem == null || !oldReplaceItem.Owned))
- {
- break;
- }
- if (newReplaceItem == null || !newReplaceItem.Owned || oldReplaceItem == null || !oldReplaceItem.Owned)
- {
- goto case NotifyCollectionChangedAction.Reset;
- }
-
- int index = ToOuterIndex(e.NewStartingIndex);
-
- var replaceArgs = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, newReplaceItem, oldReplaceItem, index);
- handler(this, replaceArgs);
- break;
- case NotifyCollectionChangedAction.Reset:
- handler(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
- break;
- default:
- throw new ArgumentOutOfRangeException();
- }
- }
-
- int ToInnerIndex(int outterIndex)
- {
- var outerIndex = 0;
- int innerIndex;
- for (innerIndex = 0; innerIndex < _list.Count; innerIndex++)
- {
- TTrack item = _list[innerIndex];
- if (item is TRestrict && item.Owned)
- {
- if (outerIndex == outterIndex)
- return innerIndex;
- outerIndex++;
- }
- }
-
- return innerIndex;
- }
-
- int ToOuterIndex(int innerIndex)
- {
- var outerIndex = 0;
- for (var index = 0; index < innerIndex; index++)
- {
- TTrack item = _list[index];
- if (item is TRestrict && item.Owned)
- {
- outerIndex++;
- }
- }
-
- return outerIndex;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace Tizen.NUI.Binding
-{
- internal static class PaddingElement
- {
- internal static readonly BindableProperty PaddingProperty =
- BindableProperty.Create("Padding", typeof(Thickness), typeof(IPaddingElement), default(Thickness),
- propertyChanged: OnPaddingPropertyChanged,
- defaultValueCreator: PaddingDefaultValueCreator);
-
- static void OnPaddingPropertyChanged(BindableObject bindable, object oldValue, object newValue)
- {
- ((IPaddingElement)bindable).OnPaddingPropertyChanged((Thickness)oldValue, (Thickness)newValue);
- }
-
- static object PaddingDefaultValueCreator(BindableObject bindable)
- {
- return ((IPaddingElement)bindable).PaddingDefaultValueCreator();
- }
-
- public static readonly BindableProperty PaddingLeftProperty =
- BindableProperty.Create("PaddingLeft", typeof(double), typeof(IPaddingElement), default(double),
- propertyChanged: OnPaddingLeftChanged);
-
- static void OnPaddingLeftChanged(BindableObject bindable, object oldValue, object newValue)
- {
- var padding = (Thickness)bindable.GetValue(PaddingProperty);
- padding.Left = (double)newValue;
- bindable.SetValue(PaddingProperty, padding);
- }
-
- public static readonly BindableProperty PaddingTopProperty =
- BindableProperty.Create("PaddingTop", typeof(double), typeof(IPaddingElement), default(double),
- propertyChanged: OnPaddingTopChanged);
-
- static void OnPaddingTopChanged(BindableObject bindable, object oldValue, object newValue)
- {
- var padding = (Thickness)bindable.GetValue(PaddingProperty);
- padding.Top = (double)newValue;
- bindable.SetValue(PaddingProperty, padding);
- }
-
- public static readonly BindableProperty PaddingRightProperty =
- BindableProperty.Create("PaddingRight", typeof(double), typeof(IPaddingElement), default(double),
- propertyChanged: OnPaddingRightChanged);
-
- static void OnPaddingRightChanged(BindableObject bindable, object oldValue, object newValue)
- {
- var padding = (Thickness)bindable.GetValue(PaddingProperty);
- padding.Right = (double)newValue;
- bindable.SetValue(PaddingProperty, padding);
- }
-
- public static readonly BindableProperty PaddingBottomProperty =
- BindableProperty.Create("PaddingBottom", typeof(double), typeof(IPaddingElement), default(double),
- propertyChanged: OnPaddingBottomChanged);
-
- static void OnPaddingBottomChanged(BindableObject bindable, object oldValue, object newValue)
- {
- var padding = (Thickness)bindable.GetValue(PaddingProperty);
- padding.Bottom = (double)newValue;
- bindable.SetValue(PaddingProperty, padding);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-
-namespace Tizen.NUI.Binding
-{
- /// <summary>
- /// Helper that handles storing and lookup of platform specifics implementations
- /// </summary>
- /// <typeparam name="TElement">The Element type</typeparam>
- internal class PlatformConfigurationRegistry<TElement> : IElementConfiguration<TElement>
- where TElement : Element
- {
- readonly TElement _element;
- readonly Dictionary<Type, object> _platformSpecifics = new Dictionary<Type, object>();
-
- internal PlatformConfigurationRegistry(TElement element)
- {
- _element = element;
- }
-
-
- public IPlatformElementConfiguration<T, TElement> On<T>() where T : IConfigPlatform
- {
- if (_platformSpecifics.ContainsKey(typeof(T)))
- {
- return (IPlatformElementConfiguration<T, TElement>)_platformSpecifics[typeof(T)];
- }
-
- var emptyConfig = Configuration<T, TElement>.Create(_element);
-
- _platformSpecifics.Add(typeof(T), emptyConfig);
-
- return emptyConfig;
- }
- }
-}
+++ /dev/null
-using System.ComponentModel;
-
-namespace Tizen.NUI.Binding
-{
- internal class RoutingEffect : Effect
- {
- internal readonly Effect Inner;
-
- protected RoutingEffect(string effectId)
- {
- Inner = Resolve(effectId);
- }
-
- protected override void OnAttached()
- {
- }
-
- protected override void OnDetached()
- {
- }
-
- internal override void ClearEffect()
- {
- Inner?.ClearEffect();
- }
-
- internal override void SendAttached()
- {
- Inner?.SendAttached();
- }
-
- internal override void SendDetached()
- {
- Inner?.SendDetached();
- }
-
- internal override void SendOnElementPropertyChanged(PropertyChangedEventArgs args)
- {
- Inner?.SendOnElementPropertyChanged(args);
- }
- }
-}
+++ /dev/null
-using System.Diagnostics;
-using System.ComponentModel;
-
-namespace Tizen.NUI.Binding
-{
- /// <summary>
- /// Struct that defines minimum and maximum Sizes.
- /// </summary>
- [DebuggerDisplay("Request={Request.Width}x{Request.Height}, Minimum={Minimum.Width}x{Minimum.Height}")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- internal struct SizeRequest
- {
- /// <summary>
- /// The requested size.
- /// </summary>
- public Size Request { get; set; }
-
- /// <summary>
- /// The minimum acceptable size.
- /// </summary>
- public Size Minimum { get; set; }
-
- /// <summary>
- /// Creates a new SizeRequest object that requests at least the size minimum, but preferably the size request.
- /// </summary>
- /// <param name="request">The size of the request.</param>
- /// <param name="minimum">The minimum size for the request.</param>
- public SizeRequest(Size request, Size minimum)
- {
- Request = request;
- Minimum = minimum;
- }
-
- /// <summary>
- /// Creates a new SizeRequest with the specified request size.
- /// </summary>
- /// <param name="request">The size of the request.</param>
- public SizeRequest(Size request)
- {
- Request = request;
- Minimum = request;
- }
-
- /// <summary>
- /// Returns a string representation of the size request.
- /// </summary>
- /// <returns>a string representation of the size request.</returns>
- public override string ToString()
- {
- return string.Format("{{Request={0} Minimum={1}}}", Request, Minimum);
- }
- }
-}
+++ /dev/null
-using System.Diagnostics;
-using System.ComponentModel;
-
-namespace Tizen.NUI.Binding
-{
- /// <summary>
- /// Struct defining thickness around the edges of a Rectangle using doubles.
- /// </summary>
- [DebuggerDisplay("Left={Left}, Top={Top}, Right={Right}, Bottom={Bottom}, HorizontalThickness={HorizontalThickness}, VerticalThickness={VerticalThickness}")]
- [TypeConverter(typeof(ThicknessTypeConverter))]
- [EditorBrowsable(EditorBrowsableState.Never)]
- internal struct Thickness
- {
- /// <summary>
- /// The thickness of the left side of a rectangle.
- /// </summary>
- public double Left { get; set; }
-
- /// <summary>
- /// The thickness of the top of a rectangle.
- /// </summary>
- public double Top { get; set; }
-
- /// <summary>
- /// The thickness of the right side of a rectangle.
- /// </summary>
- public double Right { get; set; }
-
- /// <summary>
- /// The thickness of the bottom of a rectangle.
- /// </summary>
- public double Bottom { get; set; }
-
- /// <summary>
- /// The sum of Left and Right.
- /// </summary>
- public double HorizontalThickness
- {
- get { return Left + Right; }
- }
-
- /// <summary>
- /// The sum of Top and Bottom.
- /// </summary>
- public double VerticalThickness
- {
- get { return Top + Bottom; }
- }
-
- internal bool IsDefault
- {
- get { return Left == 0 && Top == 0 && Right == 0 && Bottom == 0; }
- }
-
- /// <summary>
- /// Creates a new Thickness object that represents a uniform thickness of size uniformSize.
- /// </summary>
- /// <param name="uniformSize">The uniform size of all edges in the new thickness.</param>
- public Thickness(double uniformSize) : this(uniformSize, uniformSize, uniformSize, uniformSize)
- {
- }
-
- /// <summary>
- /// Creates a new Thickness object that has a horizontal thickness of horizontalSize and a vertical thickness of verticalSize.
- /// </summary>
- /// <param name="horizontalSize">The width of the left and right thicknesses.</param>
- /// <param name="verticalSize">The height of the top and bottom thicknesses.</param>
- public Thickness(double horizontalSize, double verticalSize) : this(horizontalSize, verticalSize, horizontalSize, verticalSize)
- {
- }
-
- /// <summary>
- /// Creates a new Thickness object with thicknesses defined by left, top, right, and bottom.
- /// </summary>
- /// <param name="left">The width of the left thickness.</param>
- /// <param name="top">The height of the top thickness.</param>
- /// <param name="right">The width of the right thickness.</param>
- /// <param name="bottom">The height of the bottom thickness.</param>
- public Thickness(double left, double top, double right, double bottom) : this()
- {
- Left = left;
- Top = top;
- Right = right;
- Bottom = bottom;
- }
-
- /// <summary>
- /// Converts a Size into a Thickness.
- /// </summary>
- /// <param name="size">A Size to convert to a Thickness</param>
- public static implicit operator Thickness(Size size)
- {
- return new Thickness(size.Width, size.Height, size.Width, size.Height);
- }
-
- /// <summary>
- /// Implicit cast operator from Double.
- /// </summary>
- /// <param name="uniformSize">The value for the uniform Thickness.</param>
- public static implicit operator Thickness(double uniformSize)
- {
- return new Thickness(uniformSize);
- }
-
- /// <summary>
- /// Whether the other has equivalent values.
- /// </summary>
- /// <param name="other">A Thickness to be compared.</param>
- /// <returns>true if other has equivalent values.</returns>
- bool Equals(Thickness other)
- {
- return Left.Equals(other.Left) && Top.Equals(other.Top) && Right.Equals(other.Right) && Bottom.Equals(other.Bottom);
- }
-
- /// <summary>
- /// Whether the obj has equivalent values.
- /// </summary>
- /// <param name="obj">A Thickness to be compared.</param>
- /// <returns>true if obj is a Thickness and has equivalent values.</returns>
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj))
- return false;
- return obj is Thickness && Equals((Thickness)obj);
- }
-
- /// <summary>
- /// A hash value for this Thickness.
- /// </summary>
- /// <returns>The hash value</returns>
- public override int GetHashCode()
- {
- unchecked
- {
- int hashCode = Left.GetHashCode();
- hashCode = (hashCode * 397) ^ Top.GetHashCode();
- hashCode = (hashCode * 397) ^ Right.GetHashCode();
- hashCode = (hashCode * 397) ^ Bottom.GetHashCode();
- return hashCode;
- }
- }
-
- /// <summary>
- /// Whether two Thicknesses have identical values.
- /// </summary>
- /// <param name="left">A Thickness to be compared.</param>
- /// <param name="right">A Thickness to be compared.</param>
- /// <returns>true if left and right have identical values for Left,Right, Top, and Bottom.</returns>
- public static bool operator ==(Thickness left, Thickness right)
- {
- return left.Equals(right);
- }
-
- /// <summary>
- /// Whether the values of two Thickness's have at least one difference.
- /// </summary>
- /// <param name="left">A Thickness to be compared.</param>
- /// <param name="right">A Thickness to be compared.</param>
- /// <returns>true if any of the Left,Right, Top, and Bottom values differ between left and right.</returns>
- public static bool operator !=(Thickness left, Thickness right)
- {
- return !left.Equals(right);
- }
-
- /// <summary>
- /// Stores the components of the thickness in the corresponding arguments.
- /// </summary>
- /// <param name="left">Variable in which to store the left thickness of thickness object.</param>
- /// <param name="top">Variable in which to store the top thickness of thickness object.</param>
- /// <param name="right">Variable in which to store the right thickness of thickness object.</param>
- /// <param name="bottom">Variable in which to store the bottom thickness of thickness object.</param>
- public void Deconstruct(out double left, out double top, out double right, out double bottom)
- {
- left = Left;
- top = Top;
- right = Right;
- bottom = Bottom;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Globalization;
-
-namespace Tizen.NUI.Binding
-{
- [Xaml.ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.ThicknessTypeConverter")]
- [Xaml.TypeConversion(typeof(Thickness))]
- internal class ThicknessTypeConverter : TypeConverter
- {
- public override object ConvertFromInvariantString(string value)
- {
- if (value != null) {
- value = value.Trim();
- if (value.Contains(",")) { //Xaml
- var thickness = value.Split(',');
- switch (thickness.Length) {
- case 2:
- if ( double.TryParse(thickness[0], NumberStyles.Number, CultureInfo.InvariantCulture, out double h)
- && double.TryParse(thickness[1], NumberStyles.Number, CultureInfo.InvariantCulture, out double v))
- return new Thickness(h, v);
- break;
- case 4:
- if ( double.TryParse(thickness[0], NumberStyles.Number, CultureInfo.InvariantCulture, out double l)
- && double.TryParse(thickness[1], NumberStyles.Number, CultureInfo.InvariantCulture, out double t)
- && double.TryParse(thickness[2], NumberStyles.Number, CultureInfo.InvariantCulture, out double r)
- && double.TryParse(thickness[3], NumberStyles.Number, CultureInfo.InvariantCulture, out double b))
- return new Thickness(l, t, r, b);
- break;
- }
- }
- else if (value.Contains(" ")) { //CSS
- var thickness = value.Split(' ');
- switch (thickness.Length) {
- case 2:
- if ( double.TryParse(thickness[0], NumberStyles.Number, CultureInfo.InvariantCulture, out double v)
- && double.TryParse(thickness[1], NumberStyles.Number, CultureInfo.InvariantCulture, out double h))
- return new Thickness(h, v);
- break;
- case 3:
- if ( double.TryParse(thickness[0], NumberStyles.Number, CultureInfo.InvariantCulture, out double t)
- && double.TryParse(thickness[1], NumberStyles.Number, CultureInfo.InvariantCulture, out h)
- && double.TryParse(thickness[2], NumberStyles.Number, CultureInfo.InvariantCulture, out double b))
- return new Thickness(h, t, h, b);
- break;
- case 4:
- if ( double.TryParse(thickness[0], NumberStyles.Number, CultureInfo.InvariantCulture, out t)
- && double.TryParse(thickness[1], NumberStyles.Number, CultureInfo.InvariantCulture, out double r)
- && double.TryParse(thickness[2], NumberStyles.Number, CultureInfo.InvariantCulture, out b)
- && double.TryParse(thickness[3], NumberStyles.Number, CultureInfo.InvariantCulture, out double l))
- return new Thickness(l, t, r, b);
- break;
- }
- }
- else { //single uniform thickness
- if (double.TryParse(value, NumberStyles.Number, CultureInfo.InvariantCulture, out double l))
- return new Thickness(l);
- }
- }
-
- throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(Thickness)}");
- }
- }
-}
\ No newline at end of file
s_context = SynchronizationContext.Current;
}
- public class TizenTicker : Ticker
- {
- readonly System.Threading.Timer _timer;
-
- public TizenTicker()
- {
- _timer = new System.Threading.Timer((object o) => HandleElapsed(o), this, Timeout.Infinite, Timeout.Infinite);
- }
-
- protected override void EnableTimer()
- {
- _timer.Change(16, 16);
- }
-
- protected override void DisableTimer()
- {
- _timer.Change(-1, -1);
- }
-
- void HandleElapsed(object state)
- {
- s_context.Post((o) => SendSignals(-1), null);
- }
- }
#region IPlatformServices implementation
-
- // public double GetNamedSize(NamedSize size, Type targetElementType, bool useOldSizes)
- // {
- // int pt;
- // // Actual font size depends on the target idiom.
- // switch (size)
- // {
- // case NamedSize.Micro:
- // pt = Device.Idiom == TargetIdiom.TV || Device.Idiom == TargetIdiom.Watch ? 24 : 19;
- // break;
- // case NamedSize.Small:
- // pt = Device.Idiom == TargetIdiom.TV ? 26 : (Device.Idiom == TargetIdiom.Watch ? 30 : 22);
- // break;
- // case NamedSize.Default:
- // case NamedSize.Medium:
- // pt = Device.Idiom == TargetIdiom.TV ? 28 : (Device.Idiom == TargetIdiom.Watch ? 32 : 25);
- // break;
- // case NamedSize.Large:
- // pt = Device.Idiom == TargetIdiom.TV ? 84 : (Device.Idiom == TargetIdiom.Watch ? 36 : 31);
- // break;
- // default:
- // throw new ArgumentOutOfRangeException();
- // }
- // return Forms.ConvertToDPFont(pt);
- // }
-
- // public void OpenUriAction(Uri uri)
- // {
- // if (uri == null || uri.AbsoluteUri == null)
- // {
- // throw new ArgumentNullException(nameof(uri));
- // }
- // TAppControl tAppControl = new TAppControl() { Operation = "%", Uri = uri.AbsoluteUri };
- // var matchedApplications = TAppControl.GetMatchedApplicationIds(tAppControl);
- // if (matchedApplications.Count() > 0)
- // {
- // TAppControl.SendLaunchRequest(tAppControl);
- // return;
- // }
- // throw new PlatformNotSupportedException();
- // }
-
public void BeginInvokeOnMainThread(Action action)
{
s_context.Post((o) => action(), null);
}
- public Ticker CreateTicker()
- {
- return new TizenTicker();
- }
-
public void StartTimer(TimeSpan interval, Func<bool> callback)
{
Console.WriteLine("TizenPlatformServices StartTimer ...");
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Binding
-{
- internal class ToolbarItem : MenuItem
- {
- static readonly BindableProperty OrderProperty = BindableProperty.Create("Order", typeof(ToolbarItemOrder), typeof(ToolbarItem), ToolbarItemOrder.Default, validateValue: (bo, o) =>
- {
- var order = (ToolbarItemOrder)o;
- return order == ToolbarItemOrder.Default || order == ToolbarItemOrder.Primary || order == ToolbarItemOrder.Secondary;
- });
-
- static readonly BindableProperty PriorityProperty = BindableProperty.Create("Priority", typeof(int), typeof(ToolbarItem), 0);
-
- public ToolbarItem()
- {
- }
-
- public ToolbarItem(string name, string icon, Action activated, ToolbarItemOrder order = ToolbarItemOrder.Default, int priority = 0)
- {
- if (activated == null)
- throw new ArgumentNullException("activated");
-
- Text = name;
- Icon = icon;
- Clicked += (s, e) => activated();
- Order = order;
- Priority = priority;
- }
-
- [Obsolete("Name is obsolete as of version 1.3.0. Please use Text instead.")]
- public string Name
- {
- get { return Text; }
- set { Text = value; }
- }
-
- public ToolbarItemOrder Order
- {
- get { return (ToolbarItemOrder)GetValue(OrderProperty); }
- set { SetValue(OrderProperty, value); }
- }
-
- public int Priority
- {
- get { return (int)GetValue(PriorityProperty); }
- set { SetValue(PriorityProperty, value); }
- }
-
- [Obsolete("Activated is obsolete as of version 1.3.0. Please use Clicked instead.")]
- public event EventHandler Activated
- {
- add { Clicked += value; }
- remove { Clicked -= value; }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace Tizen.NUI.Binding
-{
- internal class ToolbarItemEventArgs : EventArgs
- {
- public ToolbarItemEventArgs(ToolbarItem item)
- {
- ToolbarItem = item;
- }
-
- public ToolbarItem ToolbarItem { get; private set; }
- }
-}
\ No newline at end of file
}
}
- var nativeValueConverterService = DependencyService.Get<INativeValueConverterService>();
-
- object nativeValue = null;
- if (nativeValueConverterService != null && nativeValueConverterService.ConvertTo(value, toType, out nativeValue))
- return nativeValue;
-
return value;
}
}
}
- internal override bool IsCreateByXaml
+ /// Only used by the IL of xaml, will never changed to not hidden.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool IsCreateByXaml
{
get
{
}
}
- internal override bool IsCreateByXaml
+ /// Only used by the IL of xaml, will never changed to not hidden.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool IsCreateByXaml
{
get
{
/// View is the base class for all views.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- [ContentProperty("Children")]
public class View : Container, IResourcesProvider
{
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
}
}
- internal Style Style
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Style Style
{
get
{
/// <since_tizen> 3 </since_tizen>
public class BaseHandle : Element, global::System.IDisposable
{
- internal static readonly BindablePropertyKey NavigationPropertyKey = BindableProperty.CreateReadOnly("Navigation", typeof(INavigation), typeof(/*VisualElement*/BaseHandle), default(INavigation));
-
- /// <summary>
- /// Backing store for the Navigation property.
- /// </summary>
- internal static readonly BindableProperty NavigationProperty = NavigationPropertyKey.BindableProperty;
-
/// <summary>
/// swigCMemOwn
/// </summary>
}
/// <summary>
- /// For internal use.
- /// </summary>
- internal NavigationProxy NavigationProxy
- {
- get { return Navigation as NavigationProxy; }
- }
-
- /// <summary>
- /// Gets the navigation.
- /// </summary>
- internal INavigation Navigation
- {
- get { return (INavigation)GetValue(NavigationProperty); }
- set { SetValue(NavigationPropertyKey, value); }
- }
-
- /// <summary>
/// Returns the bool value true to indicate that an operand is true and returns false otherwise.
/// </summary>
/// <since_tizen> 3 </since_tizen>
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
namespace Tizen.NUI
{
protected override void OnCreate()
{
base.OnCreate();
- Device.PlatformServices = new TizenPlatformServices();
}
}
}
}
- internal override bool IsCreateByXaml
+ /// Only used by the IL of xaml, will never changed to not hidden.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool IsCreateByXaml
{
get
{
}
}
- internal override bool IsCreateByXaml
+ /// Only used by the IL of xaml, will never changed to not hidden.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool IsCreateByXaml
{
get
{
--- /dev/null
+using System;
+using System.ComponentModel;
+
+namespace Tizen.NUI.Xaml
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public interface IMarkupExtension<out T> : IMarkupExtension
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ new T ProvideValue(IServiceProvider serviceProvider);
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public interface IMarkupExtension
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ object ProvideValue(IServiceProvider serviceProvider);
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [AttributeUsage(AttributeTargets.Class, Inherited = false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public sealed class AcceptEmptyServiceProviderAttribute : Attribute
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+using System.ComponentModel;
+
+namespace Tizen.NUI.Xaml
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public interface IProvideValueTarget
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ object TargetObject { get; }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ object TargetProperty { get; }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System.ComponentModel;
+
+namespace Tizen.NUI.Xaml
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public interface IReferenceProvider
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ object FindByName(string name);
+ }
+}
\ No newline at end of file
--- /dev/null
+using System.ComponentModel;
+
+namespace Tizen.NUI.Xaml
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ internal interface IRootObjectProvider
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ object RootObject { get; }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+using System.ComponentModel;
+
+namespace Tizen.NUI.Xaml
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public interface IValueProvider
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ object ProvideValue(IServiceProvider serviceProvider);
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+using System.ComponentModel;
+
+namespace Tizen.NUI.Xaml
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public interface IXamlTypeResolver
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Type Resolve(string qualifiedTypeName, IServiceProvider serviceProvider = null);
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ bool TryResolve(string qualifiedTypeName, out Type type);
+ }
+}
\ No newline at end of file
--- /dev/null
+using System.ComponentModel;
+using System.Xml;
+
+namespace Tizen.NUI.Xaml
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public interface IXmlLineInfoProvider
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ IXmlLineInfo XmlLineInfo { get; }
+ }
+}
\ No newline at end of file
using System;
using System.Collections;
using System.Collections.Generic;
+using System.ComponentModel;
using Tizen.NUI.Binding;
namespace Tizen.NUI.Xaml
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[ContentProperty("Items")]
[AcceptEmptyServiceProvider]
- internal class ArrayExtension : IMarkupExtension<Array>
+ public class ArrayExtension : IMarkupExtension<Array>
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public ArrayExtension()
{
Items = new List<object>();
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public IList Items { get; }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public Type Type { get; set; }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public Array ProvideValue(IServiceProvider serviceProvider)
{
if (Type == null)
--- /dev/null
+using System;
+using Tizen.NUI.Binding.Internals;
+using Tizen.NUI.Binding;
+using System.ComponentModel;
+
+namespace Tizen.NUI.Xaml
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [ContentProperty("Path")]
+ [AcceptEmptyServiceProvider]
+ public sealed class BindingExtension : IMarkupExtension<BindingBase>
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string Path { get; set; } = Binding.Binding.SelfPath;
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public BindingMode Mode { get; set; } = BindingMode.Default;
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public IValueConverter Converter { get; set; }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public object ConverterParameter { get; set; }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string StringFormat { get; set; }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public object Source { get; set; }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string UpdateSourceEventName { get; set; }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public object TargetNullValue { get; set; }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public object FallbackValue { get; set; }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public TypedBindingBase TypedBinding { get; set; }
+
+ BindingBase IMarkupExtension<BindingBase>.ProvideValue(IServiceProvider serviceProvider)
+ {
+ if (TypedBinding == null)
+ return new Tizen.NUI.Binding.Binding(Path, Mode, Converter, ConverterParameter, StringFormat, Source)
+ {
+ UpdateSourceEventName = UpdateSourceEventName,
+ FallbackValue = FallbackValue,
+ TargetNullValue = TargetNullValue,
+ };
+
+ TypedBinding.Mode = Mode;
+ TypedBinding.Converter = Converter;
+ TypedBinding.ConverterParameter = ConverterParameter;
+ TypedBinding.StringFormat = StringFormat;
+ TypedBinding.Source = Source;
+ TypedBinding.UpdateSourceEventName = UpdateSourceEventName;
+ TypedBinding.FallbackValue = FallbackValue;
+ TypedBinding.TargetNullValue = TargetNullValue;
+ return TypedBinding;
+ }
+
+ object IMarkupExtension.ProvideValue(IServiceProvider serviceProvider)
+ {
+ return (this as IMarkupExtension<BindingBase>).ProvideValue(serviceProvider);
+ }
+ }
+}
\ No newline at end of file
using System;
+using System.ComponentModel;
using Tizen.NUI.Binding;
using Tizen.NUI.Binding.Internals;
namespace Tizen.NUI.Xaml
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[ContentProperty("Key")]
- internal sealed class DynamicResourceExtension : IMarkupExtension<DynamicResource>
+ public sealed class DynamicResourceExtension : IMarkupExtension<DynamicResource>
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string Key { get; set; }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public object ProvideValue(IServiceProvider serviceProvider)
{
return ((IMarkupExtension<DynamicResource>)this).ProvideValue(serviceProvider);
--- /dev/null
+using System;
+using System.ComponentModel;
+
+namespace Tizen.NUI.Xaml
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [ProvideCompiled("Tizen.NUI.Xaml.Build.Tasks.NullExtension")]
+ [AcceptEmptyServiceProvider]
+ public class NullExtension : IMarkupExtension
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return null;
+ }
+ }
+}
using Tizen.NUI.Binding.Internals;
using Tizen.NUI.Xaml.Internals;
using Tizen.NUI.Binding;
+using System.ComponentModel;
namespace Tizen.NUI.Xaml
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[ContentProperty("Name")]
- internal class ReferenceExtension : IMarkupExtension
+ public class ReferenceExtension : IMarkupExtension
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string Name { get; set; }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public object ProvideValue(IServiceProvider serviceProvider)
{
if (serviceProvider == null)
foreach (var target in valueProvider.ParentObjects)
{
- var ns = target as INameScope;
+ var bo = target as BindableObject;
+ if (bo == null)
+ continue;
+ var ns = NameScope.GetNameScope(bo) as INameScope;
if (ns == null)
continue;
var value = ns.FindByName(Name);
if (value != null)
return value;
}
+ //foreach (var target in valueProvider.ParentObjects)
+ //{
+ // var ns = target as INameScope;
+ // if (ns == null)
+ // continue;
+ // var value = ns.FindByName(Name);
+ // if (value != null)
+ // return value;
+ //}
var lineInfo = (serviceProvider?.GetService(typeof(IXmlLineInfoProvider)) as IXmlLineInfoProvider)?.XmlLineInfo ?? new XmlLineInfo();
throw new XamlParseException($"Can not find the object referenced by `{Name}`", lineInfo);
using System;
+using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Xml;
namespace Tizen.NUI.Xaml
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[ContentProperty(nameof(Member))]
[ProvideCompiled("Tizen.NUI.Xaml.Build.Tasks.StaticExtension")]
- internal class StaticExtension : IMarkupExtension
+ public class StaticExtension : IMarkupExtension
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string Member { get; set; }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public object ProvideValue(IServiceProvider serviceProvider)
{
IXmlLineInfoProvider lineInfoProvider;
using System.Reflection;
using System.IO;
using Tizen.NUI.Binding;
+using System.ComponentModel;
namespace Tizen.NUI.Xaml
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[ContentProperty(nameof(Style))]
[ProvideCompiled("Tizen.NUI.Core.XamlC.StyleSheetProvider")]
- internal sealed class StyleSheetExtension : IValueProvider
+ public sealed class StyleSheetExtension : IValueProvider
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string Style { get; set; }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public Uri Source { get; set; }
object IValueProvider.ProvideValue(IServiceProvider serviceProvider)
--- /dev/null
+using System;
+using System.ComponentModel;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Xaml
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [ContentProperty("Path")]
+ [AcceptEmptyServiceProvider]
+ public sealed class TemplateBindingExtension : IMarkupExtension<BindingBase>
+ {
+ internal TemplateBindingExtension()
+ {
+ Mode = BindingMode.Default;
+ Path = Tizen.NUI.Binding.Binding.SelfPath;
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string Path { get; set; }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public BindingMode Mode { get; set; }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public IValueConverter Converter { get; set; }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public object ConverterParameter { get; set; }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string StringFormat { get; set; }
+
+ BindingBase IMarkupExtension<BindingBase>.ProvideValue(IServiceProvider serviceProvider)
+ {
+ return new TemplateBinding(Path, Mode, Converter, ConverterParameter, StringFormat);
+ }
+
+ object IMarkupExtension.ProvideValue(IServiceProvider serviceProvider)
+ {
+ return (this as IMarkupExtension<BindingBase>).ProvideValue(serviceProvider);
+ }
+ }
+}
\ No newline at end of file
using System.Reflection;
using System.Linq;
using Tizen.NUI.Binding;
-
+using System.ComponentModel;
namespace Tizen.NUI.Xaml
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[ContentProperty("Key")]
- internal sealed class StaticResourceExtension : IMarkupExtension
+ public sealed class StaticResourceExtension : IMarkupExtension
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string Key { get; set; }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public object ProvideValue(IServiceProvider serviceProvider)
{
if (serviceProvider == null)
--- /dev/null
+using System;
+using System.ComponentModel;
+
+namespace Tizen.NUI.Xaml
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [System.AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)]
+ public sealed class TypeConversionAttribute : Attribute
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Type TargetType { get; private set; }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public TypeConversionAttribute(Type targetType)
+ {
+ TargetType = targetType;
+ }
+ }
+}
\ No newline at end of file
using System;
+using System.ComponentModel;
using System.Reflection;
using System.Runtime.CompilerServices;
namespace Tizen.NUI.Xaml
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[Flags]
- internal enum XamlCompilationOptions
+ public enum XamlCompilationOptions
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
Skip = 1 << 0,
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
Compile = 1 << 1
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class, Inherited = false)]
- internal sealed class XamlCompilationAttribute : Attribute
+ public sealed class XamlCompilationAttribute : Attribute
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public XamlCompilationAttribute(XamlCompilationOptions xamlCompilationOptions)
{
XamlCompilationOptions = xamlCompilationOptions;
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public XamlCompilationOptions XamlCompilationOptions { get; set; }
}
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+
+namespace Tizen.NUI.Xaml
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
+ public sealed class XamlFilePathAttribute : Attribute
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public XamlFilePathAttribute([CallerFilePath] string filePath = "")
+ {
+ }
+ }
+}
\ No newline at end of file
using System;
+using System.ComponentModel;
using System.Diagnostics;
using System.Text;
using System.Xml;
namespace Tizen.NUI.Xaml
{
- internal class XamlParseException : Exception
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class XamlParseException : Exception
{
readonly string _unformattedMessage;
return ret;
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public XamlParseException(string message, IXmlLineInfo xmlInfo, Exception innerException = null) : base(FormatMessage(message + GetStackInfo(), xmlInfo), innerException)
{
_unformattedMessage = message;
XmlInfo = xmlInfo;
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public IXmlLineInfo XmlInfo { get; private set; }
internal string UnformattedMessage
using System;
+using System.ComponentModel;
using System.Reflection;
namespace Tizen.NUI.Xaml
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.Assembly, Inherited = false, AllowMultiple = true)]
- internal sealed class XamlResourceIdAttribute : Attribute
+ public sealed class XamlResourceIdAttribute : Attribute
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string ResourceId { get; set; }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string Path { get; set; }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public Type Type { get; set; }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public XamlResourceIdAttribute(string resourceId, string path, Type type)
{
ResourceId = resourceId;
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Reflection;
using System.Xml;
+using Tizen.NUI.Binding;
using Tizen.NUI.Binding.Internals;
namespace Tizen.NUI.Xaml
{
- internal class XamlServiceProvider : IServiceProvider
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class XamlServiceProvider : IServiceProvider
{
readonly Dictionary<Type, object> services = new Dictionary<Type, object>();
IXamlTypeResolver = new XamlTypeResolver(node.NamespaceResolver, XamlParser.GetElementType,
context?.RootElement.GetType().GetTypeInfo().Assembly);
- var enode = node;
- while (enode != null && !(enode is IElementNode))
- enode = enode.Parent;
- if (enode != null)
- INameScopeProvider = new NameScopeProvider { NameScope = (enode as IElementNode).Namescope };
+ Add(typeof(IReferenceProvider), new ReferenceProvider(node));
}
var xmlLineInfo = node as IXmlLineInfo;
IValueConverterProvider = new ValueConverterProvider();
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public XamlServiceProvider()
{
IValueConverterProvider = new ValueConverterProvider();
set { services[typeof (IValueConverterProvider)] = value; }
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public object GetService(Type serviceType)
{
object service;
return services.TryGetValue(serviceType, out service) ? service : null;
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public void Add(Type type, object service)
{
services.Add(type, service);
}
}
- internal class SimpleValueTargetProvider : IProvideParentValues, IProvideValueTarget
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class SimpleValueTargetProvider : IProvideParentValues, IProvideValueTarget, IReferenceProvider
{
readonly object[] objectAndParents;
readonly object targetProperty;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("SimpleValueTargetProvider(object[] objectAndParents) is obsolete as of version 2.3.4. Please use SimpleValueTargetProvider(object[] objectAndParents, object targetProperty) instead.")]
public SimpleValueTargetProvider(object[] objectAndParents) : this (objectAndParents, null)
{
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public SimpleValueTargetProvider(object[] objectAndParents, object targetProperty)
{
if (objectAndParents == null)
}
IEnumerable<object> IProvideParentValues.ParentObjects
- {
- get { return objectAndParents; }
- }
+ => objectAndParents;
object IProvideValueTarget.TargetObject
- {
- get { return objectAndParents[0]; }
- }
+ => objectAndParents[0];
object IProvideValueTarget.TargetProperty
+ => targetProperty;
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public object FindByName(string name)
{
- get { return targetProperty; }
+ for (var i = 0; i < objectAndParents.Length; i++) {
+ var bo = objectAndParents[i] as BindableObject;
+ if (bo == null) continue;
+ var ns = NameScope.GetNameScope(bo) as INameScope;
+ if (ns == null) continue;
+ var value = ns.FindByName(name);
+ if (value != null)
+ return value;
+ }
+ return null;
}
}
- internal class XamlTypeResolver : IXamlTypeResolver
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class XamlTypeResolver : IXamlTypeResolver
{
readonly Assembly currentAssembly;
readonly GetTypeFromXmlName getTypeFromXmlName;
readonly IXmlNamespaceResolver namespaceResolver;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public XamlTypeResolver(IXmlNamespaceResolver namespaceResolver, Assembly currentAssembly)
: this(namespaceResolver, XamlParser.GetElementType, currentAssembly)
{
public object RootObject { get; }
}
- internal class XmlLineInfoProvider : IXmlLineInfoProvider
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class XmlLineInfoProvider : IXmlLineInfoProvider
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public XmlLineInfoProvider(IXmlLineInfo xmlLineInfo)
{
XmlLineInfo = xmlLineInfo;
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public IXmlLineInfo XmlLineInfo { get; }
}
- internal class NameScopeProvider : INameScopeProvider
+ class ReferenceProvider : IReferenceProvider
+ {
+ readonly INode _node;
+ internal ReferenceProvider(INode node)
+ => _node = node;
+
+ public object FindByName(string name)
+ {
+ var n = _node;
+ object value = null;
+ while (n != null) {
+ if ((value = (n as IElementNode)?.Namescope?.FindByName(name)) != null)
+ return value;
+ n = n.Parent;
+ }
+ return null;
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [Obsolete]
+ public class NameScopeProvider : INameScopeProvider
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public INameScope NameScope { get; set; }
}
- internal class XmlNamespaceResolver : IXmlNamespaceResolver
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class XmlNamespaceResolver : IXmlNamespaceResolver
{
readonly Dictionary<string, string> namespaces = new Dictionary<string, string>();
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
{
throw new NotImplementedException();
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string LookupNamespace(string prefix)
{
string result;
return null;
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string LookupPrefix(string namespaceName)
{
throw new NotImplementedException();
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public void Add(string prefix, string ns)
{
namespaces.Add(prefix, ns);
--- /dev/null
+using System.ComponentModel;
+using System.Xml;
+
+namespace Tizen.NUI.Xaml
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class XmlLineInfo : IXmlLineInfo
+ {
+ readonly bool _hasLineInfo;
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public XmlLineInfo()
+ {
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public XmlLineInfo(int linenumber, int lineposition)
+ {
+ _hasLineInfo = true;
+ LineNumber = linenumber;
+ LinePosition = lineposition;
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool HasLineInfo()
+ {
+ return _hasLineInfo;
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int LineNumber { get; }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int LinePosition { get; }
+ }
+}
\ No newline at end of file
/// </summary>
/// <param name="targetProperty">The BindableProperty on which to set a binding.</param>
/// <param name="binding">The binding to set.</param>
- internal void SetBinding(BindableProperty targetProperty, BindingBase binding)
+ /// 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 void SetBinding(BindableProperty targetProperty, BindingBase binding)
{
SetBinding(targetProperty, binding, false);
}
private bool isCreateByXaml = false;
- internal virtual bool IsCreateByXaml
+ /// Only used by the IL of xaml, will never changed to not hidden.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual bool IsCreateByXaml
{
get
{
using System;
+using System.ComponentModel;
using System.Linq.Expressions;
namespace Tizen.NUI.Binding
{
- internal static class BindableObjectExtensions
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static class BindableObjectExtensions
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static void SetBinding(this BindableObject self, BindableProperty targetProperty, string path, BindingMode mode = BindingMode.Default, IValueConverter converter = null,
string stringFormat = null)
{
self.SetBinding(targetProperty, binding);
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete]
public static void SetBinding<TSource>(this BindableObject self, BindableProperty targetProperty, Expression<Func<TSource, object>> sourceProperty, BindingMode mode = BindingMode.Default,
IValueConverter converter = null, string stringFormat = null)
{ typeof(Position), new PositionTypeConverter() },
{ typeof(Rectangle), new RectangleTypeConverter() },
{ typeof(Rotation), new RotationTypeConverter() },
- { typeof(Thickness), new ThicknessTypeConverter() },
{ typeof(Vector2), new Vector2TypeConverter() },
{ typeof(Vector3), new Vector3TypeConverter() },
{ typeof(Vector4), new Vector4TypeConverter() },
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
namespace Tizen.NUI.Binding
{
- [Xaml.ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.BindablePropertyConverter")]
- [Xaml.TypeConversion(typeof(BindableProperty))]
- internal sealed class BindablePropertyConverter : TypeConverter, IExtendedTypeConverter
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.BindablePropertyConverter")]
+ [TypeConversion(typeof(BindableProperty))]
+ public sealed class BindablePropertyConverter : TypeConverter, IExtendedTypeConverter
{
object IExtendedTypeConverter.ConvertFrom(CultureInfo culture, object value, IServiceProvider serviceProvider)
{
throw new XamlParseException($"Can't resolve {value}. Syntax is [[prefix:]Type.]PropertyName.", lineinfo);
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override object ConvertFromInvariantString(string value)
{
if (string.IsNullOrWhiteSpace(value))
namespace Tizen.NUI.Binding
{
- internal sealed class Binding : BindingBase
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public sealed class Binding : BindingBase
{
internal const string SelfPath = ".";
IValueConverter _converter;
object _source;
string _updateSourceEventName;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public Binding()
{
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public Binding(string path, BindingMode mode = BindingMode.Default, IValueConverter converter = null, object converterParameter = null, string stringFormat = null, object source = null)
{
if (path == null)
Source = source;
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public IValueConverter Converter
{
get { return _converter; }
}
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public object ConverterParameter
{
get { return _converterParameter; }
}
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string Path
{
get { return _path; }
}
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public object Source
{
get { return _source; }
}
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public string UpdateSourceEventName {
get { return _updateSourceEventName; }
}
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete]
public static Binding Create<TSource>(Expression<Func<TSource, object>> propertyGetter, BindingMode mode = BindingMode.Default, IValueConverter converter = null, object converterParameter = null,
string stringFormat = null)
/// An abstract class that provides a BindingMode and a formatting option.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- internal abstract class BindingBase
+ public abstract class BindingBase
{
static readonly ConditionalWeakTable<IEnumerable, CollectionSynchronizationContext> SynchronizedCollections = new ConditionalWeakTable<IEnumerable, CollectionSynchronizationContext>();
/// <summary>
/// Gets or sets the mode for this binding.
/// </summary>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public BindingMode Mode
{
get { return _mode; }
/// <summary>
/// Gets or sets the string format for this binding.
/// </summary>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string StringFormat
{
get { return _stringFormat; }
}
}
- public object TargetNullValue
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public object TargetNullValue
{
get { return _targetNullValue; }
set {
}
}
- public object FallbackValue {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public object FallbackValue {
get => _fallbackValue;
set {
ThrowIfApplied();
/// Stops synchronization on the collection.
/// </summary>
/// <param name="collection">The collection on which to stop synchronization.</param>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static void DisableCollectionSynchronization(IEnumerable collection)
{
if (collection == null)
SynchronizedCollections.Remove(collection);
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static void EnableCollectionSynchronization(IEnumerable collection, object context, CollectionSynchronizationCallback callback)
{
if (collection == null)
/// <summary>
/// Throws an InvalidOperationException if the binding has been applied.
/// </summary>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
protected void ThrowIfApplied()
{
if (IsApplied)
--- /dev/null
+using System.ComponentModel;
+using Tizen.NUI.Xaml;
+
+namespace Tizen.NUI.Binding
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.BindingTypeConverter")]
+ [TypeConversion(typeof(Binding))]
+ public sealed class BindingTypeConverter : TypeConverter
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override object ConvertFromInvariantString(string value)
+ {
+ return new Binding(value);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+using System.Collections;
+using System.ComponentModel;
+
+namespace Tizen.NUI.Binding
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public delegate void CollectionSynchronizationCallback(IEnumerable collection, object context, Action accessMethod, bool writeAccess);
+}
\ No newline at end of file
using System;
+using System.ComponentModel;
using System.Globalization;
+using Tizen.NUI.Xaml;
namespace Tizen.NUI.Binding
{
- [Xaml.ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.ColorTypeConverter")]
- [Xaml.TypeConversion(typeof(Color))]
- internal class ColorTypeConverter : TypeConverter
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.ColorTypeConverter")]
+ [TypeConversion(typeof(Color))]
+ public class ColorTypeConverter : TypeConverter
{
// Supported inputs
// HEX #rgb, #argb, #rrggbb, #aarrggbb
// float array 0.5,0.5,0.5,0.5
// Predefined color case insensitive
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override object ConvertFromInvariantString(string value)
{
if (value != null)
return (j << 4) | j;
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static Color FromRgba(int r, int g, int b, int a)
{
float red = (float)r / 255;
return new Color(red, green, blue, alpha);
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static Color FromRgb(int r, int g, int b)
{
return FromRgba(r, g, b, 255);
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract partial class Element : BindableObject, IElement, INameScope, IElementController
{
-
- // public static readonly BindableProperty MenuProperty = BindableProperty.CreateAttached(nameof(Menu), typeof(Menu), typeof(Element), null);
-
- // public static Menu GetMenu(BindableObject bindable)
- // {
- // return (Menu)bindable.GetValue(MenuProperty);
- // }
-
- // public static void SetMenu(BindableObject bindable, Menu menu)
- // {
- // bindable.SetValue(MenuProperty, menu);
- // }
-
internal static readonly ReadOnlyCollection<Element> EmptyChildren = new ReadOnlyCollection<Element>(new Element[0]);
/// <summary>
Dictionary<BindableProperty, string> _dynamicResources;
- IEffectControlProvider _effectControlProvider;
-
- TrackableCollection<Effect> _effects;
-
Guid? _id;
Element _parentOverride;
- IPlatform _platform;
-
string _styleId;
/// <summary>
set { SetValue(ClassIdProperty, value); }
}
- internal IList<Effect> Effects
- {
- get
- {
- if (_effects == null)
- {
- _effects = new TrackableCollection<Effect>();
- _effects.CollectionChanged += EffectsOnCollectionChanged;
- _effects.Clearing += EffectsOnClearing;
- }
- return _effects;
- }
- }
-
/// <summary>
/// Gets a value that can be used to uniquely identify an element through the run of an application.
/// </summary>
/// <summary>
/// For internal use.
/// </summary>
- internal IPlatform Platform
- {
- get
- {
- if (_platform == null && RealParent != null)
- return RealParent.Platform;
- return _platform;
- }
- set
- {
- if (_platform == value)
- return;
- _platform = value;
- PlatformSet?.Invoke(this, EventArgs.Empty);
- foreach (Element descendant in Descendants())
- {
- descendant._platform = _platform;
- descendant.PlatformSet?.Invoke(this, EventArgs.Empty);
- }
- }
- }
-
- /// <summary>
- /// For internal use.
- /// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public Element RealParent { get; private set; }
OnParentSet();
- if (RealParent != null)
- {
- IPlatform platform = RealParent.Platform;
- if (platform != null)
- Platform = platform;
- }
-
OnPropertyChanged();
}
}
_changeHandlers.Remove(onchanged);
}
- /// <summary>
- /// For internal use.
- /// </summary>
- internal IEffectControlProvider EffectControlProvider
- {
- get { return _effectControlProvider; }
- set
- {
- if (_effectControlProvider == value)
- return;
- if (_effectControlProvider != null && _effects != null)
- {
- foreach (Effect effect in _effects)
- effect?.SendDetached();
- }
- _effectControlProvider = value;
- if (_effectControlProvider != null && _effects != null)
- {
- foreach (Effect effect in _effects)
- {
- if (effect != null)
- AttachEffect(effect);
- }
- }
- }
- }
-
//void IElementController.SetValueFromRenderer(BindableProperty property, object value) => SetValueFromRenderer(property, value);
/// <summary>
SetValueCore(property, value);
}
- /// <summary>
- /// For internal use.
- /// </summary>
- /// <param name="name">The nameof the effect</param>
- /// <returns>true if attached</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool EffectIsAttached(string name)
- {
- foreach (var effect in Effects)
- {
- if (effect.ResolveId == name)
- return true;
- }
- return false;
- }
-
object INameScope.FindByName(string name)
{
INameScope namescope = GetNameScope();
protected virtual void OnChildAdded(Element child)
{
child.Parent = this;
- if (Platform != null)
- child.Platform = Platform;
child.ApplyBindings(skipBindingContext: false, fromBindingContextChanged:true);
protected override void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
base.OnPropertyChanged(propertyName);
-
- if (_effects == null || _effects.Count == 0)
- return;
-
- var args = new PropertyChangedEventArgs(propertyName);
- foreach (Effect effect in _effects)
- {
- effect?.SendOnElementPropertyChanged(args);
- }
}
/// <summary>
{
}
- /// <summary>
- /// For internal use.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler PlatformSet;
-
internal virtual void SetChildInheritedBindingContext(Element child, object context)
{
SetInheritedBindingContext(child, context);
}
}
- void AttachEffect(Effect effect)
- {
- if (_effectControlProvider == null)
- return;
- if (effect.IsAttached)
- throw new InvalidOperationException("Cannot attach Effect to multiple sources");
-
- Effect effectToRegister = effect;
- if (effect is RoutingEffect)
- effectToRegister = ((RoutingEffect)effect).Inner;
- _effectControlProvider.RegisterEffect(effectToRegister);
- effectToRegister.Element = this;
- effect.SendAttached();
- }
-
- void EffectsOnClearing(object sender, EventArgs eventArgs)
- {
- foreach (Effect effect in _effects)
- {
- effect?.ClearEffect();
- }
- }
-
- void EffectsOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
- {
- switch (e.Action)
- {
- case NotifyCollectionChangedAction.Add:
- foreach (Effect effect in e.NewItems)
- {
- AttachEffect(effect);
- }
- break;
- case NotifyCollectionChangedAction.Move:
- break;
- case NotifyCollectionChangedAction.Remove:
- foreach (Effect effect in e.OldItems)
- {
- effect.ClearEffect();
- }
- break;
- case NotifyCollectionChangedAction.Replace:
- foreach (Effect effect in e.NewItems)
- {
- AttachEffect(effect);
- }
- foreach (Effect effect in e.OldItems)
- {
- effect.ClearEffect();
- }
- break;
- case NotifyCollectionChangedAction.Reset:
- if (e.NewItems != null)
- {
- foreach (Effect effect in e.NewItems)
- {
- AttachEffect(effect);
- }
- }
- if (e.OldItems != null)
- {
- foreach (Effect effect in e.OldItems)
- {
- effect.ClearEffect();
- }
- }
- break;
- default:
- throw new ArgumentOutOfRangeException();
- }
- }
-
INameScope GetNameScope()
{
INameScope namescope = NameScope.GetNameScope(this);
--- /dev/null
+using System;
+using System.ComponentModel;
+
+namespace Tizen.NUI.Binding
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class ElementEventArgs : EventArgs
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ElementEventArgs(Element element)
+ {
+ if (element == null)
+ throw new ArgumentNullException("element");
+
+ Element = element;
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Element Element { get; private set; }
+ }
+}
--- /dev/null
+using System.ComponentModel;
+
+namespace Tizen.NUI.Binding
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public interface IRegisterable
+ {
+ }
+}
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Reflection;
+
+namespace Tizen.NUI.Binding
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public abstract class Behavior : BindableObject, IAttachedObject
+ {
+ internal Behavior(Type associatedType)
+ {
+ if (associatedType == null)
+ throw new ArgumentNullException("associatedType");
+ AssociatedType = associatedType;
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected Type AssociatedType { get; }
+
+ void IAttachedObject.AttachTo(BindableObject bindable)
+ {
+ if (bindable == null)
+ throw new ArgumentNullException("bindable");
+ if (!AssociatedType.IsInstanceOfType(bindable))
+ throw new InvalidOperationException("bindable not an instance of AssociatedType");
+ OnAttachedTo(bindable);
+ }
+
+ void IAttachedObject.DetachFrom(BindableObject bindable)
+ {
+ OnDetachingFrom(bindable);
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected virtual void OnAttachedTo(BindableObject bindable)
+ {
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected virtual void OnDetachingFrom(BindableObject bindable)
+ {
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public abstract class Behavior<T> : Behavior where T : BindableObject
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected Behavior() : base(typeof(T))
+ {
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void OnAttachedTo(BindableObject bindable)
+ {
+ base.OnAttachedTo(bindable);
+ OnAttachedTo((T)bindable);
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected virtual void OnAttachedTo(T bindable)
+ {
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void OnDetachingFrom(BindableObject bindable)
+ {
+ OnDetachingFrom((T)bindable);
+ base.OnDetachingFrom(bindable);
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected virtual void OnDetachingFrom(T bindable)
+ {
+ }
+ }
+}
\ No newline at end of file
using System;
+using System.ComponentModel;
using Tizen.NUI.Xaml;
namespace Tizen.NUI.Binding
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.PassthroughValueProvider")]
[AcceptEmptyServiceProvider]
- internal sealed class BindingCondition : Condition, IValueProvider
+ public sealed class BindingCondition : Condition, IValueProvider
{
readonly BindableProperty _boundProperty;
BindingBase _binding;
object _triggerValue;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public BindingCondition()
{
_boundProperty = BindableProperty.CreateAttached("Bound", typeof(object), typeof(BindingCondition), null, propertyChanged: OnBoundPropertyChanged);
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public BindingBase Binding
{
get { return _binding; }
}
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public object Value
{
get { return _triggerValue; }
using System;
+using System.ComponentModel;
namespace Tizen.NUI.Binding
{
- internal abstract class Condition
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public abstract class Condition
{
Action<BindableObject, bool, bool> _conditionChanged;
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using Tizen.NUI.Xaml;
namespace Tizen.NUI.Binding
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[ContentProperty("Setters")]
[ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.PassthroughValueProvider")]
[AcceptEmptyServiceProvider]
- internal sealed class DataTrigger : TriggerBase, IValueProvider
+ public sealed class DataTrigger : TriggerBase, IValueProvider
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public DataTrigger([TypeConverter(typeof(TypeTypeConverter))] [Parameter("TargetType")] Type targetType) : base(new BindingCondition(), targetType)
{
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public BindingBase Binding
{
get { return ((BindingCondition)Condition).Binding; }
}
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public new IList<Setter> Setters
{
get { return base.Setters; }
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public object Value
{
get { return ((BindingCondition)Condition).Value; }
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Linq;
using System.Reflection;
using Tizen.NUI.Binding.Internals;
namespace Tizen.NUI.Binding
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[ContentProperty("Actions")]
- internal sealed class EventTrigger : TriggerBase
+ public sealed class EventTrigger : TriggerBase
{
static readonly MethodInfo s_handlerinfo = typeof(EventTrigger).GetRuntimeMethods().Single(mi => mi.Name == "OnEventTriggered" && mi.IsPublic == false);
readonly List<BindableObject> _associatedObjects = new List<BindableObject>();
string _eventname;
Delegate _handlerdelegate;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public EventTrigger() : base(typeof(BindableObject))
{
Actions = new SealedList<TriggerAction>();
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public IList<TriggerAction> Actions { get; }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string Event
{
get { return _eventname; }
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+
+namespace Tizen.NUI.Binding
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [ContentProperty("Setters")]
+ public sealed class MultiTrigger : TriggerBase
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public MultiTrigger([TypeConverter(typeof(TypeTypeConverter))] [Parameter("TargetType")] Type targetType) : base(new MultiCondition(), targetType)
+ {
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public IList<Condition> Conditions
+ {
+ get { return ((MultiCondition)Condition).Conditions; }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new IList<Setter> Setters
+ {
+ get { return base.Setters; }
+ }
+ }
+}
\ No newline at end of file
namespace Tizen.NUI.Binding
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[ProvideCompiled("Tizen.NUI.Core.XamlC.PassthroughValueProvider")]
[AcceptEmptyServiceProvider]
- internal sealed class XamlPropertyCondition : Condition, IValueProvider
+ public sealed class XamlPropertyCondition : Condition, IValueProvider
{
readonly BindableProperty _stateProperty;
BindableProperty _property;
object _triggerValue;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public XamlPropertyCondition()
{
_stateProperty = BindableProperty.CreateAttached("State", typeof(bool), typeof(XamlPropertyCondition), false, propertyChanged: OnStatePropertyChanged);
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public BindableProperty Property
{
get { return _property; }
}
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public object Value
{
get { return _triggerValue; }
--- /dev/null
+using System.ComponentModel;
+
+namespace Tizen.NUI.Binding.Internals
+{
+ /// 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 class DynamicResource
+ {
+ /// 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 DynamicResource(string key)
+ {
+ Key = key;
+ }
+
+ /// 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 string Key { get; private set; }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System.ComponentModel;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Binding.Internals
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public interface IDynamicResourceHandler
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void SetDynamicResource(BindableProperty property, string key);
+ }
+}
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Xml;
+
+namespace Tizen.NUI.Binding.Internals
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public interface INameScope
+ {
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ object FindByName(string name);
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void RegisterName(string name, object scopedElement);
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void UnregisterName(string name);
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [Obsolete]void RegisterName(string name, object scopedElement, IXmlLineInfo xmlLineInfo);
+ }
+}
namespace Tizen.NUI.Binding.Internals
{
- internal class NameScope : INameScope
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class NameScope : INameScope
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty NameScopeProperty = BindableProperty.CreateAttached("NameScope", typeof(INameScope), typeof(NameScope), default(INameScope));
readonly Dictionary<string, object> _names = new Dictionary<string, object>();
_names.Remove(name);
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static INameScope GetNameScope(BindableObject bindable)
{
return (INameScope)bindable.GetValue(NameScopeProperty);
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static void SetNameScope(BindableObject bindable, INameScope value)
{
bindable.SetValue(NameScopeProperty, value);
/// </summary>
// [RenderWith(typeof(_PageRenderer))]
[EditorBrowsable(EditorBrowsableState.Never)]
- public class Page : /*VisualElement*/BaseHandle, ILayout, IPageController, IElementConfiguration<Page>, IPaddingElement
+ public class Page : BaseHandle, IPageController, IElementConfiguration<Page>
{
/// <summary>
/// For internal use.
internal static readonly BindableProperty IgnoresContainerAreaProperty = BindableProperty.Create("IgnoresContainerArea", typeof(bool), typeof(Page), false);
/// <summary>
- /// Identifies the BackgroundImage property.
- /// </summary>
- internal static readonly BindableProperty BackgroundImageProperty = BindableProperty.Create("BackgroundImage", typeof(string), typeof(Page), default(string));
-
- /// <summary>
/// Identifies the IsBusy property.
/// </summary>
internal static readonly BindableProperty IsBusyProperty = BindableProperty.Create("IsBusy", typeof(bool), typeof(Page), false, propertyChanged: (bo, o, n) => ((Page)bo).OnPageBusyChanged());
- /// <summary>
- /// Identifies the Padding property.
- /// </summary>
- internal static readonly BindableProperty PaddingProperty = PaddingElement.PaddingProperty;
-
- /// <summary>
- /// Identifies the Title property.
- /// </summary>
- internal static readonly BindableProperty TitleProperty = BindableProperty.Create("Title", typeof(string), typeof(Page), null);
-
- /// <summary>
- /// Identifies the Icon property.
- /// </summary>
- internal static readonly BindableProperty IconProperty = BindableProperty.Create("Icon", typeof(FileImageSource), typeof(Page), default(FileImageSource));
-
- readonly Lazy<PlatformConfigurationRegistry<Page>> _platformConfigurationRegistry;
-
Rectangle _containerArea;
- bool _containerAreaSet;
-
bool _hasAppeared;
ReadOnlyCollection<Element> _logicalChildren;
[EditorBrowsable(EditorBrowsableState.Never)]
public Page()
{
- var toolbarItems = new ObservableCollection<ToolbarItem>();
- toolbarItems.CollectionChanged += OnToolbarItemsCollectionChanged;
// ToolbarItems = toolbarItems;
InternalChildren.CollectionChanged += InternalChildrenOnCollectionChanged;
- _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Page>>(() => new PlatformConfigurationRegistry<Page>(this));
- }
-
- /// <summary>
- /// Identifies the image used as a background for the Page.
- /// </summary>
- /// 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 string BackgroundImage
- {
- get { return (string)GetValue(BackgroundImageProperty); }
- set { SetValue(BackgroundImageProperty, value); }
- }
-
- internal FileImageSource Icon
- {
- get { return (FileImageSource)GetValue(IconProperty); }
- set { SetValue(IconProperty, value); }
}
/// <summary>
}
/// <summary>
- /// The space between the content of the Page and it's border.
- /// </summary>
- internal Thickness Padding
- {
- get { return (Thickness)GetValue(PaddingElement.PaddingProperty); }
- set { SetValue(PaddingElement.PaddingProperty, value); }
- }
-
- Thickness IPaddingElement.PaddingDefaultValueCreator()
- {
- return default(Thickness);
- }
-
- void IPaddingElement.OnPaddingPropertyChanged(Thickness oldValue, Thickness newValue)
- {
- UpdateChildrenLayout();
- }
-
- /// <summary>
- /// The Page's title.
- /// </summary>
- /// 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 string Title
- {
- get { return (string)GetValue(TitleProperty); }
- set { SetValue(TitleProperty, value); }
- }
-
- internal IList<ToolbarItem> ToolbarItems { get;/* internal set;*/ }
-
- /// <summary>
/// For internal use.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
{
if (_containerArea == value)
return;
- _containerAreaSet = true;
+
_containerArea = value;
ForceLayout();
}
_logicalChildren ?? (_logicalChildren = new ReadOnlyCollection<Element>(InternalChildren));
/// <summary>
- /// Raised when the layout of the Page has changed.
- /// </summary>
- /// 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 event EventHandler LayoutChanged;
-
- /// <summary>
/// ndicates that the Page is about to appear.
/// </summary>
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
}
/// <summary>
- /// Lays out children Elements into the specified area.
- /// </summary>
- /// <param name="x">Left-hand side of layout area.</param>
- /// <param name="y">Top of layout area.</param>
- /// <param name="width">Width of layout area.</param>
- /// <param name="height">Height of layout area.</param>
- /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected virtual void LayoutChildren(double x, double y, double width, double height)
- {
- var area = new Rectangle((int)x, (int)y, (int)width, (int)height);
- Rectangle originalArea = area;
- if (_containerAreaSet)
- {
- area = ContainerArea;
- area.X += (int)Padding.Left;
- area.Y += (int)Padding.Right;
- area.Width -= (int)Padding.HorizontalThickness;
- area.Height -= (int)Padding.VerticalThickness;
- area.Width = Math.Max(0, area.Width);
- area.Height = Math.Max(0, area.Height);
- }
- }
-
- /// <summary>
/// When overridden, allows application developers to customize behavior immediately prior to the Page becoming visible.
/// </summary>
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
var canceled = false;
EventHandler handler = (sender, args) => { canceled = true; };
- Navigation.PopModalAsync().ContinueWith(t => { throw t.Exception; }, CancellationToken.None, TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.FromCurrentSynchronizationContext());
return !canceled;
}
base.OnParentSet();
}
- /// <summary>
- /// Requests that the children Elements of the Page update their layouts.
- /// </summary>
- /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected void UpdateChildrenLayout()
- {
- if (!ShouldLayoutChildren())
- return;
-
- double x = Padding.Left;
- double y = Padding.Top;
-
- for (var i = 0; i < LogicalChildren.Count; i++)
- {
- LayoutChanged?.Invoke(this, EventArgs.Empty);
- }
- }
-
internal virtual void OnChildMeasureInvalidated(BaseHandle child, InvalidationTrigger trigger)
{
var container = this as IPageContainer<Page>;
}
return !any;
}
-
- /// <summary>
- /// Returns the platform-specific instance of this Page, on which a platform-specific method may be called.
- /// </summary>
- /// <typeparam name="T">The platform for which to return an instance.</typeparam>
- /// <returns>The platform-specific instance of this Page</returns>
- internal IPlatformElementConfiguration<T, Page> On<T>() where T : IConfigPlatform
- {
- return _platformConfigurationRegistry.Value.On<T>();
- }
}
}
\ No newline at end of file
using System.Reflection;
using Tizen.NUI.Binding;
-namespace Tizen.NUI.Binding
-{
- // Previewer uses reflection to bind to this method; Removal or modification of visibility will break previewer.
- internal static class Registrar
- {
- internal static void RegisterAll(Type[] attrTypes) => Internals.Registrar.RegisterAll(attrTypes);
- }
-}
-
namespace Tizen.NUI.Binding.Internals
{
/// <summary>
/// For internal use.
/// </summary>
/// <typeparam name="TRegistrable"></typeparam>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- internal class Registrar<TRegistrable> where TRegistrable : class
+ public class Registrar<TRegistrable> where TRegistrable : class
{
readonly Dictionary<Type, Type> _handlers = new Dictionary<Type, Type>();
/// </summary>
/// <param name="tview">The type of the view</param>
/// <param name="trender">The type of the render.</param>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public void Register(Type tview, Type trender)
{
//avoid caching null renderers
/// <typeparam name="TOut">The type of the handler</typeparam>
/// <param name="type">The type.</param>
/// <returns>The handler instance.</returns>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public TOut GetHandler<TOut>(Type type) where TOut : TRegistrable
{
return (TOut)GetHandler(type);
/// <param name="type">The type.</param>
/// <param name="args">The args of the type</param>
/// <returns>The handler instance.</returns>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public TOut GetHandler<TOut>(Type type, params object[] args) where TOut : TRegistrable
{
return (TOut)GetHandler(type, args);
/// <typeparam name="TOut">Thetype</typeparam>
/// <param name="obj">The object instance.</param>
/// <returns>The handle of the obj.</returns>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public TOut GetHandlerForObject<TOut>(object obj) where TOut : TRegistrable
{
if (obj == null)
/// <param name="obj">The object instance</param>
/// <param name="args">The args of the type</param>
/// <returns>The handler of the object.</returns>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public TOut GetHandlerForObject<TOut>(object obj, params object[] args) where TOut : TRegistrable
{
if (obj == null)
/// </summary>
/// <param name="viewType">The view type.</param>
/// <returns>The type of the handle.</returns>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public Type GetHandlerType(Type viewType)
{
Type type;
/// </summary>
/// <param name="obj">The object instance.</param>
/// <returns>The type of the handler.</returns>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public Type GetHandlerTypeForObject(object obj)
{
if (obj == null)
/// <summary>
/// For internal use
/// </summary>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- internal static class Registrar
+ public static class Registrar
{
static Registrar()
{
internal static Dictionary<string, Type> Effects { get; } = new Dictionary<string, Type>();
internal static Dictionary<string, StyleSheets.StylePropertyAttribute> StyleProperties { get; } = new Dictionary<string, StyleSheets.StylePropertyAttribute>();
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static IEnumerable<Assembly> ExtraAssemblies { get; set; }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static Registrar<IRegisterable> Registered { get; internal set; }
-
- public static void RegisterAll(Type[] attrTypes)
- {
- Assembly[] assemblies = Device.GetAssemblies();
- if (ExtraAssemblies != null)
- assemblies = assemblies.Union(ExtraAssemblies).ToArray();
-
- Assembly defaultRendererAssembly = Device.PlatformServices.GetType().GetTypeInfo().Assembly;
- int indexOfExecuting = Array.IndexOf(assemblies, defaultRendererAssembly);
-
- if (indexOfExecuting > 0)
- {
- assemblies[indexOfExecuting] = assemblies[0];
- assemblies[0] = defaultRendererAssembly;
- }
-
- // Don't use LINQ for performance reasons
- // Naive implementation can easily take over a second to run
- foreach (Assembly assembly in assemblies)
- {
- foreach (Type attrType in attrTypes)
- {
- Attribute[] attributes;
- try
- {
- attributes = assembly.GetCustomAttributes(attrType).ToArray();
- }
- catch (System.IO.FileNotFoundException)
- {
- // Sometimes the previewer doesn't actually have everything required for these loads to work
- Console.WriteLine(nameof(Registrar), "Could not load assembly: {0} for Attibute {1} | Some renderers may not be loaded", assembly.FullName, attrType.FullName);
- continue;
- }
- var length = attributes.Length;
- for (var i = 0; i < length;i++)
- {
- var attribute = (HandlerAttribute)attributes[i];
- if (attribute.ShouldRegister())
- Registered.Register(attribute.HandlerType, attribute.TargetType);
- }
- }
-
- string resolutionName = assembly.FullName;
- var resolutionNameAttribute = (ResolutionGroupNameAttribute)assembly.GetCustomAttribute(typeof(ResolutionGroupNameAttribute));
- if (resolutionNameAttribute != null)
- resolutionName = resolutionNameAttribute.ShortName;
-
- Attribute[] effectAttributes = assembly.GetCustomAttributes(typeof(ExportEffectAttribute)).ToArray();
- var exportEffectsLength = effectAttributes.Length;
- for (var i = 0; i < exportEffectsLength;i++)
- {
- var effect = (ExportEffectAttribute)effectAttributes[i];
- Effects [resolutionName + "." + effect.Id] = effect.Type;
- }
-
- Attribute[] styleAttributes = assembly.GetCustomAttributes(typeof(StyleSheets.StylePropertyAttribute)).ToArray();
- var stylePropertiesLength = styleAttributes.Length;
- for (var i = 0; i < stylePropertiesLength; i++)
- {
- var attribute = (StyleSheets.StylePropertyAttribute)styleAttributes[i];
- StyleProperties[attribute.CssPropertyName] = attribute;
- }
- }
-
- DependencyService.Initialize(assemblies);
- }
}
}
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Xml;
namespace Tizen.NUI.Binding
{
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[ContentProperty("Value")]
[ProvideCompiled("Tizen.NUI.Core.XamlC.SetterValueProvider")]
- internal sealed class Setter : IValueProvider
+ public sealed class Setter : IValueProvider
{
readonly ConditionalWeakTable<BindableObject, object> _originalValues = new ConditionalWeakTable<BindableObject, object>();
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public BindableProperty Property { get; set; }
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public object Value { get; set; }
object IValueProvider.ProvideValue(IServiceProvider serviceProvider)
using Tizen.NUI;
using Tizen.NUI.Xaml;
+using System.ComponentModel;
namespace Tizen.NUI.Binding
{
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[ProvideCompiledAttribute("Tizen.NUI.Xaml.Core.XamlC.Size2DTypeConverter")]
- internal class SizeTypeConverter : TypeConverter
+ public class SizeTypeConverter : TypeConverter
{
+ /// 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 override object ConvertFromInvariantString(string value)
{
if (value != null)
}
}
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[ProvideCompiledAttribute("Tizen.NUI.Xaml.Core.XamlC.Size2DTypeConverter")]
- internal class Size2DTypeConverter : TypeConverter
+ public class Size2DTypeConverter : TypeConverter
{
+ /// 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 override object ConvertFromInvariantString(string value)
{
if (value != null)
namespace Tizen.NUI.Binding
{
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[ContentProperty("Setters")]
- internal sealed class Style : IStyle
+ public sealed class Style : IStyle
{
internal const string StyleClassPrefix = "Tizen.NUI.Binding.StyleClass.";
IList<TriggerBase> _triggers;
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public Style([TypeConverter(typeof(TypeTypeConverter))] [Parameter("TargetType")] Type targetType)
{
if (targetType == null)
Setters = new List<Setter>();
}
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public bool ApplyToDerivedTypes { get; set; }
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public Style BasedOn
{
get { return _basedOnStyle; }
}
}
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string BaseResourceKey
{
get { return _baseResourceKey; }
get { return _behaviors ?? (_behaviors = new AttachedCollection<Behavior>()); }
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public bool CanCascade { get; set; }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string Class { get; set; }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public IList<Setter> Setters { get; }
/// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
ApplyCore(bindable, BasedOn ?? GetBasedOnResource(bindable));
}
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public Type TargetType { get; }
void IStyle.UnApply(BindableObject bindable)
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Reflection;
using Tizen.NUI.Xaml;
namespace Tizen.NUI.Binding
{
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[ContentProperty("Setters")]
[ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.PassthroughValueProvider")]
[AcceptEmptyServiceProvider]
- internal sealed class Trigger : TriggerBase, IValueProvider
+ public sealed class Trigger : TriggerBase, IValueProvider
{
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public Trigger([TypeConverter(typeof(TypeTypeConverter))] [Parameter("TargetType")] Type targetType) : base(new XamlPropertyCondition(), targetType)
{
}
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public BindableProperty Property
{
get { return ((XamlPropertyCondition)Condition).Property; }
}
}
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public new IList<Setter> Setters
{
get { return base.Setters; }
}
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public object Value
{
get { return ((XamlPropertyCondition)Condition).Value; }
using System;
+using System.ComponentModel;
namespace Tizen.NUI.Binding
{
- internal abstract class TriggerAction
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public abstract class TriggerAction
{
internal TriggerAction(Type associatedType)
{
AssociatedType = associatedType;
}
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
protected Type AssociatedType { get; private set; }
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
protected abstract void Invoke(object sender);
internal virtual void DoInvoke(object sender)
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
+using System.ComponentModel;
namespace Tizen.NUI.Binding
{
- internal abstract class TriggerBase : BindableObject, IAttachedObject
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public abstract class TriggerBase : BindableObject, IAttachedObject
{
bool _isSealed;
Condition.ConditionChanged = OnConditionChanged;
}
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public IList<TriggerAction> EnterActions { get; }
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public IList<TriggerAction> ExitActions { get; }
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public bool IsSealed
{
get { return _isSealed; }
}
}
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public Type TargetType { get; }
internal Condition Condition { get; }
using System;
+using System.ComponentModel;
using System.Globalization;
namespace Tizen.NUI.Binding
{
- internal abstract class TypeConverter
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public abstract class TypeConverter
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public virtual bool CanConvertFrom(Type sourceType)
{
if (sourceType == null)
return sourceType == typeof(string);
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("ConvertFrom is obsolete as of version 2.2.0. Please use ConvertFromInvariantString (string) instead.")]
public virtual object ConvertFrom(object o)
{
return null;
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("ConvertFrom is obsolete as of version 2.2.0. Please use ConvertFromInvariantString (string) instead.")]
public virtual object ConvertFrom(CultureInfo culture, object o)
{
return null;
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public virtual object ConvertFromInvariantString(string value)
{
#pragma warning disable 0618 // retain until ConvertFrom removed
namespace Tizen.NUI.Binding.Internals
{
//FIXME: need a better name for this, and share with Binding, so we can share more unittests
- internal abstract class TypedBindingBase : BindingBase
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public abstract class TypedBindingBase : BindingBase
{
IValueConverter _converter;
object _converterParameter;
object _source;
string _updateSourceEventName;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public IValueConverter Converter {
get { return _converter; }
set {
}
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public object ConverterParameter {
get { return _converterParameter; }
set {
}
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public object Source {
get { return _source; }
set {
[EditorBrowsable(EditorBrowsableState.Never)]
public string AssemblyName { get; set; }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int Level { get; set; }
+
/// 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 XmlnsDefinitionAttribute(string xmlNamespace, string clrNamespace)
ClrNamespace = clrNamespace;
XmlNamespace = xmlNamespace;
+ Level = 0;
}
}
}
\ No newline at end of file