From: AdunFang <30402408+AdunFang@users.noreply.github.com> Date: Wed, 26 Jun 2019 04:31:19 +0000 (+0800) Subject: [NUI] Adjust directory (#903) X-Git-Tag: 5.5_M2~162 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=368328aebd879e0001fc169b128023f3794d2c97;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Adjust directory (#903) * [NUI] Fix memory leak * [NUI] Change some Xaml class to public --- diff --git a/src/Tizen.NUI/src/internal/Application.cs b/src/Tizen.NUI/src/internal/Application.cs index d518199..f10567d 100755 --- a/src/Tizen.NUI/src/internal/Application.cs +++ b/src/Tizen.NUI/src/internal/Application.cs @@ -323,33 +323,15 @@ namespace Tizen.NUI } } - internal class Application : BaseHandle, IResourcesProvider, IApplicationController, IElementConfiguration + internal class Application : BaseHandle, IResourcesProvider, IElementConfiguration { static Application s_current; - Task> _propertiesTask; - readonly Lazy> _platformConfigurationRegistry; - - IAppIndexingProvider _appIndexProvider; ReadOnlyCollection _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; @@ -366,70 +348,15 @@ namespace Tizen.NUI } } - 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 Properties - { - get - { - if (_propertiesTask == null) - { - _propertiesTask = GetPropertiesAsync(); - } - - return _propertiesTask.Result; - } - } - internal override ReadOnlyCollection LogicalChildrenInternal { get { return _logicalChildren ?? (_logicalChildren = new ReadOnlyCollection(InternalChildren)); } } - [EditorBrowsable(EditorBrowsableState.Never)] - public new NavigationProxy NavigationProxy { get; } - - [EditorBrowsable(EditorBrowsableState.Never)] - public int PanGestureId { get; set; } - internal IResourceDictionary SystemResources { get; } ObservableCollection InternalChildren { get; } = new ObservableCollection(); - [EditorBrowsable(EditorBrowsableState.Never)] - public void SetAppIndexingProvider(IAppIndexingProvider provider) - { - _appIndexProvider = provider; - } - ResourceDictionary _resources; public bool IsResourcesCreated => _resources != null; @@ -495,88 +422,11 @@ namespace Tizen.NUI } } - public event EventHandler ModalPopped; - - public event EventHandler ModalPopping; - - public event EventHandler ModalPushed; - - public event EventHandler ModalPushing; - - public event EventHandler PageAppearing; - - public event EventHandler 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 On() where T : IConfigPlatform - { - return _platformConfigurationRegistry.Value.On(); - } - - 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) { @@ -603,151 +453,15 @@ namespace Tizen.NUI 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> GetPropertiesAsync() - { - var deserializer = DependencyService.Get(); - if (deserializer == null) - { - Console.WriteLine("Startup", "No IDeserialzier was found registered"); - return new Dictionary(4); - } - - IDictionary properties = await deserializer.DeserializePropertiesAsync().ConfigureAwait(false); - if (properties == null) - properties = new Dictionary(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()?.SerializePropertiesAsync(Properties); - } - finally - { - SaveSemaphore.Release(); - } - - } - - class NavigationImpl : NavigationProxy - { - readonly Application _owner; - - public NavigationImpl(Application owner) - { - _owner = owner; - } - - protected override async Task 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>(() => new PlatformConfigurationRegistry(this)); swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - SendResume(); + s_current = this; } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Application obj) @@ -1535,7 +1249,7 @@ namespace Tizen.NUI { 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; } diff --git a/src/Tizen.NUI/src/internal/Xaml/ApplyPropertiesVisitor.cs b/src/Tizen.NUI/src/internal/Xaml/ApplyPropertiesVisitor.cs index 47076ac..4c5ce06 100755 --- a/src/Tizen.NUI/src/internal/Xaml/ApplyPropertiesVisitor.cs +++ b/src/Tizen.NUI/src/internal/Xaml/ApplyPropertiesVisitor.cs @@ -449,7 +449,6 @@ namespace Tizen.NUI.Xaml 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(); if (binding == null) return false; @@ -459,12 +458,6 @@ namespace Tizen.NUI.Xaml 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); @@ -477,7 +470,6 @@ namespace Tizen.NUI.Xaml var elementType = element.GetType(); var bindable = element as BindableObject; - var nativeBindingService = DependencyService.Get(); if (property == null) return false; @@ -509,9 +501,6 @@ namespace Tizen.NUI.Xaml 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; } diff --git a/src/Tizen.NUI/src/internal/Xaml/CreateValuesVisitor.cs b/src/Tizen.NUI/src/internal/Xaml/CreateValuesVisitor.cs index 9801ff8..e6ab251 100755 --- a/src/Tizen.NUI/src/internal/Xaml/CreateValuesVisitor.cs +++ b/src/Tizen.NUI/src/internal/Xaml/CreateValuesVisitor.cs @@ -225,7 +225,7 @@ namespace Tizen.NUI.Xaml 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) diff --git a/src/Tizen.NUI/src/internal/Xaml/IMarkupExtension.cs b/src/Tizen.NUI/src/internal/Xaml/IMarkupExtension.cs deleted file mode 100755 index a6f26a5..0000000 --- a/src/Tizen.NUI/src/internal/Xaml/IMarkupExtension.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace Tizen.NUI.Xaml -{ - internal interface IMarkupExtension : 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 diff --git a/src/Tizen.NUI/src/internal/Xaml/INativeValueConverterService.cs b/src/Tizen.NUI/src/internal/Xaml/INativeValueConverterService.cs deleted file mode 100755 index a5a60f2..0000000 --- a/src/Tizen.NUI/src/internal/Xaml/INativeValueConverterService.cs +++ /dev/null @@ -1,9 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/Xaml/IProvideValueTarget.cs b/src/Tizen.NUI/src/internal/Xaml/IProvideValueTarget.cs deleted file mode 100755 index cdf7b79..0000000 --- a/src/Tizen.NUI/src/internal/Xaml/IProvideValueTarget.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Tizen.NUI.Xaml -{ - internal interface IProvideValueTarget - { - object TargetObject { get; } - object TargetProperty { get; } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/Xaml/IReferenceProvider.cs b/src/Tizen.NUI/src/internal/Xaml/IReferenceProvider.cs deleted file mode 100755 index 89cb53f..0000000 --- a/src/Tizen.NUI/src/internal/Xaml/IReferenceProvider.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Tizen.NUI.Xaml -{ - internal interface IReferenceProvider - { - object FindByName(string name); - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/Xaml/IRootObjectProvider.cs b/src/Tizen.NUI/src/internal/Xaml/IRootObjectProvider.cs deleted file mode 100755 index 057ae54..0000000 --- a/src/Tizen.NUI/src/internal/Xaml/IRootObjectProvider.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Tizen.NUI.Xaml -{ - internal interface IRootObjectProvider - { - object RootObject { get; } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/Xaml/IValueProvider.cs b/src/Tizen.NUI/src/internal/Xaml/IValueProvider.cs deleted file mode 100755 index a93a3e5..0000000 --- a/src/Tizen.NUI/src/internal/Xaml/IValueProvider.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace Tizen.NUI.Xaml -{ - internal interface IValueProvider - { - object ProvideValue(IServiceProvider serviceProvider); - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/Xaml/IXamlTypeResolver.cs b/src/Tizen.NUI/src/internal/Xaml/IXamlTypeResolver.cs deleted file mode 100755 index fbf2d37..0000000 --- a/src/Tizen.NUI/src/internal/Xaml/IXamlTypeResolver.cs +++ /dev/null @@ -1,10 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/Xaml/IXmlLineInfoProvider.cs b/src/Tizen.NUI/src/internal/Xaml/IXmlLineInfoProvider.cs deleted file mode 100755 index da9ac5a..0000000 --- a/src/Tizen.NUI/src/internal/Xaml/IXmlLineInfoProvider.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Xml; - -namespace Tizen.NUI.Xaml -{ - internal interface IXmlLineInfoProvider - { - IXmlLineInfo XmlLineInfo { get; } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/BindingExtension.cs b/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/BindingExtension.cs deleted file mode 100755 index 9276783..0000000 --- a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/BindingExtension.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using Tizen.NUI.Binding.Internals; -using Tizen.NUI.Binding; - -namespace Tizen.NUI.Xaml -{ - [ContentProperty("Path")] - [AcceptEmptyServiceProvider] - internal sealed class BindingExtension : IMarkupExtension - { - 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.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).ProvideValue(serviceProvider); - } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/NullExtension.cs b/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/NullExtension.cs deleted file mode 100755 index b5a310c..0000000 --- a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/NullExtension.cs +++ /dev/null @@ -1,14 +0,0 @@ -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; - } - } -} diff --git a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/TemplateBindingExtension.cs b/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/TemplateBindingExtension.cs deleted file mode 100755 index d06f242..0000000 --- a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/TemplateBindingExtension.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using Tizen.NUI.Binding; - -namespace Tizen.NUI.Xaml -{ - [ContentProperty("Path")] - [AcceptEmptyServiceProvider] - internal sealed class TemplateBindingExtension : IMarkupExtension - { - 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.ProvideValue(IServiceProvider serviceProvider) - { - return new TemplateBinding(Path, Mode, Converter, ConverterParameter, StringFormat); - } - - object IMarkupExtension.ProvideValue(IServiceProvider serviceProvider) - { - return (this as IMarkupExtension).ProvideValue(serviceProvider); - } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/Xaml/TypeConversionAttribute.cs b/src/Tizen.NUI/src/internal/Xaml/TypeConversionAttribute.cs deleted file mode 100755 index 2b81846..0000000 --- a/src/Tizen.NUI/src/internal/Xaml/TypeConversionAttribute.cs +++ /dev/null @@ -1,15 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/Xaml/TypeConversionExtensions.cs b/src/Tizen.NUI/src/internal/Xaml/TypeConversionExtensions.cs index 8f46593..80341ae 100755 --- a/src/Tizen.NUI/src/internal/Xaml/TypeConversionExtensions.cs +++ b/src/Tizen.NUI/src/internal/Xaml/TypeConversionExtensions.cs @@ -202,12 +202,6 @@ namespace Tizen.NUI.Xaml } } - var nativeValueConverterService = DependencyService.Get(); - - object nativeValue = null; - if (nativeValueConverterService != null && nativeValueConverterService.ConvertTo(value, toType, out nativeValue)) - return nativeValue; - return value; } diff --git a/src/Tizen.NUI/src/internal/Xaml/XamlFilePathAttribute.cs b/src/Tizen.NUI/src/internal/Xaml/XamlFilePathAttribute.cs deleted file mode 100755 index 982479d..0000000 --- a/src/Tizen.NUI/src/internal/Xaml/XamlFilePathAttribute.cs +++ /dev/null @@ -1,13 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/Xaml/XamlLoader.cs b/src/Tizen.NUI/src/internal/Xaml/XamlLoader.cs index 601ef7d..c3c8bc6 100755 --- a/src/Tizen.NUI/src/internal/Xaml/XamlLoader.cs +++ b/src/Tizen.NUI/src/internal/Xaml/XamlLoader.cs @@ -39,13 +39,16 @@ using Tizen.NUI.Binding.Internals; 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 xamlFileProvider; - public static Func 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 XamlFileProvider { get { return xamlFileProvider; } internal set { diff --git a/src/Tizen.NUI/src/internal/Xaml/XamlParser.cs b/src/Tizen.NUI/src/internal/Xaml/XamlParser.cs index c2707dd..fa00be6 100755 --- a/src/Tizen.NUI/src/internal/Xaml/XamlParser.cs +++ b/src/Tizen.NUI/src/internal/Xaml/XamlParser.cs @@ -274,22 +274,8 @@ namespace Tizen.NUI.Xaml 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; } @@ -355,7 +341,7 @@ namespace Tizen.NUI.Xaml 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 }); diff --git a/src/Tizen.NUI/src/internal/Xaml/XmlLineInfo.cs b/src/Tizen.NUI/src/internal/Xaml/XmlLineInfo.cs deleted file mode 100755 index 52a886b..0000000 --- a/src/Tizen.NUI/src/internal/Xaml/XmlLineInfo.cs +++ /dev/null @@ -1,29 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/Xaml/XmlnsHelper.cs b/src/Tizen.NUI/src/internal/Xaml/XmlnsHelper.cs index 8f86874..ff51cf4 100755 --- a/src/Tizen.NUI/src/internal/Xaml/XmlnsHelper.cs +++ b/src/Tizen.NUI/src/internal/Xaml/XmlnsHelper.cs @@ -9,29 +9,27 @@ namespace Tizen.NUI.Xaml 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(';')) { @@ -40,15 +38,13 @@ namespace Tizen.NUI.Xaml 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) { @@ -60,9 +56,9 @@ namespace Tizen.NUI.Xaml } } - 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)) { diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Accelerator.cs b/src/Tizen.NUI/src/internal/XamlBinding/Accelerator.cs deleted file mode 100755 index 30501fa..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/Accelerator.cs +++ /dev/null @@ -1,86 +0,0 @@ -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 Modifiers { get; set; } - - [EditorBrowsable(EditorBrowsableState.Never)] - public IEnumerable 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(); - 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); - } - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/AcceleratorTypeConverter.cs b/src/Tizen.NUI/src/internal/XamlBinding/AcceleratorTypeConverter.cs deleted file mode 100755 index 6360184..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/AcceleratorTypeConverter.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Tizen.NUI.Binding -{ - internal class AcceleratorTypeConverter : TypeConverter - { - public override object ConvertFromInvariantString(string value) - { - if (value == null) - return null; - - return Accelerator.FromString(value); - } - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Application.cs b/src/Tizen.NUI/src/internal/XamlBinding/Application.cs deleted file mode 100755 index 1461a00..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/Application.cs +++ /dev/null @@ -1,406 +0,0 @@ -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 - { - static Application s_current; - Task> _propertiesTask; - readonly Lazy> _platformConfigurationRegistry; - - IAppIndexingProvider _appIndexProvider; - - ReadOnlyCollection _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()?.GetSystemResources(); - SystemResources.ValuesChanged += OnParentResourcesChanged; - _platformConfigurationRegistry = new Lazy>(() => new PlatformConfigurationRegistry(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 Properties - { - get - { - if (_propertiesTask == null) - { - _propertiesTask = GetPropertiesAsync(); - } - - return _propertiesTask.Result; - } - } - - internal override ReadOnlyCollection LogicalChildrenInternal - { - get { return _logicalChildren ?? (_logicalChildren = new ReadOnlyCollection(InternalChildren)); } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public NavigationProxy NavigationProxy { get; } - - [EditorBrowsable(EditorBrowsableState.Never)] - public int PanGestureId { get; set; } - - internal IResourceDictionary SystemResources { get; } - - ObservableCollection InternalChildren { get; } = new ObservableCollection(); - - [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 ModalPopped; - - public event EventHandler ModalPopping; - - public event EventHandler ModalPushed; - - public event EventHandler ModalPushing; - - public event EventHandler PageAppearing; - - public event EventHandler 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 On() where T : IConfigPlatform - { - return _platformConfigurationRegistry.Value.On(); - } - - 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> values) - { - if (!((IResourcesProvider)this).IsResourcesCreated || XamlResources.Count == 0) - { - base.OnParentResourcesChanged(values); - return; - } - - var innerKeys = new HashSet(); - var changedResources = new List>(); - foreach (KeyValuePair c in XamlResources) - innerKeys.Add(c.Key); - foreach (KeyValuePair 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> GetPropertiesAsync() - { - var deserializer = DependencyService.Get(); - if (deserializer == null) - { - Console.WriteLine("Startup", "No IDeserialzier was found registered"); - return new Dictionary(4); - } - - IDictionary properties = await deserializer.DeserializePropertiesAsync().ConfigureAwait(false); - if (properties == null) - properties = new Dictionary(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()?.SerializePropertiesAsync(Properties); - } - finally - { - SaveSemaphore.Release(); - } - - } - - class NavigationImpl : NavigationProxy - { - readonly Application _owner; - - public NavigationImpl(Application owner) - { - _owner = owner; - } - - protected override async Task 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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/BaseMenuItem.cs b/src/Tizen.NUI/src/internal/XamlBinding/BaseMenuItem.cs deleted file mode 100755 index c0abdb0..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/BaseMenuItem.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Tizen.NUI.Binding; - -namespace Tizen.NUI.Binding -{ - internal abstract class BaseMenuItem : Element - { - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/BindingTypeConverter.cs b/src/Tizen.NUI/src/internal/XamlBinding/BindingTypeConverter.cs deleted file mode 100755 index 62839e2..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/BindingTypeConverter.cs +++ /dev/null @@ -1,12 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/CollectionSynchronizationCallback.cs b/src/Tizen.NUI/src/internal/XamlBinding/CollectionSynchronizationCallback.cs deleted file mode 100755 index 056dfe8..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/CollectionSynchronizationCallback.cs +++ /dev/null @@ -1,7 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Configuration.cs b/src/Tizen.NUI/src/internal/XamlBinding/Configuration.cs deleted file mode 100755 index a99a5c2..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/Configuration.cs +++ /dev/null @@ -1,21 +0,0 @@ - -namespace Tizen.NUI.Binding -{ - internal class Configuration : IPlatformElementConfiguration - where TPlatform : IConfigPlatform - where TElement : Element - - { - public Configuration(TElement element) - { - Element = element; - } - - public TElement Element { get; } - - public static Configuration Create(TElement element) - { - return new Configuration(element); - } - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/DependencyService.cs b/src/Tizen.NUI/src/internal/XamlBinding/DependencyService.cs index 54e1424..d83d493 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/DependencyService.cs +++ b/src/Tizen.NUI/src/internal/XamlBinding/DependencyService.cs @@ -108,7 +108,7 @@ namespace Tizen.NUI.Binding 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; } diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Device.cs b/src/Tizen.NUI/src/internal/XamlBinding/Device.cs index 8987212..17156aa 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/Device.cs +++ b/src/Tizen.NUI/src/internal/XamlBinding/Device.cs @@ -22,8 +22,6 @@ namespace Tizen.NUI.Binding [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; } @@ -53,7 +51,7 @@ namespace Tizen.NUI.Binding } #pragma warning restore 0618 - public static string RuntimePlatform => PlatformServices?.RuntimePlatform; + public static string RuntimePlatform => null; [EditorBrowsable(EditorBrowsableState.Never)] public static DeviceInfo Info @@ -72,28 +70,6 @@ namespace Tizen.NUI.Binding 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 Flags { get; private set; } [EditorBrowsable(EditorBrowsableState.Never)] @@ -104,7 +80,6 @@ namespace Tizen.NUI.Binding public static void BeginInvokeOnMainThread(Action action) { - PlatformServices?.BeginInvokeOnMainThread(action); action(); Console.WriteLine("Device BeginInvokeOnMainThread action called"); } @@ -119,37 +94,6 @@ namespace Tizen.NUI.Binding // 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 iOS, T Android, T WinPhone) { @@ -172,15 +116,10 @@ namespace Tizen.NUI.Binding // PlatformServices?.OpenUriAction(uri); } - public static void StartTimer(TimeSpan interval, Func callback) - { - PlatformServices.StartTimer(interval, callback); - } - [EditorBrowsable(EditorBrowsableState.Never)] public static Assembly[] GetAssemblies() { - return PlatformServices?.GetAssemblies(); + return null; } // [EditorBrowsable(EditorBrowsableState.Never)] @@ -189,11 +128,6 @@ namespace Tizen.NUI.Binding // return PlatformServices.GetNamedSize(size, targetElementType, useOldSizes); // } - internal static Task GetStreamAsync(Uri uri, CancellationToken cancellationToken) - { - return PlatformServices?.GetStreamAsync(uri, cancellationToken); - } - public static class Styles { public static readonly string TitleStyleKey = "TitleStyle"; diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Effect.cs b/src/Tizen.NUI/src/internal/XamlBinding/Effect.cs deleted file mode 100755 index a70c710..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/Effect.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.ComponentModel; -using Tizen.NUI.Binding.Internals; - -namespace Tizen.NUI.Binding -{ - /// - /// A collection of styles and properties that can be added to an element at run time. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - internal abstract class Effect - { - internal Effect() - { - } - - /// - /// Gets the element to which the style is attached. - /// - public Element Element { get; internal set; } - - /// - /// Gets a value that tells whether the effect is attached to an element. - /// - public bool IsAttached { get; private set; } - - /// - /// Gets the ID that is used to resolve this effect at runtime. - /// - public string ResolveId { get; internal set; } - - #region Statics - /// - /// Returns an Effect for the specified name, which is of the form ResolutionGroupName.ExportEffect. - /// - /// The name of the effect to get. - /// The uniquely identified effect. - 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 - - /// - /// Method that is called after the effect is attached and made valid. - /// - protected abstract void OnAttached(); - - /// - /// Method that is called after the effect is detached and invalidated. - /// - 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) - { - } - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/EffectiveFlowDirection.cs b/src/Tizen.NUI/src/internal/XamlBinding/EffectiveFlowDirection.cs deleted file mode 100755 index 605588d..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/EffectiveFlowDirection.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace Tizen.NUI.Binding -{ - [Flags] - internal enum EffectiveFlowDirection - { - RightToLeft = 1 << 0, - Explicit = 1 << 1, - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/EffectiveFlowDirectionExtensions.cs b/src/Tizen.NUI/src/internal/XamlBinding/EffectiveFlowDirectionExtensions.cs deleted file mode 100755 index 513b27b..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/EffectiveFlowDirectionExtensions.cs +++ /dev/null @@ -1,73 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/ElementCollection.cs b/src/Tizen.NUI/src/internal/XamlBinding/ElementCollection.cs deleted file mode 100755 index 6427287..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/ElementCollection.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.ObjectModel; - -namespace Tizen.NUI.Binding -{ - internal class ElementCollection : ObservableWrapper where T : Element - { - public ElementCollection(ObservableCollection list) : base(list) - { - } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/ElementEventArgs.cs b/src/Tizen.NUI/src/internal/XamlBinding/ElementEventArgs.cs deleted file mode 100755 index fcdeacd..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/ElementEventArgs.cs +++ /dev/null @@ -1,17 +0,0 @@ -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; } - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/FileImageSource.cs b/src/Tizen.NUI/src/internal/XamlBinding/FileImageSource.cs deleted file mode 100755 index f65a0e8..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/FileImageSource.cs +++ /dev/null @@ -1,43 +0,0 @@ -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 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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/FileImageSourceConverter.cs b/src/Tizen.NUI/src/internal/XamlBinding/FileImageSourceConverter.cs deleted file mode 100755 index cf5c009..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/FileImageSourceConverter.cs +++ /dev/null @@ -1,16 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/IAppIndexingProvider.cs b/src/Tizen.NUI/src/internal/XamlBinding/IAppIndexingProvider.cs deleted file mode 100755 index 3af69c6..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/IAppIndexingProvider.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Tizen.NUI.Binding -{ - internal interface IAppIndexingProvider - { - IAppLinks AppLinks { get; } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/IAppLinkEntry.cs b/src/Tizen.NUI/src/internal/XamlBinding/IAppLinkEntry.cs deleted file mode 100755 index e08ea97..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/IAppLinkEntry.cs +++ /dev/null @@ -1,20 +0,0 @@ -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 KeyValues { get; } - - ImageSource Thumbnail { get; set; } - - string Title { get; set; } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/IAppLinks.cs b/src/Tizen.NUI/src/internal/XamlBinding/IAppLinks.cs deleted file mode 100755 index 4cc17fb..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/IAppLinks.cs +++ /dev/null @@ -1,11 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/IApplicationController.cs b/src/Tizen.NUI/src/internal/XamlBinding/IApplicationController.cs deleted file mode 100755 index 296b6cc..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/IApplicationController.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Tizen.NUI.Binding -{ - internal interface IApplicationController - { - void SetAppIndexingProvider(IAppIndexingProvider appIndexing); - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/IEffectControlProvider.cs b/src/Tizen.NUI/src/internal/XamlBinding/IEffectControlProvider.cs deleted file mode 100755 index 8f61b22..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/IEffectControlProvider.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.ComponentModel; - -namespace Tizen.NUI.Binding -{ - /// - /// When implemented in a renderer, registers a platform-specific effect on an element. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - internal interface IEffectControlProvider - { - /// - /// Registers the effect with the element by establishing the parent-child relations needed for rendering on the specific platform. - /// - /// The effect to register. - void RegisterEffect(Effect effect); - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/ILayout.cs b/src/Tizen.NUI/src/internal/XamlBinding/ILayout.cs deleted file mode 100755 index dee1f59..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/ILayout.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace Tizen.NUI.Binding -{ - internal interface ILayout - { - event EventHandler LayoutChanged; - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/ILayoutController.cs b/src/Tizen.NUI/src/internal/XamlBinding/ILayoutController.cs deleted file mode 100755 index 7ac639d..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/ILayoutController.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Collections.Generic; - -namespace Tizen.NUI.Binding -{ - internal interface ILayoutController - { - IReadOnlyList Children { get; } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/IMenuItemController.cs b/src/Tizen.NUI/src/internal/XamlBinding/IMenuItemController.cs deleted file mode 100755 index 42627dd..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/IMenuItemController.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Tizen.NUI.Binding -{ - internal interface IMenuItemController - { - bool IsEnabled { get; set; } - string IsEnabledPropertyName { get; } - - void Activate(); - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/INavigation.cs b/src/Tizen.NUI/src/internal/XamlBinding/INavigation.cs deleted file mode 100755 index d3b98e3..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/INavigation.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using System.ComponentModel; - -namespace Tizen.NUI.Binding -{ - /// - /// Interface abstracting platform-specific navigation. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - internal interface INavigation - { - /// - /// Gets the modal navigation stack. - /// - IReadOnlyList ModalStack { get; } - - /// - /// Gets the stack of pages in the navigation. - /// - IReadOnlyList NavigationStack { get; } - - /// - /// Inserts a page in the navigation stack before an existing page in the stack. - /// - /// The page to add. - /// The existing page, before which page will be inserted. - void InsertPageBefore(Page page, Page before); - - /// - /// Asynchronously removes the most recent Page from the navigation stack. - /// - /// The Page that had been at the top of the navigation stack. - Task PopAsync(); - - /// - /// Asynchronously removes the most recent Page from the navigation stack, with optional animation. - /// - /// Whether to animate the pop. - /// The Page that had been at the top of the navigation stack. - Task PopAsync(bool animated); - - /// - /// Asynchronously dismisses the most recent modally presented Page. - /// - /// An awaitable instance, indicating the PopModalAsync completion. The Task.Result is the Page that has been popped. - Task PopModalAsync(); - - /// - /// Asynchronously dismisses the most recent modally presented Page, with optional animation. - /// - /// Whether to animate the pop. - /// An awaitable, indicating the PopModalAsync completion. The Task.Result is the Page that has been popped. - Task PopModalAsync(bool animated); - - /// - /// Pops all but the root Page off the navigation stack. - /// - /// A task representing the asynchronous dismiss operation. - Task PopToRootAsync(); - - /// - /// Pops all but the root Page off the navigation stack, with optional animation. - /// - /// Whether to animate the pop. - /// A task representing the asynchronous dismiss operation. - Task PopToRootAsync(bool animated); - - /// - /// Asynchronously adds a Page to the top of the navigation stack. - /// - /// The Page to be pushed on top of the navigation stack. - /// A task that represents the asynchronous push operation. - Task PushAsync(Page page); - - /// - /// Asynchronously adds a Page to the top of the navigation stack, with optional animation. - /// - /// The page to push. - /// Whether to animate the push. - /// A task that represents the asynchronous push operation. - Task PushAsync(Page page, bool animated); - - /// - /// Presents a Page modally. - /// - /// The Page to present modally. - /// An awaitable Task, indicating the PushModal completion. - Task PushModalAsync(Page page); - - /// - /// Presents a Page modally, with optional animation. - /// - /// The page to push. - /// Whether to animate the push. - /// An awaitable Task, indicating the PushModal completion. - Task PushModalAsync(Page page, bool animated); - - /// - /// Removes the specified page from the navigation stack. - /// - /// The page to remove. - void RemovePage(Page page); - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/INavigationMenuController.cs b/src/Tizen.NUI/src/internal/XamlBinding/INavigationMenuController.cs deleted file mode 100755 index 057bf85..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/INavigationMenuController.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Tizen.NUI.Binding -{ - internal interface INavigationMenuController : IViewController - { - void SendTargetSelected(Page target); - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/INavigationPageController.cs b/src/Tizen.NUI/src/internal/XamlBinding/INavigationPageController.cs deleted file mode 100755 index 7b9bb30..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/INavigationPageController.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Tizen.NUI.Binding.Internals; - -namespace Tizen.NUI.Binding -{ - internal interface INavigationPageController - { - Task RemoveAsyncInner(Page page, bool animated, bool fast); - - Page Peek(int depth = 0); - - IEnumerable Pages { get; } - - int StackDepth { get; } - - Task PopAsyncInner(bool animated, bool fast = false); - - event EventHandler InsertPageBeforeRequested; - - event EventHandler PopRequested; - - event EventHandler PopToRootRequested; - - event EventHandler PushRequested; - - event EventHandler RemovePageRequested; - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/IPaddingElement.cs b/src/Tizen.NUI/src/internal/XamlBinding/IPaddingElement.cs deleted file mode 100755 index e0c395e..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/IPaddingElement.cs +++ /dev/null @@ -1,12 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/IPlatform.cs b/src/Tizen.NUI/src/internal/XamlBinding/IPlatform.cs deleted file mode 100755 index ca89cee..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/IPlatform.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.ComponentModel; - -namespace Tizen.NUI.Binding -{ - /// - /// For internal use. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - internal interface IPlatform - { - /// - /// Returns the native size. - /// - /// The view - /// The width constraint. - /// The height constraint. - /// The native size. - SizeRequest GetNativeSize(BaseHandle view, double widthConstraint, double heightConstraint); - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/IPlatformElementConfiguration.cs b/src/Tizen.NUI/src/internal/XamlBinding/IPlatformElementConfiguration.cs deleted file mode 100755 index 85ad36f..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/IPlatformElementConfiguration.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.ComponentModel; - -namespace Tizen.NUI.Binding -{ - /// - /// Marker interface for returning platform-specific configuration elements. - /// - /// The platform type. - /// The element type. - [EditorBrowsable(EditorBrowsableState.Never)] - internal interface IPlatformElementConfiguration : IConfigElement - where TPlatform : IConfigPlatform - where TElement : Element - { - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/IPlatformServices.cs b/src/Tizen.NUI/src/internal/XamlBinding/IPlatformServices.cs index 5e46ac0..0f2e260d 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/IPlatformServices.cs +++ b/src/Tizen.NUI/src/internal/XamlBinding/IPlatformServices.cs @@ -15,8 +15,6 @@ namespace Tizen.NUI.Binding void BeginInvokeOnMainThread(Action action); - Ticker CreateTicker(); - Assembly[] GetAssemblies(); string GetMD5Hash(string input); diff --git a/src/Tizen.NUI/src/internal/XamlBinding/IRegisterable.cs b/src/Tizen.NUI/src/internal/XamlBinding/IRegisterable.cs deleted file mode 100755 index 6974fcc..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/IRegisterable.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Tizen.NUI.Binding -{ - internal interface IRegisterable - { - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/ITimer.cs b/src/Tizen.NUI/src/internal/XamlBinding/ITimer.cs deleted file mode 100755 index 1a18f7a..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/ITimer.cs +++ /dev/null @@ -1,13 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/IViewContainer.cs b/src/Tizen.NUI/src/internal/XamlBinding/IViewContainer.cs deleted file mode 100755 index 9346c6c..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/IViewContainer.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Collections.Generic; - -namespace Tizen.NUI.Binding -{ - internal interface IViewContainer where T : /*VisualElement*/BaseHandle - { - IList Children { get; } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/IViewController.cs b/src/Tizen.NUI/src/internal/XamlBinding/IViewController.cs deleted file mode 100755 index 76e9152..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/IViewController.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Tizen.NUI.Binding -{ - internal interface IViewController : IVisualElementController - { - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/IVisualElementController.cs b/src/Tizen.NUI/src/internal/XamlBinding/IVisualElementController.cs deleted file mode 100755 index 94eec77..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/IVisualElementController.cs +++ /dev/null @@ -1,20 +0,0 @@ -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> BatchCommitted; - event EventHandler FocusChangeRequested; - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/ImageSource.cs b/src/Tizen.NUI/src/internal/XamlBinding/ImageSource.cs deleted file mode 100755 index fa59903..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/ImageSource.cs +++ /dev/null @@ -1,151 +0,0 @@ -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 _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 Cancel() - { - if (!IsLoading) - return Task.FromResult(false); - - var tcs = new TaskCompletionSource(); - TaskCompletionSource 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) - { - // 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 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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/ImageSourceConverter.cs b/src/Tizen.NUI/src/internal/XamlBinding/ImageSourceConverter.cs deleted file mode 100755 index 1082dc2..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/ImageSourceConverter.cs +++ /dev/null @@ -1,19 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/Behavior.cs b/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/Behavior.cs deleted file mode 100755 index 388f3a8..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/Behavior.cs +++ /dev/null @@ -1,66 +0,0 @@ -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 : 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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/MultiTrigger.cs b/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/MultiTrigger.cs deleted file mode 100755 index 0311a3b..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/MultiTrigger.cs +++ /dev/null @@ -1,23 +0,0 @@ -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 Conditions - { - get { return ((MultiCondition)Condition).Conditions; } - } - - public new IList Setters - { - get { return base.Setters; } - } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/PropertyCondition.cs b/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/PropertyCondition.cs deleted file mode 100755 index 54bc675..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/PropertyCondition.cs +++ /dev/null @@ -1,112 +0,0 @@ -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 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 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(); - - 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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Internals/DynamicResource.cs b/src/Tizen.NUI/src/internal/XamlBinding/Internals/DynamicResource.cs deleted file mode 100755 index 30545a8..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/Internals/DynamicResource.cs +++ /dev/null @@ -1,14 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Internals/IDynamicResourceHandler.cs b/src/Tizen.NUI/src/internal/XamlBinding/Internals/IDynamicResourceHandler.cs deleted file mode 100755 index 62d53a2..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/Internals/IDynamicResourceHandler.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.ComponentModel; -using Tizen.NUI.Binding; - -namespace Tizen.NUI.Binding.Internals -{ - internal interface IDynamicResourceHandler - { - void SetDynamicResource(BindableProperty property, string key); - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Internals/INameScope.cs b/src/Tizen.NUI/src/internal/XamlBinding/Internals/INameScope.cs deleted file mode 100755 index c9b6ba8..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/Internals/INameScope.cs +++ /dev/null @@ -1,14 +0,0 @@ -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); - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Internals/Ticker.cs b/src/Tizen.NUI/src/internal/XamlBinding/Internals/Ticker.cs deleted file mode 100755 index 7b00bb9..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/Internals/Ticker.cs +++ /dev/null @@ -1,99 +0,0 @@ -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>> _timeouts; - - int _count; - bool _enabled; - - protected Ticker() - { - _count = 0; - _timeouts = new List>>(); - - _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 timeout) - { - _count++; - _timeouts.Add(new Tuple>(_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>>(_timeouts); - foreach (Tuple> 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(); - } - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Layout.cs b/src/Tizen.NUI/src/internal/XamlBinding/Layout.cs deleted file mode 100755 index f3a0071..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/Layout.cs +++ /dev/null @@ -1,319 +0,0 @@ -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 : Layout, IViewContainer where T : View - { - readonly ElementCollection _children; - - protected Layout() - { - _children = new ElementCollection(InternalChildren); - } - - public new IList 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> s_resolutionList = new List>(); - static bool s_relayoutInProgress; - - bool _hasDoneLayout; - Size _lastLayoutSize = new Size(-1, -1, 0); - - ReadOnlyCollection _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 InternalChildren { get; } = new ObservableCollection(); - - internal override ReadOnlyCollection LogicalChildrenInternal - { - get { return _logicalChildren ?? (_logicalChildren = new ReadOnlyCollection(InternalChildren)); } - } - - /// - /// Raised when the layout of the Page has changed. - /// - public event EventHandler LayoutChanged; - - [EditorBrowsable(EditorBrowsableState.Never)] - public new IReadOnlyList 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 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(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> copy = s_resolutionList; - s_resolutionList = new List>(); - 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; - } - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/LayoutAlignment.cs b/src/Tizen.NUI/src/internal/XamlBinding/LayoutAlignment.cs deleted file mode 100755 index 66f4789..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/LayoutAlignment.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace Tizen.NUI.Binding -{ - [Flags] - internal enum LayoutAlignment - { - Start = 0, - Center = 1, - End = 2, - Fill = 3 - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/LayoutExpandFlag.cs b/src/Tizen.NUI/src/internal/XamlBinding/LayoutExpandFlag.cs deleted file mode 100755 index 4cc3c2b..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/LayoutExpandFlag.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace Tizen.NUI.Binding -{ - [Flags] - internal enum LayoutExpandFlag - { - Expand = 4 - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/LayoutOptions.cs b/src/Tizen.NUI/src/internal/XamlBinding/LayoutOptions.cs deleted file mode 100755 index 2c9bf7a..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/LayoutOptions.cs +++ /dev/null @@ -1,39 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/LayoutOptionsConverter.cs b/src/Tizen.NUI/src/internal/XamlBinding/LayoutOptionsConverter.cs deleted file mode 100755 index 98cddaa..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/LayoutOptionsConverter.cs +++ /dev/null @@ -1,39 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/MenuItem.cs b/src/Tizen.NUI/src/internal/XamlBinding/MenuItem.cs deleted file mode 100755 index fd3acd6..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/MenuItem.cs +++ /dev/null @@ -1,134 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/MergedStyle.cs b/src/Tizen.NUI/src/internal/XamlBinding/MergedStyle.cs index eb8710d..6358008 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/MergedStyle.cs +++ b/src/Tizen.NUI/src/internal/XamlBinding/MergedStyle.cs @@ -11,7 +11,7 @@ namespace Tizen.NUI.Binding { ////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 s_stopAtTypes = new List { typeof(View), typeof(Layout<>), typeof(Element) }; + static readonly IList s_stopAtTypes = new List { typeof(View), typeof(Element) }; IList _classStyleProperties; diff --git a/src/Tizen.NUI/src/internal/XamlBinding/ModalEventArgs.cs b/src/Tizen.NUI/src/internal/XamlBinding/ModalEventArgs.cs deleted file mode 100755 index 50f5821..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/ModalEventArgs.cs +++ /dev/null @@ -1,14 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/ModalPoppedEventArgs.cs b/src/Tizen.NUI/src/internal/XamlBinding/ModalPoppedEventArgs.cs deleted file mode 100755 index f634bff..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/ModalPoppedEventArgs.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Tizen.NUI.Binding -{ - internal class ModalPoppedEventArgs : ModalEventArgs - { - public ModalPoppedEventArgs(Page modal) : base(modal) - { - } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/ModalPoppingEventArgs.cs b/src/Tizen.NUI/src/internal/XamlBinding/ModalPoppingEventArgs.cs deleted file mode 100755 index 1d89ddb..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/ModalPoppingEventArgs.cs +++ /dev/null @@ -1,11 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/ModalPushedEventArgs.cs b/src/Tizen.NUI/src/internal/XamlBinding/ModalPushedEventArgs.cs deleted file mode 100755 index d151153..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/ModalPushedEventArgs.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Tizen.NUI.Binding -{ - internal class ModalPushedEventArgs : ModalEventArgs - { - public ModalPushedEventArgs(Page modal) : base(modal) - { - } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/ModalPushingEventArgs.cs b/src/Tizen.NUI/src/internal/XamlBinding/ModalPushingEventArgs.cs deleted file mode 100755 index e7018c6..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/ModalPushingEventArgs.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Tizen.NUI.Binding -{ - internal class ModalPushingEventArgs : ModalEventArgs - { - public ModalPushingEventArgs(Page modal) : base(modal) - { - } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/NamedSize.cs b/src/Tizen.NUI/src/internal/XamlBinding/NamedSize.cs deleted file mode 100755 index ffd6562..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/NamedSize.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Tizen.NUI.Binding -{ - internal enum NamedSize - { - Default = 0, - Micro = 1, - Small = 2, - Medium = 3, - Large = 4 - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/NavigationEventArgs.cs b/src/Tizen.NUI/src/internal/XamlBinding/NavigationEventArgs.cs deleted file mode 100755 index 5b9a8bd..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/NavigationEventArgs.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.ComponentModel; - -namespace Tizen.NUI.Binding -{ - /// - /// EventArgs for the NavigationPage's navigation events. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - internal class NavigationEventArgs : EventArgs - { - /// - /// Create a NavigationEventArgs instance. - /// - /// The page that was popped or is newly visible. - public NavigationEventArgs(Page page) - { - if (page == null) - throw new ArgumentNullException("page"); - - Page = page; - } - - /// - /// Gets the page that was removed or is newly visible. - /// - public Page Page { get; private set; } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/NavigationMenu.cs b/src/Tizen.NUI/src/internal/XamlBinding/NavigationMenu.cs deleted file mode 100755 index c45cb55..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/NavigationMenu.cs +++ /dev/null @@ -1,82 +0,0 @@ -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 - { - readonly List _targets = new List(); - - readonly Lazy> _platformConfigurationRegistry; - - public NavigationMenu() - { - _platformConfigurationRegistry = new Lazy>(() => new PlatformConfigurationRegistry(this)); - } - - public IEnumerable 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 On() where T : IConfigPlatform - { - return _platformConfigurationRegistry.Value.On(); - } - - [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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/NavigationModel.cs b/src/Tizen.NUI/src/internal/XamlBinding/NavigationModel.cs deleted file mode 100755 index 4420a90..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/NavigationModel.cs +++ /dev/null @@ -1,180 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; - -namespace Tizen.NUI.Binding -{ - [EditorBrowsable(EditorBrowsableState.Never)] - internal class NavigationModel - { - readonly List _modalStack = new List(); - readonly List> _navTree = new List>(); - - public Page CurrentPage - { - get - { - if (_navTree.Any()) - return _navTree.Last().Last(); - return null; - } - } - - public IEnumerable Modals - { - get { return _modalStack; } - } - - public IEnumerable Roots - { - get - { - foreach (List list in _navTree) - { - yield return list[0]; - } - } - } - - public IReadOnlyList> Tree - { - get { return _navTree; } - } - - public void Clear() - { - _navTree.Clear(); - _modalStack.Clear(); - } - - public void InsertPageBefore(Page page, Page before) - { - List 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 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 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 }); - return; - } - - ancestralNav = AncestorToRoot(ancestralNav); - - foreach (List 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 }); - _modalStack.Add(page); - } - - public bool RemovePage(Page page) - { - bool found; - List 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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/NavigationPage.cs b/src/Tizen.NUI/src/internal/XamlBinding/NavigationPage.cs deleted file mode 100755 index d72def2..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/NavigationPage.cs +++ /dev/null @@ -1,627 +0,0 @@ -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 -{ - /// - /// A Page that manages the navigation and user-experience of a stack of other pages. - /// - // [RenderWith(typeof(_NavigationPageRenderer))] - [EditorBrowsable(EditorBrowsableState.Never)] - internal class NavigationPage : Page, IPageContainer, INavigationPageController, IElementConfiguration - { - /// - /// Identifies the property associated with the title of the back button. - /// - public static readonly BindableProperty BackButtonTitleProperty = BindableProperty.CreateAttached("BackButtonTitle", typeof(string), typeof(Page), null); - - /// - /// Backing store for the HasNavigationBar property. - /// - public static readonly BindableProperty HasNavigationBarProperty = BindableProperty.CreateAttached("HasNavigationBar", typeof(bool), typeof(Page), true); - - /// - /// Backing store for the HasBackButton property. - /// - public static readonly BindableProperty HasBackButtonProperty = BindableProperty.CreateAttached("HasBackButton", typeof(bool), typeof(NavigationPage), true); - - /// - /// Identifies the Tint bindable property. - /// - [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); - - /// - /// Identifies the property associated with the color of the NavigationPage's bar background color. - /// - public static readonly BindableProperty BarBackgroundColorProperty = BindableProperty.Create("BarBackgroundColor", typeof(Color), typeof(NavigationPage), /*Color.Default*/Color.Black); - - /// - /// Identifies the property associated with the color of the NavigationPage's bar text color. - /// - public static readonly BindableProperty BarTextColorProperty = BindableProperty.Create("BarTextColor", typeof(Color), typeof(NavigationPage), /*Color.Default*/Color.Black); - - /// - /// Indicates the NavigationPage.SetTitleIcon/NavigationPage.GetTitleIcon property. - /// - 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); - - /// - /// Identifies the property associated with NavigationPage.CurrentPage - /// - public static readonly BindableProperty CurrentPageProperty = CurrentPagePropertyKey.BindableProperty; - - static readonly BindablePropertyKey RootPagePropertyKey = BindableProperty.CreateReadOnly(nameof(RootPage), typeof(Page), typeof(NavigationPage), null); - /// - /// Identifies the property associated with NavigationPage.RootPage - /// - public static readonly BindableProperty RootPageProperty = RootPagePropertyKey.BindableProperty; - - /// - /// Initializes a new NavigationPage object. - /// - public NavigationPage() - { - _platformConfigurationRegistry = new Lazy>(() => new PlatformConfigurationRegistry(this)); - - Navigation = new NavigationImpl(this); - } - - /// - /// Creates a new NavigationPage element with root as its root element. - /// - /// The root page. - public NavigationPage(Page root) : this() - { - PushPage(root); - } - - /// - /// Gets or sets the background color for the bar at the top of the NavigationPage. - /// - public Color BarBackgroundColor - { - get { return (Color)GetValue(BarBackgroundColorProperty); } - set { SetValue(BarBackgroundColorProperty, value); } - } - - /// - /// Gets or sets the text that appears on the bar at the top of the NavigationPage. - /// - public Color BarTextColor - { - get { return (Color)GetValue(BarTextColorProperty); } - set { SetValue(BarTextColorProperty, value); } - } - - /// - /// The color to be used as the Tint of the NavigationPage. - /// - [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; } - - /// - /// For internal use - /// - /// The depth - /// The page instance - [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]; - } - - /// - /// For internal use. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public IEnumerable Pages => InternalChildren.Cast(); - - /// - /// For internal use - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public int StackDepth - { - get { return InternalChildren.Count; } - } - - /// - /// The Page that is currently top-most on the navigation stack. - /// - public Page CurrentPage - { - get { return (Page)GetValue(CurrentPageProperty); } - private set { SetValue(CurrentPagePropertyKey, value); } - } - - /// - /// The Page that is the root of the navigation stack. - /// - public Page RootPage - { - get { return (Page)GetValue(RootPageProperty); } - private set { SetValue(RootPagePropertyKey, value); } - } - - /// - /// The title of the back button for the specified page. - /// - /// The Page whose back-button's title is being requested. - /// The title of the back button that would be shown if the specified page were the Tizen.NUI.Xaml.CurrentPage. - public static string GetBackButtonTitle(BindableObject page) - { - return (string)page.GetValue(BackButtonTitleProperty); - } - - /// - /// Returns a value that indicates whether page has a back button. - /// - /// The page to be checked - /// true if the page has a back button. - public static bool GetHasBackButton(Page page) - { - if (page == null) - throw new ArgumentNullException("page"); - return (bool)page.GetValue(HasBackButtonProperty); - } - - /// - /// Returns a value that indicates whether the page has a navigation bar. - /// - /// The Page being queried. - /// true if page would display a navigation bar were it the CurrentPage. - public static bool GetHasNavigationBar(BindableObject page) - { - return (bool)page.GetValue(HasNavigationBarProperty); - } - - internal static FileImageSource GetTitleIcon(BindableObject bindable) - { - return (FileImageSource)bindable.GetValue(TitleIconProperty); - } - - /// - /// Asynchronously removes the top Page from the navigation stack. - /// - /// The Page that had been at the top of the navigation stack. - public Task PopAsync() - { - return PopAsync(true); - } - - /// - /// Asynchronously removes the top Page from the navigation stack, with optional animation. - /// - /// Whether to animate the pop. - /// The Page that had been at the top of the navigation stack. - public async Task PopAsync(bool animated) - { - var tcs = new TaskCompletionSource(); - 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; - } - - /// - /// Event that is raised after a page is popped from this NavigationPage element. - /// - public event EventHandler Popped; - - /// - /// Pops all but the root Page off the navigation stack. - /// - /// A task that represents the asynchronous dismiss operation. - public Task PopToRootAsync() - { - return PopToRootAsync(true); - } - - /// - /// A task for asynchronously popping all pages off of the navigation stack. - /// - /// Whether to animate the pop. - /// A task that represents the asynchronous dismiss operation. - public async Task PopToRootAsync(bool animated) - { - if (CurrentNavigationTask != null && !CurrentNavigationTask.IsCompleted) - { - var tcs = new TaskCompletionSource(); - Task oldTask = CurrentNavigationTask; - CurrentNavigationTask = tcs.Task; - await oldTask; - - await PopToRootAsyncInner(animated); - tcs.SetResult(true); - return; - } - - Task result = PopToRootAsyncInner(animated); - CurrentNavigationTask = result; - await result; - } - - /// - /// Presents a Page modally. - /// - /// The Page to present modally. - /// An awaitable Task, indicating the PushModal completion. - public Task PushAsync(Page page) - { - return PushAsync(page, true); - } - - /// - /// A task for asynchronously pushing a page onto the navigation stack, with optional animation. - /// - /// The Page to present modally. - /// Whether to animate the pop. - /// An awaitable Task, indicating the PushModal completion. - public async Task PushAsync(Page page, bool animated) - { - if (CurrentNavigationTask != null && !CurrentNavigationTask.IsCompleted) - { - var tcs = new TaskCompletionSource(); - Task oldTask = CurrentNavigationTask; - CurrentNavigationTask = tcs.Task; - await oldTask; - - await PushAsyncInner(page, animated); - tcs.SetResult(true); - return; - } - - CurrentNavigationTask = PushAsyncInner(page, animated); - await CurrentNavigationTask; - } - - /// - /// Event that is raised when a page is pushed onto this NavigationPage element. - /// - public event EventHandler Pushed; - - /// - /// Sets the title that appears on the back button for page. - /// - /// The BindableObject object. - /// The value to set. - public static void SetBackButtonTitle(BindableObject page, string value) - { - page.SetValue(BackButtonTitleProperty, value); - } - - /// - /// Adds or removes a back button to page, with optional animation. - /// - /// The page object. - /// The value to set. - public static void SetHasBackButton(Page page, bool value) - { - if (page == null) - throw new ArgumentNullException("page"); - page.SetValue(HasBackButtonProperty, value); - } - - /// - /// Sets a value that indicates whether or not this NavigationPage element has a navigation bar. - /// - /// The BindableObject object - /// The value to set - public static void SetHasNavigationBar(BindableObject page, bool value) - { - page.SetValue(HasNavigationBarProperty, value); - } - - internal static void SetTitleIcon(BindableObject bindable, FileImageSource value) - { - bindable.SetValue(TitleIconProperty, value); - } - - /// - /// Event that is raised when the hardware back button is pressed. - /// - /// true if consumed - protected override bool OnBackButtonPressed() - { - if (CurrentPage.SendBackButtonPressed()) - return true; - - if (StackDepth > 1) - { - SafePop(); - return true; - } - - return base.OnBackButtonPressed(); - } - - /// - /// For internal use - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler InsertPageBeforeRequested; - - /// - /// For internal use - /// - /// Whether animate the pop. - /// - /// A task that represents the asynchronous dismiss operation. - [EditorBrowsable(EditorBrowsableState.Never)] - public async Task 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 INavigationPageController.RemoveAsyncInner(Page page, bool animated, bool fast) - { - if (StackDepth == 1) - { - return null; - } - - var args = new NavigationRequestedEventArgs(page, animated); - - var removed = true; - - EventHandler 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; - } - - /// - /// For internal use. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler PopRequested; - - /// - /// For internal use. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler PopToRootRequested; - - /// - /// For internal use. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler PushRequested; - - /// - /// For internal use. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler 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 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 requestPopToRoot = PopToRootRequested; - if (requestPopToRoot != null) - { - requestPopToRoot(this, args); - - if (args.Task != null) - await args.Task; - } - - // PoppedToRoot?.Invoke(this, new PoppedToRootEventArgs(RootPage, childrenToRemove.OfType().ToList())); - } - - async Task PushAsyncInner(Page page, bool animated) - { - if (InternalChildren.Contains(page)) - return; - - PushPage(page); - - var args = new NavigationRequestedEventArgs(page, animated); - - EventHandler 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 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> _castingList; - - public NavigationImpl(NavigationPage owner) - { - Owner = owner; - // _castingList = new Lazy>(() => new ReadOnlyCastingList(Owner.InternalChildren)); - } - - NavigationPage Owner { get; } - - protected override IReadOnlyList GetNavigationStack() - { - // return _castingList.Value; - return null; - } - - protected override void OnInsertPageBefore(Page page, Page before) - { - Owner.InsertPageBefore(page, before); - } - - protected override Task 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; - - /// - /// Returns the platform-specific instance of this NavigationPage, on which a platform-specific method may be called. - /// - /// The platform for which to return an instance. - /// The platform-specific instance of this NavigationPage - public new IPlatformElementConfiguration On() where T : IConfigPlatform - { - return _platformConfigurationRegistry.Value.On(); - } - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/NavigationProxy.cs b/src/Tizen.NUI/src/internal/XamlBinding/NavigationProxy.cs deleted file mode 100755 index 263cc33..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/NavigationProxy.cs +++ /dev/null @@ -1,346 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Threading.Tasks; - -namespace Tizen.NUI.Binding -{ - /// - /// For internal use. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - internal class NavigationProxy : INavigation - { - INavigation _inner; - Lazy> _modalStack = new Lazy>(() => new List()); - - Lazy> _pushStack = new Lazy>(() => new List()); - - 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>(() => new List()); - _modalStack = new Lazy>(() => new List()); - } - 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; - } - } - } - - /// - /// Inserts a page in the navigation stack before an existing page in the stack. - /// - /// The page to add. - /// The existing page, before which page will be inserted. - public void InsertPageBefore(Page page, Page before) - { - OnInsertPageBefore(page, before); - } - - /// - /// Gets the modal navigation stack. - /// - public IReadOnlyList ModalStack - { - get { return GetModalStack(); } - } - - /// - /// Gets the stack of pages in the navigation. - /// - public IReadOnlyList NavigationStack - { - get { return GetNavigationStack(); } - } - - /// - /// Asynchronously removes the most recent Page from the navigation stack. - /// - /// The Page that had been at the top of the navigation stack. - public Task PopAsync() - { - return OnPopAsync(true); - } - - /// - /// Asynchronously removes the top Page from the navigation stack, with optional animation. - /// - /// Whether to animate the pop. - /// The Page that had been at the top of the navigation stack. - public Task PopAsync(bool animated) - { - return OnPopAsync(animated); - } - - /// - /// Asynchronously dismisses the most recent modally presented Page. - /// - /// An awaitable instance, indicating the PopModalAsync completion. The Task.Result is the Page that has been popped. - public Task PopModalAsync() - { - return OnPopModal(true); - } - - /// - /// Asynchronously removes the top Page from the navigation stack, with optional animation. - /// - /// Whether to animate the pop. - /// The Page that had been at the top of the navigation stack. - public Task PopModalAsync(bool animated) - { - return OnPopModal(animated); - } - - /// - /// Pops all but the root Page off the navigation stack. - /// - /// A task representing the asynchronous dismiss operation. - public Task PopToRootAsync() - { - return OnPopToRootAsync(true); - } - - /// - /// Pops all but the root Page off the navigation stack, with optional animation. - /// - /// Whether to animate the pop. - /// A task representing the asynchronous dismiss operation. - public Task PopToRootAsync(bool animated) - { - return OnPopToRootAsync(animated); - } - - /// - /// Asynchronously adds a Page to the top of the navigation stack. - /// - /// The Page to be pushed on top of the navigation stack. - /// A task that represents the asynchronous push operation. - public Task PushAsync(Page root) - { - return PushAsync(root, true); - } - - /// - /// Asynchronously adds a Page to the top of the navigation stack, with optional animation. - /// - /// The page to push. - /// Whether to animate the push. - /// A task that represents the asynchronous push operation. - 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); - } - - /// - /// Presents a Page modally. - /// - /// The Page to present modally. - /// An awaitable Task, indicating the PushModal completion. - public Task PushModalAsync(Page modal) - { - return PushModalAsync(modal, true); - } - - /// - /// Presents a Page modally, with optional animation. - /// - /// The page to push. - /// Whether to animate the push. - /// An awaitable Task, indicating the PushModal completion. - 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); - } - - /// - /// Removes the specified page from the navigation stack. - /// - /// The page to remove. - public void RemovePage(Page page) - { - OnRemovePage(page); - } - - /// - /// For internal use. Returns the modal navigation stack. - /// - /// The modal navigation stack. - protected virtual IReadOnlyList GetModalStack() - { - INavigation currentInner = Inner; - return currentInner == null ? _modalStack.Value : currentInner.ModalStack; - } - - /// - /// For internal use. Returns the stack of pages in the navigation. - /// - /// The stack of pages in the navigation. - protected virtual IReadOnlyList GetNavigationStack() - { - INavigation currentInner = Inner; - return currentInner == null ? _pushStack.Value : currentInner.NavigationStack; - } - - /// - /// The method called when insert a page in the navigation stack before an existing page in the stack. - /// - /// The page to add. - /// The existing page, before which page will be inserted. - 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); - } - } - - /// - /// This method calls when removes the top Page from the navigation stack - /// - /// Whether to animate the pop. - /// - protected virtual Task OnPopAsync(bool animated) - { - INavigation inner = Inner; - return inner == null ? Task.FromResult(Pop()) : inner.PopAsync(animated); - } - - /// - /// This method calls when removes the top Page from the navigation stack - /// - /// Whether to animate the pop. - /// An awaitable instance, indicating the PopModalAsync completion - protected virtual Task OnPopModal(bool animated) - { - INavigation innerNav = Inner; - return innerNav == null ? Task.FromResult(PopModal()) : innerNav.PopModalAsync(animated); - } - - /// - /// This method calls when Pops all but the root Page off the navigation stack. - /// - /// Whether to animate the pop. - /// A task representing the asynchronous dismiss operation. - 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); - } - - /// - /// This method calls when adds a Page to the top of the navigation stack, with optional animation. - /// - /// The page to add - /// Whether to animate the pop. - /// A task that represents the asynchronous push operation. - 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); - } - - /// - /// This method calls when Presents a Page modally, with optional animation. - /// - /// The page to push. - /// Whether to animate the pop. - /// An awaitable Task, indicating the PushModal completion. - protected virtual Task OnPushModal(Page modal, bool animated) - { - INavigation currentInner = Inner; - if (currentInner == null) - { - _modalStack.Value.Add(modal); - return Task.FromResult(null); - } - return currentInner.PushModalAsync(modal, animated); - } - - /// - /// This method calls when Removes the specified page from the navigation stack. - /// - /// The page to add. - protected virtual void OnRemovePage(Page page) - { - INavigation currentInner = Inner; - if (currentInner == null) - { - _pushStack.Value.Remove(page); - } - else - { - currentInner.RemovePage(page); - } - } - - Page Pop() - { - List list = _pushStack.Value; - Page result = list[list.Count - 1]; - list.RemoveAt(list.Count - 1); - return result; - } - - Page PopModal() - { - List list = _modalStack.Value; - Page result = list[list.Count - 1]; - list.RemoveAt(list.Count - 1); - return result; - } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/NavigationRequestedEventArgs.cs b/src/Tizen.NUI/src/internal/XamlBinding/NavigationRequestedEventArgs.cs deleted file mode 100755 index 42a7563..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/NavigationRequestedEventArgs.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.ComponentModel; -using System.Threading.Tasks; -using Tizen.NUI; - -namespace Tizen.NUI.Binding -{ - /// - /// For internal use. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - internal class NavigationRequestedEventArgs : NavigationEventArgs - { - /// - /// Constructor. - /// - /// - /// - /// - public NavigationRequestedEventArgs(Page page, bool animated, bool realize = true) : base(page) - { - Animated = animated; - Realize = realize; - } - - /// - /// Constructor. - /// - /// - /// - /// - public NavigationRequestedEventArgs(Page page, Page before, bool animated) : this(page, animated) - { - BeforePage = before; - } - - /// - /// Gets or Sets the whether animate. - /// - public bool Animated { get; set; } - - /// - /// Gets or Sets the before page. - /// - public Page BeforePage { get; set; } - - /// - /// Gets or Sets the realize. - /// - public bool Realize { get; set; } - - /// - /// Gets or Sets the Task. - /// - public Task Task { get; set; } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/NullEffect.cs b/src/Tizen.NUI/src/internal/XamlBinding/NullEffect.cs deleted file mode 100755 index 2826045..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/NullEffect.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Tizen.NUI.Binding -{ - internal class NullEffect : Effect - { - protected override void OnAttached() - { - } - - protected override void OnDetached() - { - } - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/ObservableWrapper.cs b/src/Tizen.NUI/src/internal/XamlBinding/ObservableWrapper.cs deleted file mode 100755 index 2a220ea..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/ObservableWrapper.cs +++ /dev/null @@ -1,256 +0,0 @@ -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 : IList, INotifyCollectionChanged where TTrack : Element where TRestrict : TTrack - { - readonly ObservableCollection _list; - - public ObservableWrapper(ObservableCollection 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().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().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 GetEnumerator() - { - return _list.Where(i => i.Owned).OfType().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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/PaddingElement.cs b/src/Tizen.NUI/src/internal/XamlBinding/PaddingElement.cs deleted file mode 100755 index 817e81e..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/PaddingElement.cs +++ /dev/null @@ -1,64 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/PlatformConfigurationRegistry.cs b/src/Tizen.NUI/src/internal/XamlBinding/PlatformConfigurationRegistry.cs deleted file mode 100755 index 6cb752e..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/PlatformConfigurationRegistry.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Tizen.NUI.Binding -{ - /// - /// Helper that handles storing and lookup of platform specifics implementations - /// - /// The Element type - internal class PlatformConfigurationRegistry : IElementConfiguration - where TElement : Element - { - readonly TElement _element; - readonly Dictionary _platformSpecifics = new Dictionary(); - - internal PlatformConfigurationRegistry(TElement element) - { - _element = element; - } - - - public IPlatformElementConfiguration On() where T : IConfigPlatform - { - if (_platformSpecifics.ContainsKey(typeof(T))) - { - return (IPlatformElementConfiguration)_platformSpecifics[typeof(T)]; - } - - var emptyConfig = Configuration.Create(_element); - - _platformSpecifics.Add(typeof(T), emptyConfig); - - return emptyConfig; - } - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/RoutingEffect.cs b/src/Tizen.NUI/src/internal/XamlBinding/RoutingEffect.cs deleted file mode 100755 index 35acf4f..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/RoutingEffect.cs +++ /dev/null @@ -1,42 +0,0 @@ -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); - } - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/SizeRequest.cs b/src/Tizen.NUI/src/internal/XamlBinding/SizeRequest.cs deleted file mode 100755 index f9e1eb3..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/SizeRequest.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Diagnostics; -using System.ComponentModel; - -namespace Tizen.NUI.Binding -{ - /// - /// Struct that defines minimum and maximum Sizes. - /// - [DebuggerDisplay("Request={Request.Width}x{Request.Height}, Minimum={Minimum.Width}x{Minimum.Height}")] - [EditorBrowsable(EditorBrowsableState.Never)] - internal struct SizeRequest - { - /// - /// The requested size. - /// - public Size Request { get; set; } - - /// - /// The minimum acceptable size. - /// - public Size Minimum { get; set; } - - /// - /// Creates a new SizeRequest object that requests at least the size minimum, but preferably the size request. - /// - /// The size of the request. - /// The minimum size for the request. - public SizeRequest(Size request, Size minimum) - { - Request = request; - Minimum = minimum; - } - - /// - /// Creates a new SizeRequest with the specified request size. - /// - /// The size of the request. - public SizeRequest(Size request) - { - Request = request; - Minimum = request; - } - - /// - /// Returns a string representation of the size request. - /// - /// a string representation of the size request. - public override string ToString() - { - return string.Format("{{Request={0} Minimum={1}}}", Request, Minimum); - } - } -} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Thickness.cs b/src/Tizen.NUI/src/internal/XamlBinding/Thickness.cs deleted file mode 100755 index 5bf3d9b..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/Thickness.cs +++ /dev/null @@ -1,180 +0,0 @@ -using System.Diagnostics; -using System.ComponentModel; - -namespace Tizen.NUI.Binding -{ - /// - /// Struct defining thickness around the edges of a Rectangle using doubles. - /// - [DebuggerDisplay("Left={Left}, Top={Top}, Right={Right}, Bottom={Bottom}, HorizontalThickness={HorizontalThickness}, VerticalThickness={VerticalThickness}")] - [TypeConverter(typeof(ThicknessTypeConverter))] - [EditorBrowsable(EditorBrowsableState.Never)] - internal struct Thickness - { - /// - /// The thickness of the left side of a rectangle. - /// - public double Left { get; set; } - - /// - /// The thickness of the top of a rectangle. - /// - public double Top { get; set; } - - /// - /// The thickness of the right side of a rectangle. - /// - public double Right { get; set; } - - /// - /// The thickness of the bottom of a rectangle. - /// - public double Bottom { get; set; } - - /// - /// The sum of Left and Right. - /// - public double HorizontalThickness - { - get { return Left + Right; } - } - - /// - /// The sum of Top and Bottom. - /// - public double VerticalThickness - { - get { return Top + Bottom; } - } - - internal bool IsDefault - { - get { return Left == 0 && Top == 0 && Right == 0 && Bottom == 0; } - } - - /// - /// Creates a new Thickness object that represents a uniform thickness of size uniformSize. - /// - /// The uniform size of all edges in the new thickness. - public Thickness(double uniformSize) : this(uniformSize, uniformSize, uniformSize, uniformSize) - { - } - - /// - /// Creates a new Thickness object that has a horizontal thickness of horizontalSize and a vertical thickness of verticalSize. - /// - /// The width of the left and right thicknesses. - /// The height of the top and bottom thicknesses. - public Thickness(double horizontalSize, double verticalSize) : this(horizontalSize, verticalSize, horizontalSize, verticalSize) - { - } - - /// - /// Creates a new Thickness object with thicknesses defined by left, top, right, and bottom. - /// - /// The width of the left thickness. - /// The height of the top thickness. - /// The width of the right thickness. - /// The height of the bottom thickness. - public Thickness(double left, double top, double right, double bottom) : this() - { - Left = left; - Top = top; - Right = right; - Bottom = bottom; - } - - /// - /// Converts a Size into a Thickness. - /// - /// A Size to convert to a Thickness - public static implicit operator Thickness(Size size) - { - return new Thickness(size.Width, size.Height, size.Width, size.Height); - } - - /// - /// Implicit cast operator from Double. - /// - /// The value for the uniform Thickness. - public static implicit operator Thickness(double uniformSize) - { - return new Thickness(uniformSize); - } - - /// - /// Whether the other has equivalent values. - /// - /// A Thickness to be compared. - /// true if other has equivalent values. - bool Equals(Thickness other) - { - return Left.Equals(other.Left) && Top.Equals(other.Top) && Right.Equals(other.Right) && Bottom.Equals(other.Bottom); - } - - /// - /// Whether the obj has equivalent values. - /// - /// A Thickness to be compared. - /// true if obj is a Thickness and has equivalent values. - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) - return false; - return obj is Thickness && Equals((Thickness)obj); - } - - /// - /// A hash value for this Thickness. - /// - /// The hash value - 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; - } - } - - /// - /// Whether two Thicknesses have identical values. - /// - /// A Thickness to be compared. - /// A Thickness to be compared. - /// true if left and right have identical values for Left,Right, Top, and Bottom. - public static bool operator ==(Thickness left, Thickness right) - { - return left.Equals(right); - } - - /// - /// Whether the values of two Thickness's have at least one difference. - /// - /// A Thickness to be compared. - /// A Thickness to be compared. - /// true if any of the Left,Right, Top, and Bottom values differ between left and right. - public static bool operator !=(Thickness left, Thickness right) - { - return !left.Equals(right); - } - - /// - /// Stores the components of the thickness in the corresponding arguments. - /// - /// Variable in which to store the left thickness of thickness object. - /// Variable in which to store the top thickness of thickness object. - /// Variable in which to store the right thickness of thickness object. - /// Variable in which to store the bottom thickness of thickness object. - 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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/ThicknessTypeConverter.cs b/src/Tizen.NUI/src/internal/XamlBinding/ThicknessTypeConverter.cs deleted file mode 100755 index 72271c3..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/ThicknessTypeConverter.cs +++ /dev/null @@ -1,63 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/TizenPlatformServices.cs b/src/Tizen.NUI/src/internal/XamlBinding/TizenPlatformServices.cs index d05bf08..995624e 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/TizenPlatformServices.cs +++ b/src/Tizen.NUI/src/internal/XamlBinding/TizenPlatformServices.cs @@ -24,83 +24,12 @@ namespace Tizen.NUI.Binding 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 callback) { Console.WriteLine("TizenPlatformServices StartTimer ..."); diff --git a/src/Tizen.NUI/src/internal/XamlBinding/ToolbarItem.cs b/src/Tizen.NUI/src/internal/XamlBinding/ToolbarItem.cs deleted file mode 100755 index ceb6820..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/ToolbarItem.cs +++ /dev/null @@ -1,57 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/ToolbarItemEventArgs.cs b/src/Tizen.NUI/src/internal/XamlBinding/ToolbarItemEventArgs.cs deleted file mode 100755 index d1cb9b0..0000000 --- a/src/Tizen.NUI/src/internal/XamlBinding/ToolbarItemEventArgs.cs +++ /dev/null @@ -1,14 +0,0 @@ -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 diff --git a/src/Tizen.NUI/src/public/Animation.cs b/src/Tizen.NUI/src/public/Animation.cs index f2e036f..3eb7772 100755 --- a/src/Tizen.NUI/src/public/Animation.cs +++ b/src/Tizen.NUI/src/public/Animation.cs @@ -993,12 +993,6 @@ namespace Tizen.NUI } } - var nativeValueConverterService = DependencyService.Get(); - - object nativeValue = null; - if (nativeValueConverterService != null && nativeValueConverterService.ConvertTo(value, toType, out nativeValue)) - return nativeValue; - return value; } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index 73bff93..8e40ac4 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -1997,7 +1997,9 @@ namespace Tizen.NUI.BaseComponents } } - 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 { diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs index 4553a9a..73a9b7e 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs @@ -2081,7 +2081,9 @@ namespace Tizen.NUI.BaseComponents } } - 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 { diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 5597b46..8e2b522 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -90,7 +90,6 @@ namespace Tizen.NUI.BaseComponents /// View is the base class for all views. /// /// 3 - [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. @@ -3482,7 +3481,10 @@ namespace Tizen.NUI.BaseComponents } } - internal Style Style + /// 6 + /// 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 { diff --git a/src/Tizen.NUI/src/public/BaseHandle.cs b/src/Tizen.NUI/src/public/BaseHandle.cs index 88dcd0b..3b150bb 100755 --- a/src/Tizen.NUI/src/public/BaseHandle.cs +++ b/src/Tizen.NUI/src/public/BaseHandle.cs @@ -29,13 +29,6 @@ namespace Tizen.NUI /// 3 public class BaseHandle : Element, global::System.IDisposable { - internal static readonly BindablePropertyKey NavigationPropertyKey = BindableProperty.CreateReadOnly("Navigation", typeof(INavigation), typeof(/*VisualElement*/BaseHandle), default(INavigation)); - - /// - /// Backing store for the Navigation property. - /// - internal static readonly BindableProperty NavigationProperty = NavigationPropertyKey.BindableProperty; - /// /// swigCMemOwn /// @@ -136,23 +129,6 @@ namespace Tizen.NUI } /// - /// For internal use. - /// - internal NavigationProxy NavigationProxy - { - get { return Navigation as NavigationProxy; } - } - - /// - /// Gets the navigation. - /// - internal INavigation Navigation - { - get { return (INavigation)GetValue(NavigationProperty); } - set { SetValue(NavigationPropertyKey, value); } - } - - /// /// Returns the bool value true to indicate that an operand is true and returns false otherwise. /// /// 3 diff --git a/src/Tizen.NUI/src/public/Container.cs b/src/Tizen.NUI/src/public/Container.cs index 4971a4e..9f21585 100755 --- a/src/Tizen.NUI/src/public/Container.cs +++ b/src/Tizen.NUI/src/public/Container.cs @@ -17,7 +17,9 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; namespace Tizen.NUI { diff --git a/src/Tizen.NUI/src/public/NUIApplication.cs b/src/Tizen.NUI/src/public/NUIApplication.cs index 129d86b..3f82bd7 100755 --- a/src/Tizen.NUI/src/public/NUIApplication.cs +++ b/src/Tizen.NUI/src/public/NUIApplication.cs @@ -354,7 +354,6 @@ namespace Tizen.NUI protected override void OnCreate() { base.OnCreate(); - Device.PlatformServices = new TizenPlatformServices(); } } diff --git a/src/Tizen.NUI/src/public/UIComponents/PushButton.cs b/src/Tizen.NUI/src/public/UIComponents/PushButton.cs index 9505d8d..cdafc06 100755 --- a/src/Tizen.NUI/src/public/UIComponents/PushButton.cs +++ b/src/Tizen.NUI/src/public/UIComponents/PushButton.cs @@ -84,7 +84,9 @@ namespace Tizen.NUI.UIComponents } } - 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 { diff --git a/src/Tizen.NUI/src/public/UIComponents/Slider.cs b/src/Tizen.NUI/src/public/UIComponents/Slider.cs index 599e1f1..9e92796 100755 --- a/src/Tizen.NUI/src/public/UIComponents/Slider.cs +++ b/src/Tizen.NUI/src/public/UIComponents/Slider.cs @@ -634,7 +634,9 @@ namespace Tizen.NUI.UIComponents } } - 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 { diff --git a/src/Tizen.NUI/src/public/Xaml/IMarkupExtension.cs b/src/Tizen.NUI/src/public/Xaml/IMarkupExtension.cs new file mode 100755 index 0000000..717e987 --- /dev/null +++ b/src/Tizen.NUI/src/public/Xaml/IMarkupExtension.cs @@ -0,0 +1,30 @@ +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 : 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 diff --git a/src/Tizen.NUI/src/public/Xaml/IProvideValueTarget.cs b/src/Tizen.NUI/src/public/Xaml/IProvideValueTarget.cs new file mode 100755 index 0000000..cca7fa9 --- /dev/null +++ b/src/Tizen.NUI/src/public/Xaml/IProvideValueTarget.cs @@ -0,0 +1,17 @@ +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 diff --git a/src/Tizen.NUI/src/public/Xaml/IReferenceProvider.cs b/src/Tizen.NUI/src/public/Xaml/IReferenceProvider.cs new file mode 100755 index 0000000..ac89fe0 --- /dev/null +++ b/src/Tizen.NUI/src/public/Xaml/IReferenceProvider.cs @@ -0,0 +1,13 @@ +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 diff --git a/src/Tizen.NUI/src/public/Xaml/IRootObjectProvider.cs b/src/Tizen.NUI/src/public/Xaml/IRootObjectProvider.cs new file mode 100755 index 0000000..6206ce8 --- /dev/null +++ b/src/Tizen.NUI/src/public/Xaml/IRootObjectProvider.cs @@ -0,0 +1,13 @@ +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 diff --git a/src/Tizen.NUI/src/public/Xaml/IValueProvider.cs b/src/Tizen.NUI/src/public/Xaml/IValueProvider.cs new file mode 100755 index 0000000..4ba8d3d --- /dev/null +++ b/src/Tizen.NUI/src/public/Xaml/IValueProvider.cs @@ -0,0 +1,14 @@ +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 diff --git a/src/Tizen.NUI/src/public/Xaml/IXamlTypeResolver.cs b/src/Tizen.NUI/src/public/Xaml/IXamlTypeResolver.cs new file mode 100755 index 0000000..88e482c --- /dev/null +++ b/src/Tizen.NUI/src/public/Xaml/IXamlTypeResolver.cs @@ -0,0 +1,18 @@ +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 diff --git a/src/Tizen.NUI/src/public/Xaml/IXmlLineInfoProvider.cs b/src/Tizen.NUI/src/public/Xaml/IXmlLineInfoProvider.cs new file mode 100755 index 0000000..56ce822 --- /dev/null +++ b/src/Tizen.NUI/src/public/Xaml/IXmlLineInfoProvider.cs @@ -0,0 +1,14 @@ +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 diff --git a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/ArrayExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ArrayExtension.cs similarity index 52% rename from src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/ArrayExtension.cs rename to src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ArrayExtension.cs index ce20e18..bd8f1ae 100755 --- a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/ArrayExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ArrayExtension.cs @@ -1,23 +1,34 @@ 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 + public class ArrayExtension : 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 ArrayExtension() { Items = new List(); } + /// 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) diff --git a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/BindingExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/BindingExtension.cs new file mode 100755 index 0000000..e2fe6c7 --- /dev/null +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/BindingExtension.cs @@ -0,0 +1,80 @@ +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 + { + /// 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.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).ProvideValue(serviceProvider); + } + } +} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/DynamicResourceExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/DynamicResourceExtension.cs similarity index 60% rename from src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/DynamicResourceExtension.cs rename to src/Tizen.NUI/src/public/Xaml/MarkupExtensions/DynamicResourceExtension.cs index 2991b81..49e19c9 100755 --- a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/DynamicResourceExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/DynamicResourceExtension.cs @@ -1,14 +1,21 @@ 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 + public sealed class DynamicResourceExtension : 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) { return ((IMarkupExtension)this).ProvideValue(serviceProvider); diff --git a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/NullExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/NullExtension.cs new file mode 100755 index 0000000..1983406 --- /dev/null +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/NullExtension.cs @@ -0,0 +1,19 @@ +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; + } + } +} diff --git a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/ReferenceExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ReferenceExtension.cs similarity index 58% rename from src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/ReferenceExtension.cs rename to src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ReferenceExtension.cs index b825389..0641dc9 100755 --- a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/ReferenceExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ReferenceExtension.cs @@ -2,14 +2,21 @@ using System; 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) @@ -27,13 +34,25 @@ namespace Tizen.NUI.Xaml 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); diff --git a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/StaticExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/StaticExtension.cs similarity index 79% rename from src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/StaticExtension.cs rename to src/Tizen.NUI/src/public/Xaml/MarkupExtensions/StaticExtension.cs index 5a4151d..0bbbc9b 100755 --- a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/StaticExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/StaticExtension.cs @@ -1,4 +1,5 @@ using System; +using System.ComponentModel; using System.Linq; using System.Reflection; using System.Xml; @@ -6,12 +7,18 @@ 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(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; diff --git a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/StyleSheetExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/StyleSheetExtension.cs similarity index 78% rename from src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/StyleSheetExtension.cs rename to src/Tizen.NUI/src/public/Xaml/MarkupExtensions/StyleSheetExtension.cs index 2b4c483..7816420 100755 --- a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/StyleSheetExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/StyleSheetExtension.cs @@ -4,14 +4,22 @@ using Tizen.NUI.StyleSheets; 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) diff --git a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/TemplateBindingExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/TemplateBindingExtension.cs new file mode 100755 index 0000000..89c89bf --- /dev/null +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/TemplateBindingExtension.cs @@ -0,0 +1,49 @@ +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 + { + 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.ProvideValue(IServiceProvider serviceProvider) + { + return new TemplateBinding(Path, Mode, Converter, ConverterParameter, StringFormat); + } + + object IMarkupExtension.ProvideValue(IServiceProvider serviceProvider) + { + return (this as IMarkupExtension).ProvideValue(serviceProvider); + } + } +} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/TypeExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/TypeExtension.cs similarity index 100% rename from src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/TypeExtension.cs rename to src/Tizen.NUI/src/public/Xaml/MarkupExtensions/TypeExtension.cs diff --git a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/StaticResourceExtension.cs b/src/Tizen.NUI/src/public/Xaml/StaticResourceExtension.cs similarity index 89% rename from src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/StaticResourceExtension.cs rename to src/Tizen.NUI/src/public/Xaml/StaticResourceExtension.cs index c5577cd..b531909 100755 --- a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/StaticResourceExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/StaticResourceExtension.cs @@ -3,15 +3,21 @@ using System.Xml; 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) diff --git a/src/Tizen.NUI/src/public/Xaml/TypeConversionAttribute.cs b/src/Tizen.NUI/src/public/Xaml/TypeConversionAttribute.cs new file mode 100755 index 0000000..8ba332b --- /dev/null +++ b/src/Tizen.NUI/src/public/Xaml/TypeConversionAttribute.cs @@ -0,0 +1,22 @@ +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 diff --git a/src/Tizen.NUI/src/internal/Xaml/XamlCompilationAttribute.cs b/src/Tizen.NUI/src/public/Xaml/XamlCompilationAttribute.cs similarity index 54% rename from src/Tizen.NUI/src/internal/Xaml/XamlCompilationAttribute.cs rename to src/Tizen.NUI/src/public/Xaml/XamlCompilationAttribute.cs index df4a1cb..c132a98 100755 --- a/src/Tizen.NUI/src/internal/Xaml/XamlCompilationAttribute.cs +++ b/src/Tizen.NUI/src/public/Xaml/XamlCompilationAttribute.cs @@ -1,24 +1,38 @@ 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; } } diff --git a/src/Tizen.NUI/src/public/Xaml/XamlFilePathAttribute.cs b/src/Tizen.NUI/src/public/Xaml/XamlFilePathAttribute.cs new file mode 100755 index 0000000..1483402 --- /dev/null +++ b/src/Tizen.NUI/src/public/Xaml/XamlFilePathAttribute.cs @@ -0,0 +1,18 @@ +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 diff --git a/src/Tizen.NUI/src/internal/Xaml/XamlParseException.cs b/src/Tizen.NUI/src/public/Xaml/XamlParseException.cs similarity index 70% rename from src/Tizen.NUI/src/internal/Xaml/XamlParseException.cs rename to src/Tizen.NUI/src/public/Xaml/XamlParseException.cs index 27a5841..f22a050 100755 --- a/src/Tizen.NUI/src/internal/Xaml/XamlParseException.cs +++ b/src/Tizen.NUI/src/public/Xaml/XamlParseException.cs @@ -1,11 +1,14 @@ 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; @@ -24,12 +27,16 @@ namespace Tizen.NUI.Xaml 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 diff --git a/src/Tizen.NUI/src/internal/Xaml/XamlResourceIdAttribute.cs b/src/Tizen.NUI/src/public/Xaml/XamlResourceIdAttribute.cs similarity index 69% rename from src/Tizen.NUI/src/internal/Xaml/XamlResourceIdAttribute.cs rename to src/Tizen.NUI/src/public/Xaml/XamlResourceIdAttribute.cs index b95bfcf..432ee80 100755 --- a/src/Tizen.NUI/src/internal/Xaml/XamlResourceIdAttribute.cs +++ b/src/Tizen.NUI/src/public/Xaml/XamlResourceIdAttribute.cs @@ -1,15 +1,28 @@ 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; diff --git a/src/Tizen.NUI/src/internal/Xaml/XamlServiceProvider.cs b/src/Tizen.NUI/src/public/Xaml/XamlServiceProvider.cs similarity index 66% rename from src/Tizen.NUI/src/internal/Xaml/XamlServiceProvider.cs rename to src/Tizen.NUI/src/public/Xaml/XamlServiceProvider.cs index be1d5e8..0062f5f 100755 --- a/src/Tizen.NUI/src/internal/Xaml/XamlServiceProvider.cs +++ b/src/Tizen.NUI/src/public/Xaml/XamlServiceProvider.cs @@ -1,12 +1,16 @@ 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 services = new Dictionary(); @@ -22,11 +26,7 @@ namespace Tizen.NUI.Xaml 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; @@ -36,6 +36,8 @@ namespace Tizen.NUI.Xaml 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(); @@ -77,12 +79,16 @@ namespace Tizen.NUI.Xaml 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); @@ -132,16 +138,22 @@ namespace Tizen.NUI.Xaml } } - 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) @@ -154,27 +166,41 @@ namespace Tizen.NUI.Xaml } IEnumerable 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) { @@ -260,30 +286,66 @@ namespace Tizen.NUI.Xaml 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 namespaces = new Dictionary(); + /// 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 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; @@ -292,11 +354,15 @@ namespace Tizen.NUI.Xaml 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); diff --git a/src/Tizen.NUI/src/public/Xaml/XmlLineInfo.cs b/src/Tizen.NUI/src/public/Xaml/XmlLineInfo.cs new file mode 100755 index 0000000..0a51d66 --- /dev/null +++ b/src/Tizen.NUI/src/public/Xaml/XmlLineInfo.cs @@ -0,0 +1,42 @@ +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 diff --git a/src/Tizen.NUI/src/public/XamlBinding/BindableObject.cs b/src/Tizen.NUI/src/public/XamlBinding/BindableObject.cs index 7ddbc04..c5a4e62 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/BindableObject.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/BindableObject.cs @@ -146,13 +146,17 @@ namespace Tizen.NUI.Binding /// /// The BindableProperty on which to set a binding. /// The binding to set. - 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 { diff --git a/src/Tizen.NUI/src/internal/XamlBinding/BindableObjectExtensions.cs b/src/Tizen.NUI/src/public/XamlBinding/BindableObjectExtensions.cs similarity index 72% rename from src/Tizen.NUI/src/internal/XamlBinding/BindableObjectExtensions.cs rename to src/Tizen.NUI/src/public/XamlBinding/BindableObjectExtensions.cs index 8c096d0..3c9023d 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/BindableObjectExtensions.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/BindableObjectExtensions.cs @@ -1,10 +1,15 @@ 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) { @@ -17,6 +22,8 @@ namespace Tizen.NUI.Binding 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(this BindableObject self, BindableProperty targetProperty, Expression> sourceProperty, BindingMode mode = BindingMode.Default, IValueConverter converter = null, string stringFormat = null) diff --git a/src/Tizen.NUI/src/internal/XamlBinding/BindableProperty.cs b/src/Tizen.NUI/src/public/XamlBinding/BindableProperty.cs similarity index 99% rename from src/Tizen.NUI/src/internal/XamlBinding/BindableProperty.cs rename to src/Tizen.NUI/src/public/XamlBinding/BindableProperty.cs index 9aa62d8..4ab7a59 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/BindableProperty.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/BindableProperty.cs @@ -111,7 +111,6 @@ namespace Tizen.NUI.Binding { 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() }, diff --git a/src/Tizen.NUI/src/internal/XamlBinding/BindablePropertyConverter.cs b/src/Tizen.NUI/src/public/XamlBinding/BindablePropertyConverter.cs similarity index 91% rename from src/Tizen.NUI/src/internal/XamlBinding/BindablePropertyConverter.cs rename to src/Tizen.NUI/src/public/XamlBinding/BindablePropertyConverter.cs index ea258e6..3e87dd2 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/BindablePropertyConverter.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/BindablePropertyConverter.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Linq; @@ -10,9 +11,11 @@ using Tizen.NUI.Xaml; 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) { @@ -77,6 +80,8 @@ namespace Tizen.NUI.Binding 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)) diff --git a/src/Tizen.NUI/src/internal/XamlBinding/BindablePropertyKey.cs b/src/Tizen.NUI/src/public/XamlBinding/BindablePropertyKey.cs similarity index 100% rename from src/Tizen.NUI/src/internal/XamlBinding/BindablePropertyKey.cs rename to src/Tizen.NUI/src/public/XamlBinding/BindablePropertyKey.cs diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Binding.cs b/src/Tizen.NUI/src/public/XamlBinding/Binding.cs similarity index 85% rename from src/Tizen.NUI/src/internal/XamlBinding/Binding.cs rename to src/Tizen.NUI/src/public/XamlBinding/Binding.cs index bbbd9d9..1697c0f 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/Binding.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Binding.cs @@ -10,7 +10,9 @@ using Tizen.NUI.Binding.Internals; 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; @@ -21,10 +23,14 @@ namespace Tizen.NUI.Binding 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) @@ -40,6 +46,8 @@ namespace Tizen.NUI.Binding 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; } @@ -51,6 +59,8 @@ 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 object ConverterParameter { get { return _converterParameter; } @@ -62,6 +72,8 @@ 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 string Path { get { return _path; } @@ -74,6 +86,8 @@ 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 object Source { get { return _source; } @@ -84,6 +98,7 @@ 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 string UpdateSourceEventName { get { return _updateSourceEventName; } @@ -93,6 +108,8 @@ 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)] [Obsolete] public static Binding Create(Expression> propertyGetter, BindingMode mode = BindingMode.Default, IValueConverter converter = null, object converterParameter = null, string stringFormat = null) diff --git a/src/Tizen.NUI/src/internal/XamlBinding/BindingBase.cs b/src/Tizen.NUI/src/public/XamlBinding/BindingBase.cs similarity index 78% rename from src/Tizen.NUI/src/internal/XamlBinding/BindingBase.cs rename to src/Tizen.NUI/src/public/XamlBinding/BindingBase.cs index 93a2355..3f6e28d 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/BindingBase.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/BindingBase.cs @@ -9,7 +9,7 @@ namespace Tizen.NUI.Binding /// An abstract class that provides a BindingMode and a formatting option. /// [EditorBrowsable(EditorBrowsableState.Never)] - internal abstract class BindingBase + public abstract class BindingBase { static readonly ConditionalWeakTable SynchronizedCollections = new ConditionalWeakTable(); @@ -25,6 +25,8 @@ namespace Tizen.NUI.Binding /// /// Gets or sets the mode for this 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 BindingMode Mode { get { return _mode; } @@ -46,6 +48,8 @@ namespace Tizen.NUI.Binding /// /// Gets or sets the string format for this 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 string StringFormat { get { return _stringFormat; } @@ -57,7 +61,9 @@ namespace Tizen.NUI.Binding } } - 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 { @@ -66,7 +72,9 @@ namespace Tizen.NUI.Binding } } - 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(); @@ -84,6 +92,8 @@ namespace Tizen.NUI.Binding /// Stops synchronization on the collection. /// /// The collection on which to stop synchronization. + /// 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) @@ -92,6 +102,8 @@ namespace Tizen.NUI.Binding 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) @@ -105,6 +117,8 @@ namespace Tizen.NUI.Binding /// /// Throws an InvalidOperationException if the binding has been applied. /// + /// 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) diff --git a/src/Tizen.NUI/src/internal/XamlBinding/BindingMode.cs b/src/Tizen.NUI/src/public/XamlBinding/BindingMode.cs similarity index 100% rename from src/Tizen.NUI/src/internal/XamlBinding/BindingMode.cs rename to src/Tizen.NUI/src/public/XamlBinding/BindingMode.cs diff --git a/src/Tizen.NUI/src/public/XamlBinding/BindingTypeConverter.cs b/src/Tizen.NUI/src/public/XamlBinding/BindingTypeConverter.cs new file mode 100755 index 0000000..984501c --- /dev/null +++ b/src/Tizen.NUI/src/public/XamlBinding/BindingTypeConverter.cs @@ -0,0 +1,19 @@ +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 diff --git a/src/Tizen.NUI/src/public/XamlBinding/CollectionSynchronizationCallback.cs b/src/Tizen.NUI/src/public/XamlBinding/CollectionSynchronizationCallback.cs new file mode 100755 index 0000000..e85593e --- /dev/null +++ b/src/Tizen.NUI/src/public/XamlBinding/CollectionSynchronizationCallback.cs @@ -0,0 +1,10 @@ +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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/ColorTypeConverter.cs b/src/Tizen.NUI/src/public/XamlBinding/ColorTypeConverter.cs similarity index 84% rename from src/Tizen.NUI/src/internal/XamlBinding/ColorTypeConverter.cs rename to src/Tizen.NUI/src/public/XamlBinding/ColorTypeConverter.cs index 51cb273..92d786d 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/ColorTypeConverter.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/ColorTypeConverter.cs @@ -1,16 +1,22 @@ 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) @@ -72,6 +78,8 @@ namespace Tizen.NUI.Binding 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; @@ -81,6 +89,8 @@ namespace Tizen.NUI.Binding 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); diff --git a/src/Tizen.NUI/src/public/XamlBinding/Element.cs b/src/Tizen.NUI/src/public/XamlBinding/Element.cs index 59a9cda..5e868ee 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/Element.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Element.cs @@ -15,19 +15,6 @@ namespace Tizen.NUI.Binding [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 EmptyChildren = new ReadOnlyCollection(new Element[0]); /// @@ -43,16 +30,10 @@ namespace Tizen.NUI.Binding Dictionary _dynamicResources; - IEffectControlProvider _effectControlProvider; - - TrackableCollection _effects; - Guid? _id; Element _parentOverride; - IPlatform _platform; - string _styleId; /// @@ -82,20 +63,6 @@ namespace Tizen.NUI.Binding set { SetValue(ClassIdProperty, value); } } - internal IList Effects - { - get - { - if (_effects == null) - { - _effects = new TrackableCollection(); - _effects.CollectionChanged += EffectsOnCollectionChanged; - _effects.Clearing += EffectsOnClearing; - } - return _effects; - } - } - /// /// Gets a value that can be used to uniquely identify an element through the run of an application. /// @@ -185,31 +152,6 @@ namespace Tizen.NUI.Binding /// /// For internal use. /// - 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); - } - } - } - - /// - /// For internal use. - /// [EditorBrowsable(EditorBrowsableState.Never)] public Element RealParent { get; private set; } @@ -260,13 +202,6 @@ namespace Tizen.NUI.Binding OnParentSet(); - if (RealParent != null) - { - IPlatform platform = RealParent.Platform; - if (platform != null) - Platform = platform; - } - OnPropertyChanged(); } } @@ -278,33 +213,6 @@ namespace Tizen.NUI.Binding _changeHandlers.Remove(onchanged); } - /// - /// For internal use. - /// - 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); /// @@ -327,22 +235,6 @@ namespace Tizen.NUI.Binding SetValueCore(property, value); } - /// - /// For internal use. - /// - /// The nameof the effect - /// true if attached - [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(); @@ -449,8 +341,6 @@ namespace Tizen.NUI.Binding protected virtual void OnChildAdded(Element child) { child.Parent = this; - if (Platform != null) - child.Platform = Platform; child.ApplyBindings(skipBindingContext: false, fromBindingContextChanged:true); @@ -498,15 +388,6 @@ namespace Tizen.NUI.Binding 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); - } } /// @@ -615,12 +496,6 @@ namespace Tizen.NUI.Binding { } - /// - /// For internal use. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler PlatformSet; - internal virtual void SetChildInheritedBindingContext(Element child, object context) { SetInheritedBindingContext(child, context); @@ -647,78 +522,6 @@ namespace Tizen.NUI.Binding } } - 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); diff --git a/src/Tizen.NUI/src/public/XamlBinding/ElementEventArgs.cs b/src/Tizen.NUI/src/public/XamlBinding/ElementEventArgs.cs new file mode 100755 index 0000000..35af51c --- /dev/null +++ b/src/Tizen.NUI/src/public/XamlBinding/ElementEventArgs.cs @@ -0,0 +1,24 @@ +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; } + } +} diff --git a/src/Tizen.NUI/src/public/XamlBinding/IRegisterable.cs b/src/Tizen.NUI/src/public/XamlBinding/IRegisterable.cs new file mode 100755 index 0000000..ab41c61 --- /dev/null +++ b/src/Tizen.NUI/src/public/XamlBinding/IRegisterable.cs @@ -0,0 +1,10 @@ +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 + { + } +} diff --git a/src/Tizen.NUI/src/public/XamlBinding/Interactivity/Behavior.cs b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/Behavior.cs new file mode 100755 index 0000000..a1a44c3 --- /dev/null +++ b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/Behavior.cs @@ -0,0 +1,87 @@ +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 : 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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/BindingCondition.cs b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/BindingCondition.cs similarity index 79% rename from src/Tizen.NUI/src/internal/XamlBinding/Interactivity/BindingCondition.cs rename to src/Tizen.NUI/src/public/XamlBinding/Interactivity/BindingCondition.cs index 63f0319..279d374 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/BindingCondition.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/BindingCondition.cs @@ -1,22 +1,29 @@ 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; } @@ -30,6 +37,8 @@ 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 object Value { get { return _triggerValue; } diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/Condition.cs b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/Condition.cs similarity index 85% rename from src/Tizen.NUI/src/internal/XamlBinding/Interactivity/Condition.cs rename to src/Tizen.NUI/src/public/XamlBinding/Interactivity/Condition.cs index 74ee0a2..0d4ece0 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/Condition.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/Condition.cs @@ -1,8 +1,11 @@ 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 _conditionChanged; diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/DataTrigger.cs b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/DataTrigger.cs similarity index 65% rename from src/Tizen.NUI/src/internal/XamlBinding/Interactivity/DataTrigger.cs rename to src/Tizen.NUI/src/public/XamlBinding/Interactivity/DataTrigger.cs index 96e8815..526b526 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/DataTrigger.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/DataTrigger.cs @@ -1,18 +1,25 @@ 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; } @@ -28,11 +35,15 @@ 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 new IList 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; } diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/EventTrigger.cs b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/EventTrigger.cs similarity index 79% rename from src/Tizen.NUI/src/internal/XamlBinding/Interactivity/EventTrigger.cs rename to src/Tizen.NUI/src/public/XamlBinding/Interactivity/EventTrigger.cs index 749b3ec..e8b37b8 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/EventTrigger.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/EventTrigger.cs @@ -1,13 +1,16 @@ 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 _associatedObjects = new List(); @@ -17,13 +20,19 @@ namespace Tizen.NUI.Binding 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(); } + /// 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 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; } diff --git a/src/Tizen.NUI/src/public/XamlBinding/Interactivity/MultiTrigger.cs b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/MultiTrigger.cs new file mode 100755 index 0000000..928c8f5 --- /dev/null +++ b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/MultiTrigger.cs @@ -0,0 +1,32 @@ +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 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 Setters + { + get { return base.Setters; } + } + } +} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/XamlPropertyCondition.cs b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/XamlPropertyCondition.cs similarity index 84% rename from src/Tizen.NUI/src/internal/XamlBinding/Interactivity/XamlPropertyCondition.cs rename to src/Tizen.NUI/src/public/XamlBinding/Interactivity/XamlPropertyCondition.cs index b17ac58..eac49d0 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/XamlPropertyCondition.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/XamlPropertyCondition.cs @@ -5,20 +5,26 @@ 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.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; } @@ -39,6 +45,8 @@ 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 object Value { get { return _triggerValue; } diff --git a/src/Tizen.NUI/src/public/XamlBinding/Internals/DynamicResource.cs b/src/Tizen.NUI/src/public/XamlBinding/Internals/DynamicResource.cs new file mode 100755 index 0000000..5e317ab --- /dev/null +++ b/src/Tizen.NUI/src/public/XamlBinding/Internals/DynamicResource.cs @@ -0,0 +1,20 @@ +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 diff --git a/src/Tizen.NUI/src/public/XamlBinding/Internals/IDynamicResourceHandler.cs b/src/Tizen.NUI/src/public/XamlBinding/Internals/IDynamicResourceHandler.cs new file mode 100755 index 0000000..8916eae --- /dev/null +++ b/src/Tizen.NUI/src/public/XamlBinding/Internals/IDynamicResourceHandler.cs @@ -0,0 +1,14 @@ +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); + } +} diff --git a/src/Tizen.NUI/src/public/XamlBinding/Internals/INameScope.cs b/src/Tizen.NUI/src/public/XamlBinding/Internals/INameScope.cs new file mode 100755 index 0000000..d224f47 --- /dev/null +++ b/src/Tizen.NUI/src/public/XamlBinding/Internals/INameScope.cs @@ -0,0 +1,27 @@ +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); + } +} diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Internals/NameScope.cs b/src/Tizen.NUI/src/public/XamlBinding/Internals/NameScope.cs similarity index 72% rename from src/Tizen.NUI/src/internal/XamlBinding/Internals/NameScope.cs rename to src/Tizen.NUI/src/public/XamlBinding/Internals/NameScope.cs index 13b4bfa..f6d57b3 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/Internals/NameScope.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Internals/NameScope.cs @@ -7,8 +7,12 @@ using Tizen.NUI.Xaml; 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 _names = new Dictionary(); @@ -46,11 +50,15 @@ namespace Tizen.NUI.Binding.Internals _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); diff --git a/src/Tizen.NUI/src/public/XamlBinding/Page.cs b/src/Tizen.NUI/src/public/XamlBinding/Page.cs index c11ca03..a4134c1 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/Page.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Page.cs @@ -32,7 +32,7 @@ namespace Tizen.NUI /// // [RenderWith(typeof(_PageRenderer))] [EditorBrowsable(EditorBrowsableState.Never)] - public class Page : /*VisualElement*/BaseHandle, ILayout, IPageController, IElementConfiguration, IPaddingElement + public class Page : BaseHandle, IPageController, IElementConfiguration { /// /// For internal use. @@ -58,36 +58,12 @@ namespace Tizen.NUI internal static readonly BindableProperty IgnoresContainerAreaProperty = BindableProperty.Create("IgnoresContainerArea", typeof(bool), typeof(Page), false); /// - /// Identifies the BackgroundImage property. - /// - internal static readonly BindableProperty BackgroundImageProperty = BindableProperty.Create("BackgroundImage", typeof(string), typeof(Page), default(string)); - - /// /// Identifies the IsBusy property. /// internal static readonly BindableProperty IsBusyProperty = BindableProperty.Create("IsBusy", typeof(bool), typeof(Page), false, propertyChanged: (bo, o, n) => ((Page)bo).OnPageBusyChanged()); - /// - /// Identifies the Padding property. - /// - internal static readonly BindableProperty PaddingProperty = PaddingElement.PaddingProperty; - - /// - /// Identifies the Title property. - /// - internal static readonly BindableProperty TitleProperty = BindableProperty.Create("Title", typeof(string), typeof(Page), null); - - /// - /// Identifies the Icon property. - /// - internal static readonly BindableProperty IconProperty = BindableProperty.Create("Icon", typeof(FileImageSource), typeof(Page), default(FileImageSource)); - - readonly Lazy> _platformConfigurationRegistry; - Rectangle _containerArea; - bool _containerAreaSet; - bool _hasAppeared; ReadOnlyCollection _logicalChildren; @@ -99,28 +75,8 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public Page() { - var toolbarItems = new ObservableCollection(); - toolbarItems.CollectionChanged += OnToolbarItemsCollectionChanged; // ToolbarItems = toolbarItems; InternalChildren.CollectionChanged += InternalChildrenOnCollectionChanged; - _platformConfigurationRegistry = new Lazy>(() => new PlatformConfigurationRegistry(this)); - } - - /// - /// Identifies the image used as a background for the Page. - /// - /// 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); } } /// @@ -135,38 +91,6 @@ namespace Tizen.NUI } /// - /// The space between the content of the Page and it's border. - /// - 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(); - } - - /// - /// The Page's title. - /// - /// 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 ToolbarItems { get;/* internal set;*/ } - - /// /// For internal use. /// [EditorBrowsable(EditorBrowsableState.Never)] @@ -177,7 +101,7 @@ namespace Tizen.NUI { if (_containerArea == value) return; - _containerAreaSet = true; + _containerArea = value; ForceLayout(); } @@ -203,13 +127,6 @@ namespace Tizen.NUI _logicalChildren ?? (_logicalChildren = new ReadOnlyCollection(InternalChildren)); /// - /// Raised when the layout of the Page has changed. - /// - /// 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; - - /// /// ndicates that the Page is about to appear. /// /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. @@ -295,31 +212,6 @@ namespace Tizen.NUI } /// - /// Lays out children Elements into the specified area. - /// - /// Left-hand side of layout area. - /// Top of layout area. - /// Width of layout area. - /// Height of layout area. - /// 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); - } - } - - /// /// When overridden, allows application developers to customize behavior immediately prior to the Page becoming visible. /// /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. @@ -340,7 +232,6 @@ namespace Tizen.NUI var canceled = false; EventHandler handler = (sender, args) => { canceled = true; }; - Navigation.PopModalAsync().ContinueWith(t => { throw t.Exception; }, CancellationToken.None, TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.FromCurrentSynchronizationContext()); return !canceled; } @@ -387,25 +278,6 @@ namespace Tizen.NUI base.OnParentSet(); } - /// - /// Requests that the children Elements of the Page update their layouts. - /// - /// 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; @@ -550,15 +422,5 @@ namespace Tizen.NUI } return !any; } - - /// - /// Returns the platform-specific instance of this Page, on which a platform-specific method may be called. - /// - /// The platform for which to return an instance. - /// The platform-specific instance of this Page - internal IPlatformElementConfiguration On() where T : IConfigPlatform - { - return _platformConfigurationRegistry.Value.On(); - } } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Registrar.cs b/src/Tizen.NUI/src/public/XamlBinding/Registrar.cs similarity index 66% rename from src/Tizen.NUI/src/internal/XamlBinding/Registrar.cs rename to src/Tizen.NUI/src/public/XamlBinding/Registrar.cs index ee075dc..5518b42 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/Registrar.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Registrar.cs @@ -5,23 +5,15 @@ using System.Linq; 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 { /// /// For internal use. /// /// + /// 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 where TRegistrable : class + public class Registrar where TRegistrable : class { readonly Dictionary _handlers = new Dictionary(); @@ -30,6 +22,8 @@ namespace Tizen.NUI.Binding.Internals /// /// The type of the view /// The type of the render. + /// 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 @@ -69,6 +63,8 @@ namespace Tizen.NUI.Binding.Internals /// The type of the handler /// The type. /// The handler instance. + /// 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(Type type) where TOut : TRegistrable { return (TOut)GetHandler(type); @@ -81,6 +77,8 @@ namespace Tizen.NUI.Binding.Internals /// The type. /// The args of the type /// The handler instance. + /// 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(Type type, params object[] args) where TOut : TRegistrable { return (TOut)GetHandler(type, args); @@ -92,6 +90,8 @@ namespace Tizen.NUI.Binding.Internals /// Thetype /// The object instance. /// The handle of the obj. + /// 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(object obj) where TOut : TRegistrable { if (obj == null) @@ -110,6 +110,8 @@ namespace Tizen.NUI.Binding.Internals /// The object instance /// The args of the type /// The handler of the 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 TOut GetHandlerForObject(object obj, params object[] args) where TOut : TRegistrable { if (obj == null) @@ -126,6 +128,8 @@ namespace Tizen.NUI.Binding.Internals /// /// The view type. /// The type of the handle. + /// 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; @@ -166,6 +170,8 @@ namespace Tizen.NUI.Binding.Internals /// /// The object instance. /// The type of the handler. + /// 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) @@ -200,8 +206,9 @@ namespace Tizen.NUI.Binding.Internals /// /// For internal use /// + /// 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() { @@ -211,74 +218,12 @@ namespace Tizen.NUI.Binding.Internals internal static Dictionary Effects { get; } = new Dictionary(); internal static Dictionary StyleProperties { get; } = new Dictionary(); + /// 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 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 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); - } } } diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Setter.cs b/src/Tizen.NUI/src/public/XamlBinding/Setter.cs similarity index 84% rename from src/Tizen.NUI/src/internal/XamlBinding/Setter.cs rename to src/Tizen.NUI/src/public/XamlBinding/Setter.cs index 7e0bb79..5692984 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/Setter.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Setter.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Reflection; using System.Runtime.CompilerServices; using System.Xml; @@ -8,14 +9,23 @@ using Tizen.NUI.Xaml; namespace Tizen.NUI.Binding { + /// 6 + /// 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 _originalValues = new ConditionalWeakTable(); + /// 6 + /// 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; } + /// 6 + /// 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) diff --git a/src/Tizen.NUI/src/internal/XamlBinding/SizeTypeConverter.cs b/src/Tizen.NUI/src/public/XamlBinding/SizeTypeConverter.cs similarity index 68% rename from src/Tizen.NUI/src/internal/XamlBinding/SizeTypeConverter.cs rename to src/Tizen.NUI/src/public/XamlBinding/SizeTypeConverter.cs index d527715..68a2db0 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/SizeTypeConverter.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/SizeTypeConverter.cs @@ -5,12 +5,17 @@ using System.Globalization; 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) @@ -29,9 +34,13 @@ 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 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) diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Style.cs b/src/Tizen.NUI/src/public/XamlBinding/Style.cs similarity index 77% rename from src/Tizen.NUI/src/internal/XamlBinding/Style.cs rename to src/Tizen.NUI/src/public/XamlBinding/Style.cs index 1c9b2a9..e5841cb 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/Style.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Style.cs @@ -6,8 +6,11 @@ using System.ComponentModel; namespace Tizen.NUI.Binding { + /// 6 + /// 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."; @@ -24,6 +27,9 @@ namespace Tizen.NUI.Binding IList _triggers; + /// 6 + /// 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) @@ -33,8 +39,14 @@ namespace Tizen.NUI.Binding Setters = new List(); } + /// 6 + /// 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; } + /// 6 + /// 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; } @@ -52,6 +64,9 @@ namespace Tizen.NUI.Binding } } + /// 6 + /// 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; } @@ -80,10 +95,16 @@ namespace Tizen.NUI.Binding get { return _behaviors ?? (_behaviors = new AttachedCollection()); } } + /// 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 Setters { get; } /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. @@ -101,6 +122,9 @@ namespace Tizen.NUI.Binding ApplyCore(bindable, BasedOn ?? GetBasedOnResource(bindable)); } + /// 6 + /// 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) diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/Trigger.cs b/src/Tizen.NUI/src/public/XamlBinding/Trigger.cs similarity index 61% rename from src/Tizen.NUI/src/internal/XamlBinding/Interactivity/Trigger.cs rename to src/Tizen.NUI/src/public/XamlBinding/Trigger.cs index 28fd944..0017161 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/Trigger.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Trigger.cs @@ -1,20 +1,30 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Reflection; using Tizen.NUI.Xaml; namespace Tizen.NUI.Binding { + /// 6 + /// 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 { + /// 6 + /// 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) { } + /// 6 + /// 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; } @@ -30,11 +40,17 @@ namespace Tizen.NUI.Binding } } + /// 6 + /// 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 Setters { get { return base.Setters; } } + /// 6 + /// 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; } diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/TriggerAction.cs b/src/Tizen.NUI/src/public/XamlBinding/TriggerAction.cs similarity index 54% rename from src/Tizen.NUI/src/internal/XamlBinding/Interactivity/TriggerAction.cs rename to src/Tizen.NUI/src/public/XamlBinding/TriggerAction.cs index 7aa32d7..1b5c861 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/TriggerAction.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/TriggerAction.cs @@ -1,8 +1,12 @@ using System; +using System.ComponentModel; namespace Tizen.NUI.Binding { - internal abstract class TriggerAction + /// 6 + /// 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) { @@ -11,8 +15,14 @@ namespace Tizen.NUI.Binding AssociatedType = associatedType; } + /// 6 + /// 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; } + /// 6 + /// 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) diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/TriggerBase.cs b/src/Tizen.NUI/src/public/XamlBinding/TriggerBase.cs similarity index 84% rename from src/Tizen.NUI/src/internal/XamlBinding/Interactivity/TriggerBase.cs rename to src/Tizen.NUI/src/public/XamlBinding/TriggerBase.cs index 6eef482..de86ef7 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/Interactivity/TriggerBase.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/TriggerBase.cs @@ -2,10 +2,14 @@ using System; using System.Reflection; using System.Collections; using System.Collections.Generic; +using System.ComponentModel; namespace Tizen.NUI.Binding { - internal abstract class TriggerBase : BindableObject, IAttachedObject + /// 6 + /// 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; @@ -26,10 +30,19 @@ namespace Tizen.NUI.Binding Condition.ConditionChanged = OnConditionChanged; } + /// 6 + /// 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 EnterActions { get; } + /// 6 + /// 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 ExitActions { get; } + /// 6 + /// 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; } @@ -44,6 +57,9 @@ namespace Tizen.NUI.Binding } } + /// 6 + /// 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; } diff --git a/src/Tizen.NUI/src/internal/XamlBinding/TypeConverter.cs b/src/Tizen.NUI/src/public/XamlBinding/TypeConverter.cs similarity index 53% rename from src/Tizen.NUI/src/internal/XamlBinding/TypeConverter.cs rename to src/Tizen.NUI/src/public/XamlBinding/TypeConverter.cs index bdc67a8..10c6f25 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/TypeConverter.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/TypeConverter.cs @@ -1,10 +1,15 @@ 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) @@ -13,18 +18,24 @@ namespace Tizen.NUI.Binding 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 diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Internals/TypedBinding.cs b/src/Tizen.NUI/src/public/XamlBinding/TypedBinding.cs similarity index 94% rename from src/Tizen.NUI/src/internal/XamlBinding/Internals/TypedBinding.cs rename to src/Tizen.NUI/src/public/XamlBinding/TypedBinding.cs index ed30914..e40db3c 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/Internals/TypedBinding.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/TypedBinding.cs @@ -9,13 +9,17 @@ using Tizen.NUI.Binding; 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 { @@ -24,6 +28,8 @@ 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 object ConverterParameter { get { return _converterParameter; } set { @@ -32,6 +38,8 @@ 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 object Source { get { return _source; } set { diff --git a/src/Tizen.NUI/src/public/XamlBinding/XmlnsDefinitionAttribute.cs b/src/Tizen.NUI/src/public/XamlBinding/XmlnsDefinitionAttribute.cs index baee6f1..c118e9f 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/XmlnsDefinitionAttribute.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/XmlnsDefinitionAttribute.cs @@ -26,6 +26,10 @@ namespace Tizen.NUI [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) @@ -37,6 +41,7 @@ namespace Tizen.NUI ClrNamespace = clrNamespace; XmlNamespace = xmlNamespace; + Level = 0; } } } \ No newline at end of file