Remove InternalsVisibleTo from Core to XF.Platforms.* (#782)

* Remove InternalsVisibleTo from Core to XF.Platforms.*

* Changes per Jason's code review

* Move LockableObservableListWrapper to internals namespace

* Changes per Stephane's code review

* update docs

* Touch code to get CI to run tests

* Rebase; Update documentation
This commit is contained in:
kingces95 2017-03-07 14:56:24 -05:00 коммит произвёл GitHub
Родитель 2b92142ab2
Коммит e6d5186c8a
344 изменённых файлов: 10674 добавлений и 583 удалений

Просмотреть файл

@ -319,7 +319,6 @@
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<ItemGroup />
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>

Просмотреть файл

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
using Xamarin.Forms.Internals;
using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.WindowsSpecific;

Просмотреть файл

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Controls
{

Просмотреть файл

@ -1,5 +1,6 @@
using System;
using System.Diagnostics;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Controls
{

Просмотреть файл

@ -4,6 +4,7 @@ using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Controls
{

Просмотреть файл

@ -1,4 +1,5 @@
using System.Diagnostics;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Controls
{

Просмотреть файл

@ -1,5 +1,6 @@
using System;
using System.Linq;
using Xamarin.Forms.Internals;
using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.WindowsSpecific;

Просмотреть файл

@ -6,6 +6,7 @@ using System.Reflection;
using System.Threading.Tasks;
using Xamarin.Forms.Controls.TestCasesPages;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Controls
{

Просмотреть файл

@ -3,6 +3,7 @@ using System.ComponentModel;
using System.Linq;
using System.Windows.Markup;
using Microsoft.Windows.Design;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.Design
{

Просмотреть файл

@ -1,6 +1,7 @@
using System;
using System.Globalization;
using NUnit.Framework;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.UnitTests
{
@ -594,7 +595,7 @@ namespace Xamarin.Forms.Core.UnitTests
};
mock.SetValueCore (MockBindable.TextProperty, foo,
BindableObject.SetValueFlags.ClearOneWayBindings | BindableObject.SetValueFlags.ClearDynamicResource | BindableObject.SetValueFlags.RaiseOnEqual);
SetValueFlags.ClearOneWayBindings | SetValueFlags.ClearDynamicResource | SetValueFlags.RaiseOnEqual);
Assert.That (changing, Is.True, "PropertyChanging event did not fire");
Assert.That (changed, Is.True, "PropertyChanged event did not fire");

Просмотреть файл

@ -4,6 +4,7 @@ using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using NUnit.Framework;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.UnitTests
{

Просмотреть файл

@ -6,8 +6,9 @@ using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using NUnit.Framework;
using CategoryAttribute=NUnit.Framework.CategoryAttribute;
using DescriptionAttribute=NUnit.Framework.DescriptionAttribute;
using CategoryAttribute = NUnit.Framework.CategoryAttribute;
using DescriptionAttribute = NUnit.Framework.DescriptionAttribute;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.UnitTests
{

Просмотреть файл

@ -7,6 +7,7 @@ using System.Threading;
using System.Threading.Tasks;
using System.Windows.Input;
using NUnit.Framework;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.UnitTests
{

Просмотреть файл

@ -1,6 +1,7 @@
using System;
using NUnit.Framework;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.UnitTests
{

Просмотреть файл

@ -149,13 +149,13 @@ namespace Xamarin.Forms.Core.UnitTests
return Task.FromResult (true);
}
public Task<Stream> OpenFileAsync (string path, FileMode mode, FileAccess access)
public Task<Stream> OpenFileAsync (string path, Internals.FileMode mode, Internals.FileAccess access)
{
Stream stream = isolatedStorageFile.OpenFile (path, (System.IO.FileMode)mode, (System.IO.FileAccess)access);
return Task.FromResult (stream);
}
public Task<Stream> OpenFileAsync (string path, FileMode mode, FileAccess access, FileShare share)
public Task<Stream> OpenFileAsync (string path, Internals.FileMode mode, Internals.FileAccess access, Internals.FileShare share)
{
Stream stream = isolatedStorageFile.OpenFile (path, (System.IO.FileMode)mode, (System.IO.FileAccess)access, (System.IO.FileShare)share);
return Task.FromResult (stream);

Просмотреть файл

@ -3,6 +3,7 @@ using System.Collections.Generic;
using NUnit.Framework;
using System.ComponentModel;
using System.Globalization;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.UnitTests
{

Просмотреть файл

@ -4,6 +4,7 @@ using NUnit.Framework;
using System.Collections.Generic;
using System.Linq;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.UnitTests
{
@ -182,7 +183,7 @@ namespace Xamarin.Forms.Core.UnitTests
};
menu.Add (child);
menu.SendTargetSelected (child);
((INavigationMenuController)menu).SendTargetSelected (child);
Assert.True (pushed);
Assert.AreEqual (child, navForm.CurrentPage);

Просмотреть файл

@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.UnitTests
{

Просмотреть файл

@ -2,7 +2,7 @@ using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using System.Threading.Tasks;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.UnitTests
{

Просмотреть файл

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.UnitTests
{

Просмотреть файл

@ -1,5 +1,6 @@
using System;
using NUnit.Framework;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.UnitTests
{

Просмотреть файл

@ -1,5 +1,6 @@
using System;
using NUnit.Framework;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.UnitTests
{

Просмотреть файл

@ -29,7 +29,7 @@ namespace Xamarin.Forms.Core.UnitTests
{
base.Setup ();
Device.PlatformServices = new MockPlatformServices ();
Registrar.RegisterAll (new [] {
Internals.Registrar.RegisterAll (new [] {
typeof (TestHandlerAttribute)
});
@ -45,7 +45,7 @@ namespace Xamarin.Forms.Core.UnitTests
[Test]
public void GetButtonHandler ()
{
var buttonTarget = Registrar.Registered.GetHandler<ButtonTarget> (typeof (Button));
var buttonTarget = Internals.Registrar.Registered.GetHandler<ButtonTarget> (typeof (Button));
Assert.IsNotNull (buttonTarget);
Assert.That (buttonTarget, Is.InstanceOf<ButtonTarget>());
}
@ -53,7 +53,7 @@ namespace Xamarin.Forms.Core.UnitTests
[Test]
public void GetSliderHandler()
{
var sliderTarget = Registrar.Registered.GetHandler<SliderTarget> (typeof (Slider));
var sliderTarget = Internals.Registrar.Registered.GetHandler<SliderTarget> (typeof (Slider));
Assert.IsNotNull (sliderTarget);
Assert.That (sliderTarget, Is.InstanceOf<SliderTarget> ());
}
@ -76,7 +76,7 @@ namespace Xamarin.Forms.Core.UnitTests
[Test]
public void TestConstructor ()
{
var registrar = new Registrar<MockRenderer> ();
var registrar = new Internals.Registrar<MockRenderer> ();
var renderer = registrar.GetHandler (typeof (Button));
@ -86,7 +86,7 @@ namespace Xamarin.Forms.Core.UnitTests
[Test]
public void TestGetRendererForKnownClass ()
{
var registrar = new Registrar<MockRenderer> ();
var registrar = new Internals.Registrar<MockRenderer> ();
registrar.Register (typeof(View), typeof(MockRenderer));
@ -98,7 +98,7 @@ namespace Xamarin.Forms.Core.UnitTests
[Test]
public void TestGetRendererForUnknownSubclass ()
{
var registrar = new Registrar<MockRenderer> ();
var registrar = new Internals.Registrar<MockRenderer> ();
registrar.Register (typeof (View), typeof (MockRenderer));
@ -110,7 +110,7 @@ namespace Xamarin.Forms.Core.UnitTests
[Test]
public void TestGetRendererWithRegisteredSubclass ()
{
var registrar = new Registrar<MockRenderer> ();
var registrar = new Internals.Registrar<MockRenderer> ();
registrar.Register (typeof (View), typeof (MockRenderer));
registrar.Register (typeof (Button), typeof (ButtonMockRenderer));
@ -126,7 +126,7 @@ namespace Xamarin.Forms.Core.UnitTests
[Test]
public void TestReplaceRenderer ()
{
var registrar = new Registrar<MockRenderer> ();
var registrar = new Internals.Registrar<MockRenderer> ();
registrar.Register (typeof (View), typeof (MockRenderer));
registrar.Register (typeof (Button), typeof (ButtonMockRenderer));
@ -140,7 +140,7 @@ namespace Xamarin.Forms.Core.UnitTests
[Test]
public void GetHandlerType()
{
var registrar = new Registrar<MockRenderer>();
var registrar = new Internals.Registrar<MockRenderer>();
registrar.Register (typeof (View), typeof (MockRenderer));
Assert.AreEqual (typeof (MockRenderer), registrar.GetHandlerType (typeof (View)));

Просмотреть файл

@ -5,6 +5,7 @@ using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using NUnit.Framework;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.UnitTests
{

Просмотреть файл

@ -2,6 +2,7 @@
using System.Linq;
using NUnit.Framework;
using System.Collections.Generic;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.UnitTests
{

Просмотреть файл

@ -1,6 +1,6 @@
using System;
using NUnit.Framework;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.UnitTests
{

Просмотреть файл

@ -4,6 +4,7 @@ using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
using NUnit.Framework;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.UnitTests
{

Просмотреть файл

@ -1,4 +1,5 @@
using System;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Core.UnitTests
{

Просмотреть файл

@ -1,9 +1,9 @@
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal class ActionSheetArguments
public class ActionSheetArguments
{
public ActionSheetArguments(string title, string cancel, string destruction, IEnumerable<string> buttons)
{

Просмотреть файл

@ -1,8 +1,8 @@
using System.Threading.Tasks;
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal class AlertArguments
public class AlertArguments
{
public AlertArguments(string title, string message, string accept, string cancel)
{

Просмотреть файл

@ -1,8 +1,9 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Threading.Tasks;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Platform;
namespace Xamarin.Forms
@ -29,7 +30,7 @@ namespace Xamarin.Forms
if (f)
Loader.Load();
NavigationProxy = new NavigationImpl(this);
Current = this;
SetCurrentApplication(this);
SystemResources = DependencyService.Get<ISystemResourcesProvider>().GetSystemResources();
SystemResources.ValuesChanged += OnParentResourcesChanged;
@ -48,10 +49,13 @@ namespace Xamarin.Forms
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public static void SetCurrentApplication(Application value) => Current = value;
public static Application Current
{
get { return s_current; }
internal set
set
{
if (s_current == value)
return;
@ -109,9 +113,11 @@ namespace Xamarin.Forms
get { return _logicalChildren ?? (_logicalChildren = new ReadOnlyCollection<Element>(InternalChildren)); }
}
internal NavigationProxy NavigationProxy { get; }
[EditorBrowsable(EditorBrowsableState.Never)]
public NavigationProxy NavigationProxy { get; }
internal int PanGestureId { get; set; }
[EditorBrowsable(EditorBrowsableState.Never)]
public int PanGestureId { get; set; }
internal IResourceDictionary SystemResources { get; }
@ -182,12 +188,14 @@ namespace Xamarin.Forms
{
}
internal static void ClearCurrent()
[EditorBrowsable(EditorBrowsableState.Never)]
public static void ClearCurrent()
{
s_current = null;
}
internal static bool IsApplicationOrNull(Element element)
[EditorBrowsable(EditorBrowsableState.Never)]
public static bool IsApplicationOrNull(Element element)
{
return element == null || element is Application;
}
@ -214,24 +222,28 @@ namespace Xamarin.Forms
internal event EventHandler PopCanceled;
internal void SendOnAppLinkRequestReceived(Uri uri)
[EditorBrowsable(EditorBrowsableState.Never)]
public void SendOnAppLinkRequestReceived(Uri uri)
{
OnAppLinkRequestReceived(uri);
}
internal void SendResume()
[EditorBrowsable(EditorBrowsableState.Never)]
public void SendResume()
{
s_current = this;
OnResume();
}
internal Task SendSleepAsync()
[EditorBrowsable(EditorBrowsableState.Never)]
public Task SendSleepAsync()
{
OnSleep();
return SavePropertiesAsync();
}
internal void SendStart()
[EditorBrowsable(EditorBrowsableState.Never)]
public void SendStart()
{
OnStart();
}

Просмотреть файл

@ -91,7 +91,8 @@ namespace Xamarin.Forms
SetValue(propertyKey.BindableProperty, value, false, false);
}
protected internal static void SetInheritedBindingContext(BindableObject bindable, object value)
[EditorBrowsable(EditorBrowsableState.Never)]
public static void SetInheritedBindingContext(BindableObject bindable, object value)
{
BindablePropertyContext bpContext = bindable.GetContext(BindingContextProperty);
if (bpContext != null && ((bpContext.Attributes & BindableContextAttributes.IsManuallySet) != 0))
@ -202,7 +203,8 @@ namespace Xamarin.Forms
return values;
}
internal object[] GetValues(BindableProperty property0, BindableProperty property1, BindableProperty property2)
[EditorBrowsable(EditorBrowsableState.Never)]
public object[] GetValues(BindableProperty property0, BindableProperty property1, BindableProperty property2)
{
var values = new object[3];
@ -326,7 +328,8 @@ namespace Xamarin.Forms
SetValueCore(propertyKey.BindableProperty, value, attributes, SetValuePrivateFlags.None);
}
internal void SetValueCore(BindableProperty property, object value, SetValueFlags attributes = SetValueFlags.None)
[EditorBrowsable(EditorBrowsableState.Never)]
public void SetValueCore(BindableProperty property, object value, SetValueFlags attributes = SetValueFlags.None)
{
SetValueCore(property, value, attributes, SetValuePrivateFlags.Default);
}
@ -611,16 +614,6 @@ namespace Xamarin.Forms
public object Value;
}
[Flags]
internal enum SetValueFlags
{
None = 0,
ClearOneWayBindings = 1 << 0,
ClearTwoWayBindings = 1 << 1,
ClearDynamicResource = 1 << 2,
RaiseOnEqual = 1 << 3
}
[Flags]
internal enum SetValuePrivateFlags
{
@ -651,4 +644,17 @@ namespace Xamarin.Forms
}
}
}
namespace Internals
{
[Flags]
public enum SetValueFlags
{
None = 0,
ClearOneWayBindings = 1 << 0,
ClearTwoWayBindings = 1 << 1,
ClearDynamicResource = 1 << 2,
RaiseOnEqual = 1 << 3
}
}
}

Просмотреть файл

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Linq.Expressions;
using System.Reflection;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{

Просмотреть файл

@ -3,6 +3,7 @@ using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Xml;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Xaml;
namespace Xamarin.Forms

Просмотреть файл

@ -1,10 +1,12 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{
@ -82,7 +84,8 @@ namespace Xamarin.Forms
}
}
internal string UpdateSourceEventName {
[EditorBrowsable(EditorBrowsableState.Never)]
public string UpdateSourceEventName {
get { return _updateSourceEventName; }
set {
ThrowIfApplied();

Просмотреть файл

@ -5,6 +5,7 @@ using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{
@ -170,7 +171,7 @@ namespace Xamarin.Forms
return;
}
target.SetValueCore(property, value, BindableObject.SetValueFlags.ClearDynamicResource, BindableObject.SetValuePrivateFlags.Default | BindableObject.SetValuePrivateFlags.Converted);
target.SetValueCore(property, value, SetValueFlags.ClearDynamicResource, BindableObject.SetValuePrivateFlags.Default | BindableObject.SetValuePrivateFlags.Converted);
}
else if (needsSetter && part.LastSetter != null && current != null)
{

Просмотреть файл

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{

Просмотреть файл

@ -1,6 +1,8 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{
@ -22,11 +24,14 @@ namespace Xamarin.Forms
get { return new Color(-1d, -1d, -1d, -1d, Mode.Default); }
}
internal bool IsDefault
[EditorBrowsable(EditorBrowsableState.Never)]
public bool IsDefault
{
get { return _mode == Mode.Default; }
}
[EditorBrowsable(EditorBrowsableState.Never)]
public static void SetAccent(Color value) => Accent = value;
public static Color Accent { get; internal set; }
readonly float _a;

Просмотреть файл

@ -1,6 +1,7 @@
using System;
using System.Linq;
using System.Globalization;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{

Просмотреть файл

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{

Просмотреть файл

@ -1,12 +1,16 @@
namespace Xamarin.Forms
using System.ComponentModel;
namespace Xamarin.Forms.Internals
{
internal sealed class CustomKeyboard : Keyboard
public sealed class CustomKeyboard : Keyboard
{
internal CustomKeyboard(KeyboardFlags flags)
{
Flags = flags;
}
internal KeyboardFlags Flags { get; private set; }
[EditorBrowsable(EditorBrowsableState.Never)]
public KeyboardFlags Flags { get; private set; }
}
}

Просмотреть файл

@ -1,7 +1,10 @@
namespace Xamarin.Forms
using System.ComponentModel;
namespace Xamarin.Forms.Internals
{
internal static class DataTemplateExtensions
public static class DataTemplateExtensions
{
[EditorBrowsable(EditorBrowsableState.Never)]
public static object CreateContent(this DataTemplate self, object item, BindableObject container)
{
var selector = self as DataTemplateSelector;

Просмотреть файл

@ -1,8 +1,9 @@
using System;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal class DelegateLogListener : LogListener
public class DelegateLogListener : LogListener
{
readonly Action<string, string> _log;

Просмотреть файл

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{

Просмотреть файл

@ -1,8 +1,10 @@
using System;
using System.ComponentModel;
using System.IO;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{
@ -15,12 +17,18 @@ namespace Xamarin.Forms
public const string WinRT = "WinRT";
public const string macOS = "macOS";
internal static DeviceInfo info;
[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; }
[EditorBrowsable(EditorBrowsableState.Never)]
public static void SetTargetIdiom(TargetIdiom value) => Idiom = value;
[Obsolete("Use RuntimePlatform instead.")]
#pragma warning disable 0618
public static TargetPlatform OS
@ -44,7 +52,8 @@ namespace Xamarin.Forms
public static string RuntimePlatform => PlatformServices.RuntimePlatform;
internal static DeviceInfo Info
[EditorBrowsable(EditorBrowsableState.Never)]
public static DeviceInfo Info
{
get
{
@ -55,12 +64,14 @@ namespace Xamarin.Forms
set { info = value; }
}
internal static bool IsInvokeRequired
[EditorBrowsable(EditorBrowsableState.Never)]
public static bool IsInvokeRequired
{
get { return PlatformServices.IsInvokeRequired; }
}
internal static IPlatformServices PlatformServices
[EditorBrowsable(EditorBrowsableState.Never)]
public static IPlatformServices PlatformServices
{
get
{
@ -144,12 +155,14 @@ namespace Xamarin.Forms
PlatformServices.StartTimer(interval, callback);
}
internal static Assembly[] GetAssemblies()
[EditorBrowsable(EditorBrowsableState.Never)]
public static Assembly[] GetAssemblies()
{
return PlatformServices.GetAssemblies();
}
internal static double GetNamedSize(NamedSize size, Type targetElementType, bool useOldSizes)
[EditorBrowsable(EditorBrowsableState.Never)]
public static double GetNamedSize(NamedSize size, Type targetElementType, bool useOldSizes)
{
return PlatformServices.GetNamedSize(size, targetElementType, useOldSizes);
}

Просмотреть файл

@ -2,17 +2,18 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal abstract class DeviceInfo : INotifyPropertyChanged, IDisposable
public abstract class DeviceInfo : INotifyPropertyChanged, IDisposable
{
DeviceOrientation _currentOrientation;
bool _disposed;
[EditorBrowsable(EditorBrowsableState.Never)]
public DeviceOrientation CurrentOrientation
{
get { return _currentOrientation; }
internal set
set
{
if (Equals(_currentOrientation, value))
return;

Просмотреть файл

@ -1,6 +1,6 @@
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal enum DeviceOrientation
public enum DeviceOrientation
{
Portrait,
Landscape,

Просмотреть файл

@ -1,12 +1,16 @@
namespace Xamarin.Forms
using System.ComponentModel;
namespace Xamarin.Forms.Internals
{
internal static class DeviceOrientationExtensions
public static class DeviceOrientationExtensions
{
[EditorBrowsable(EditorBrowsableState.Never)]
public static bool IsLandscape(this DeviceOrientation orientation)
{
return orientation == DeviceOrientation.Landscape || orientation == DeviceOrientation.LandscapeLeft || orientation == DeviceOrientation.LandscapeRight;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public static bool IsPortrait(this DeviceOrientation orientation)
{
return orientation == DeviceOrientation.Portrait || orientation == DeviceOrientation.PortraitDown || orientation == DeviceOrientation.PortraitUp;

Просмотреть файл

@ -1,4 +1,5 @@
using System;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Platform;
namespace Xamarin.Forms

Просмотреть файл

@ -1,5 +1,6 @@
using System;
using System.ComponentModel;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{

Просмотреть файл

@ -133,7 +133,8 @@ namespace Xamarin.Forms
}
}
internal IPlatform Platform
[EditorBrowsable(EditorBrowsableState.Never)]
public IPlatform Platform
{
get
{
@ -158,7 +159,8 @@ namespace Xamarin.Forms
}
// you're not my real dad
internal Element RealParent { get; private set; }
[EditorBrowsable(EditorBrowsableState.Never)]
public Element RealParent { get; private set; }
List<KeyValuePair<string, BindableProperty>> DynamicResources
{
@ -389,7 +391,8 @@ namespace Xamarin.Forms
}
}
internal IEnumerable<Element> Descendants()
[EditorBrowsable(EditorBrowsableState.Never)]
public IEnumerable<Element> Descendants()
{
var queue = new Queue<Element>(16);
queue.Enqueue(this);
@ -476,7 +479,8 @@ namespace Xamarin.Forms
internal event EventHandler ParentSet;
internal event EventHandler PlatformSet;
[EditorBrowsable(EditorBrowsableState.Never)]
public event EventHandler PlatformSet;
internal virtual void SetChildInheritedBindingContext(Element child, object context)
{

Просмотреть файл

@ -1,4 +1,5 @@
using System;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Platform;
namespace Xamarin.Forms

Просмотреть файл

@ -1,9 +1,10 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal static class EnumerableExtensions
public static class EnumerableExtensions
{
public static IEnumerable<T> GetGesturesFor<T>(this IEnumerable<IGestureRecognizer> gestures, Func<T, bool> predicate = null) where T : GestureRecognizer
{
@ -31,7 +32,8 @@ namespace Xamarin.Forms
yield return item;
}
internal static void ForEach<T>(this IEnumerable<T> enumeration, Action<T> action)
[EditorBrowsable(EditorBrowsableState.Never)]
public static void ForEach<T>(this IEnumerable<T> enumeration, Action<T> action)
{
foreach (T item in enumeration)
{
@ -39,7 +41,8 @@ namespace Xamarin.Forms
}
}
internal static int IndexOf<T>(this IEnumerable<T> enumerable, T item)
[EditorBrowsable(EditorBrowsableState.Never)]
public static int IndexOf<T>(this IEnumerable<T> enumerable, T item)
{
if (enumerable == null)
throw new ArgumentNullException("enumerable");
@ -56,7 +59,8 @@ namespace Xamarin.Forms
return -1;
}
internal static int IndexOf<T>(this IEnumerable<T> enumerable, Func<T, bool> predicate)
[EditorBrowsable(EditorBrowsableState.Never)]
public static int IndexOf<T>(this IEnumerable<T> enumerable, Func<T, bool> predicate)
{
var i = 0;
foreach (T element in enumerable)
@ -70,7 +74,8 @@ namespace Xamarin.Forms
return -1;
}
internal static IEnumerable<T> Prepend<T>(this IEnumerable<T> enumerable, T item)
[EditorBrowsable(EditorBrowsableState.Never)]
public static IEnumerable<T> Prepend<T>(this IEnumerable<T> enumerable, T item)
{
yield return item;

Просмотреть файл

@ -1,8 +1,8 @@
using System;
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal class EventArg<T> : EventArgs
public class EventArg<T> : EventArgs
{
// Property variable

Просмотреть файл

@ -1,7 +1,10 @@
namespace Xamarin.Forms
using System.ComponentModel;
namespace Xamarin.Forms.Internals
{
internal abstract class ExpressionSearch
public abstract class ExpressionSearch
{
internal static IExpressionSearch Default { get; set; }
[EditorBrowsable(EditorBrowsableState.Never)]
public static IExpressionSearch Default { get; set; }
}
}

Просмотреть файл

@ -1,6 +1,6 @@
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal enum FileAccess
public enum FileAccess
{
Read = 0x00000001,
Write = 0x00000002,

Просмотреть файл

@ -1,6 +1,6 @@
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal enum FileMode
public enum FileMode
{
CreateNew = 1,
Create = 2,

Просмотреть файл

@ -1,9 +1,9 @@
using System;
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
[Flags]
internal enum FileShare
public enum FileShare
{
None = 0,
Read = 1,

Просмотреть файл

@ -1,3 +1,5 @@
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{
static class FontElement

Просмотреть файл

@ -7,7 +7,7 @@ using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{
public partial class Grid : Layout<View>
public partial class Grid : Layout<View>, IGridController
{
public static readonly BindableProperty RowProperty = BindableProperty.CreateAttached("Row", typeof(int), typeof(Grid), default(int), validateValue: (bindable, value) => (int)value >= 0);
@ -212,6 +212,11 @@ namespace Xamarin.Forms
view.ComputedConstraint = result;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public void InvalidateMeasureInernalNonVirtual(InvalidationTrigger trigger)
{
InvalidateMeasureInternal(trigger);
}
internal override void InvalidateMeasureInternal(InvalidationTrigger trigger)
{
base.InvalidateMeasureInternal(trigger);

Просмотреть файл

@ -1,3 +1,5 @@
using System.ComponentModel;
namespace Xamarin.Forms
{
public class HtmlWebViewSource : WebViewSource
@ -20,7 +22,8 @@ namespace Xamarin.Forms
set { SetValue(HtmlProperty, value); }
}
internal override void Load(IWebViewDelegate renderer)
[EditorBrowsable(EditorBrowsableState.Never)]
public override void Load(IWebViewDelegate renderer)
{
renderer.LoadHtml(Html, BaseUrl);
}

Просмотреть файл

@ -1,9 +1,9 @@
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal interface IDeserializer
public interface IDeserializer
{
Task<IDictionary<string, object>> DeserializePropertiesAsync();
Task SerializePropertiesAsync(IDictionary<string, object> properties);

Просмотреть файл

@ -1,4 +1,5 @@
using System;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{

Просмотреть файл

@ -1,4 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{
@ -11,5 +14,9 @@ namespace Xamarin.Forms
void SetValueFromRenderer(BindableProperty property, object value);
void SetValueFromRenderer(BindablePropertyKey propertyKey, object value);
ReadOnlyCollection<Element> LogicalChildren { get; }
IPlatform Platform { get; set; }
Element RealParent { get; }
IEnumerable<Element> Descendants();
event EventHandler PlatformSet;
}
}

Просмотреть файл

@ -1,9 +1,9 @@
using System.Collections.Generic;
using System.Linq.Expressions;
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal interface IExpressionSearch
public interface IExpressionSearch
{
List<T> FindObjects<T>(Expression expression) where T : class;
}

Просмотреть файл

@ -1,6 +1,6 @@
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
interface IFontElement
public interface IFontElement
{
//note to implementor: implement the properties publicly
FontAttributes FontAttributes { get; }

Просмотреть файл

@ -0,0 +1,9 @@
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{
public interface IGridController
{
void InvalidateMeasureInernalNonVirtual(InvalidationTrigger trigger);
}
}

Просмотреть файл

@ -2,9 +2,9 @@ using System;
using System.IO;
using System.Threading.Tasks;
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal interface IIsolatedStorageFile
public interface IIsolatedStorageFile
{
Task CreateDirectoryAsync(string path);
Task<bool> GetDirectoryExistsAsync(string path);

Просмотреть файл

@ -2,7 +2,7 @@ namespace Xamarin.Forms
{
public interface IMenuItemController
{
bool IsEnabled { get; }
bool IsEnabled { get; set; }
string IsEnabledPropertyName { get; }
void Activate();

Просмотреть файл

@ -0,0 +1,7 @@
namespace Xamarin.Forms
{
public interface IMultiPageController<T>
{
T GetPageByIndex(int index);
}
}

Просмотреть файл

@ -1,7 +1,7 @@
namespace Xamarin.Forms.Xaml
namespace Xamarin.Forms.Xaml.Internals
{
interface INativeBindingService
public interface INativeBindingService
{
bool TrySetBinding(object target, string propertyName, BindingBase binding);
bool TrySetBinding(object target, BindableProperty property, BindingBase binding);

Просмотреть файл

@ -1,8 +1,8 @@
using System;
namespace Xamarin.Forms.Xaml
namespace Xamarin.Forms.Xaml.Internals
{
interface INativeValueConverterService
public interface INativeValueConverterService
{
bool ConvertTo(object value, Type toType, out object nativeValue);
}

Просмотреть файл

@ -0,0 +1,7 @@
namespace Xamarin.Forms
{
public interface INavigationMenuController : IViewController
{
void SendTargetSelected(Page target);
}
}

Просмотреть файл

@ -1,6 +1,6 @@
namespace Xamarin.Forms
{
internal interface IPanGestureController
public interface IPanGestureController
{
void SendPan(Element sender, double totalX, double totalY, int gestureId);

Просмотреть файл

@ -1,6 +1,6 @@
namespace Xamarin.Forms
{
internal interface IPinchGestureController
public interface IPinchGestureController
{
bool IsPinching { get; set; }

Просмотреть файл

@ -1,6 +1,6 @@
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal interface IPlatform
public interface IPlatform
{
SizeRequest GetNativeSize(VisualElement view, double widthConstraint, double heightConstraint);
}

Просмотреть файл

@ -5,9 +5,9 @@ using System.Threading;
using System.Threading.Tasks;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal interface IPlatformServices
public interface IPlatformServices
{
bool IsInvokeRequired { get; }

Просмотреть файл

@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal interface IResourceDictionary : IEnumerable<KeyValuePair<string, object>>
public interface IResourceDictionary : IEnumerable<KeyValuePair<string, object>>
{
bool TryGetValue(string key, out object value);

Просмотреть файл

@ -1,6 +1,6 @@
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal interface ISystemResourcesProvider
public interface ISystemResourcesProvider
{
IResourceDictionary GetSystemResources();
}

Просмотреть файл

@ -1,4 +1,6 @@
using System;
using Xamarin.Forms.Internals;
using static Xamarin.Forms.VisualElement;
namespace Xamarin.Forms
{
@ -6,5 +8,13 @@ namespace Xamarin.Forms
{
void NativeSizeChanged();
void InvalidateMeasure(InvalidationTrigger trigger);
bool Batched { get; }
bool DisableLayout { get; set; }
bool IsInNativeLayout { get; set; }
bool IsNativeStateConsistent { get; set; }
bool IsPlatformEnabled { get; set; }
NavigationProxy NavigationProxy { get; }
event EventHandler<EventArg<VisualElement>> BatchCommitted;
event EventHandler<FocusRequestArgs> FocusChangeRequested;
}
}

Просмотреть файл

@ -0,0 +1,16 @@
using System;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{
public interface IWebViewController : IViewController
{
bool CanGoBack { get; set; }
bool CanGoForward { get; set; }
event EventHandler<EvalRequested> EvalRequested;
event EventHandler GoBackRequested;
event EventHandler GoForwardRequested;
void SendNavigated(WebNavigatedEventArgs args);
void SendNavigating(WebNavigatingEventArgs args);
}
}

Просмотреть файл

@ -3,6 +3,7 @@ using System.IO;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{

Просмотреть файл

@ -1,4 +1,5 @@
using System;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{

Просмотреть файл

@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{

Просмотреть файл

@ -1,6 +1,6 @@
namespace Xamarin.Forms.Internals
{
internal static class EffectUtilities
public static class EffectUtilities
{
public static void RegisterEffectControlProvider(IEffectControlProvider self, IElementController oldElement, IElementController newElement)
{

Просмотреть файл

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
@ -14,7 +15,7 @@ namespace Xamarin.Forms.Internals
int _count;
bool _enabled;
internal Ticker()
protected Ticker()
{
_count = 0;
_timeouts = new List<Tuple<int, Func<long, bool>>>();
@ -22,6 +23,8 @@ namespace Xamarin.Forms.Internals
_stopwatch = new Stopwatch();
}
[EditorBrowsable(EditorBrowsableState.Never)]
public static void SetDefault(Ticker ticker) => Default = ticker;
public static Ticker Default
{
internal set { s_ticker = value; }

Просмотреть файл

@ -1,4 +1,5 @@
using System.Collections;
using System.ComponentModel;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
@ -49,7 +50,8 @@ namespace Xamarin.Forms
ITemplatedItemsList<TVisual> ITemplatedItemsView<TVisual>.TemplatedItems { get { return TemplatedItems; } }
internal TemplatedItemsList<ItemsView<TVisual>, TVisual> TemplatedItems { get; }
[EditorBrowsable(EditorBrowsableState.Never)]
public TemplatedItemsList<ItemsView<TVisual>, TVisual> TemplatedItems { get; }
TVisual IItemsView<TVisual>.CreateDefault(object item)
{

Просмотреть файл

@ -1,3 +1,5 @@
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{
[TypeConverter(typeof(KeyboardTypeConverter))]

Просмотреть файл

@ -1,6 +1,7 @@
using System;
using System.Linq;
using System.Reflection;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{

Просмотреть файл

@ -1,6 +1,7 @@
using System;
using System.Linq;
using System.Reflection;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{

Просмотреть файл

@ -1,8 +1,10 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Windows.Input;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Platform;
namespace Xamarin.Forms
@ -210,7 +212,8 @@ namespace Xamarin.Forms
set { SetValue(SeparatorVisibilityProperty, value); }
}
internal ListViewCachingStrategy CachingStrategy { get; private set; }
[EditorBrowsable(EditorBrowsableState.Never)]
public ListViewCachingStrategy CachingStrategy { get; private set; }
ListViewCachingStrategy IListViewController.CachingStrategy
{
get

Просмотреть файл

@ -0,0 +1,131 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Platform;
namespace Xamarin.Forms.Internals
{
public class LockableObservableListWrapper : IList<string>, ICollection<string>, INotifyCollectionChanged, INotifyPropertyChanged, IReadOnlyList<string>, IReadOnlyCollection<string>, IEnumerable<string>, IEnumerable
{
public readonly ObservableCollection<string> _list = new ObservableCollection<string>();
event NotifyCollectionChangedEventHandler INotifyCollectionChanged.CollectionChanged
{
add { ((INotifyCollectionChanged)_list).CollectionChanged += value; }
remove { ((INotifyCollectionChanged)_list).CollectionChanged -= value; }
}
event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged {
add { ((INotifyPropertyChanged)_list).PropertyChanged += value; }
remove { ((INotifyPropertyChanged)_list).PropertyChanged -= value; }
}
public bool IsLocked { get; set; }
void ThrowOnLocked()
{
if (IsLocked)
throw new InvalidOperationException("The Items list can not be manipulated if the ItemsSource property is set");
}
public string this [int index] {
get { return _list [index]; }
set {
ThrowOnLocked();
_list [index] = value; }
}
public int Count {
get { return _list.Count; }
}
public bool IsReadOnly {
get { return ((IList<string>)_list).IsReadOnly; }
}
public void InternalAdd(string item)
{
_list.Add(item);
}
public void Add(string item)
{
ThrowOnLocked();
InternalAdd(item);
}
public void InternalClear()
{
_list.Clear();
}
public void Clear()
{
ThrowOnLocked();
InternalClear();
}
public bool Contains(string item)
{
return _list.Contains(item);
}
public void CopyTo(string [] array, int arrayIndex)
{
_list.CopyTo(array, arrayIndex);
}
public IEnumerator<string> GetEnumerator()
{
return _list.GetEnumerator();
}
public int IndexOf(string item)
{
return _list.IndexOf(item);
}
public void InternalInsert(int index, string item)
{
_list.Insert(index, item);
}
public void Insert(int index, string item)
{
ThrowOnLocked();
InternalInsert(index, item);
}
public bool InternalRemove(string item)
{
return _list.Remove(item);
}
public bool Remove(string item)
{
ThrowOnLocked();
return InternalRemove(item);
}
public void InternalRemoveAt(int index)
{
_list.RemoveAt(index);
}
public void RemoveAt(int index)
{
ThrowOnLocked();
InternalRemoveAt(index);
}
IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable)_list).GetEnumerator();
}
}
}

Просмотреть файл

@ -1,8 +1,8 @@
using System.Collections.Generic;
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal static class Log
public static class Log
{
static Log()
{

Просмотреть файл

@ -1,6 +1,6 @@
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal abstract class LogListener
public abstract class LogListener
{
public abstract void Warning(string category, string message);
}

Просмотреть файл

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Platform;
namespace Xamarin.Forms

Просмотреть файл

@ -1,4 +1,5 @@
using System;
using System.ComponentModel;
using System.Windows.Input;
namespace Xamarin.Forms
@ -17,7 +18,8 @@ namespace Xamarin.Forms
public static readonly BindableProperty IconProperty = BindableProperty.Create("Icon", typeof(FileImageSource), typeof(MenuItem), default(FileImageSource));
internal static readonly BindableProperty IsEnabledProperty = BindableProperty.Create("IsEnabled", typeof(bool), typeof(ToolbarItem), true);
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty IsEnabledProperty = BindableProperty.Create("IsEnabled", typeof(bool), typeof(ToolbarItem), true);
string IMenuItemController.IsEnabledPropertyName
{
@ -57,20 +59,13 @@ namespace Xamarin.Forms
set { SetValue(TextProperty, value); }
}
internal bool IsEnabled
[EditorBrowsable(EditorBrowsableState.Never)]
public bool IsEnabled
{
get { return (bool)GetValue(IsEnabledProperty); }
set { SetValue(IsEnabledProperty, value); }
}
bool IMenuItemController.IsEnabled
{
get
{
return IsEnabled;
}
}
bool IsEnabledCore
{
set { SetValueCore(IsEnabledProperty, value); }

Просмотреть файл

@ -3,13 +3,15 @@ using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms
{
[ContentProperty("Children")]
public abstract class MultiPage<T> : Page, IViewContainer<T>, IPageContainer<T>, IItemsView<T> where T : Page
public abstract class MultiPage<T> : Page, IViewContainer<T>, IPageContainer<T>, IItemsView<T>, IMultiPageController<T> where T : Page
{
public static readonly BindableProperty ItemsSourceProperty = BindableProperty.Create("ItemsSource", typeof(IEnumerable), typeof(MultiPage<>), null);
@ -159,7 +161,8 @@ namespace Xamarin.Forms
{
}
internal static int GetIndex(T page)
[EditorBrowsable(EditorBrowsableState.Never)]
public static int GetIndex(T page)
{
if (page == null)
throw new ArgumentNullException("page");
@ -167,7 +170,8 @@ namespace Xamarin.Forms
return (int)page.GetValue(IndexProperty);
}
internal T GetPageByIndex(int index)
[EditorBrowsable(EditorBrowsableState.Never)]
public T GetPageByIndex(int index)
{
foreach (T page in InternalChildren)
{
@ -177,7 +181,8 @@ namespace Xamarin.Forms
return null;
}
internal static void SetIndex(Page page, int index)
[EditorBrowsable(EditorBrowsableState.Never)]
public static void SetIndex(Page page, int index)
{
if (page == null)
throw new ArgumentNullException("page");

Просмотреть файл

@ -8,10 +8,11 @@ using Xamarin.Forms.Internals;
using static System.String;
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
static class NativeBindingHelpers
public static class NativeBindingHelpers
{
[EditorBrowsable(EditorBrowsableState.Never)]
public static void SetBinding<TNativeView>(TNativeView target, string targetProperty, BindingBase bindingBase, string updateSourceEventName = null) where TNativeView : class
{
var binding = bindingBase as Binding;
@ -25,7 +26,8 @@ namespace Xamarin.Forms
SetBinding(target, targetProperty, bindingBase, eventWrapper);
}
internal static void SetBinding<TNativeView>(TNativeView target, string targetProperty, BindingBase bindingBase, INotifyPropertyChanged propertyChanged) where TNativeView : class
[EditorBrowsable(EditorBrowsableState.Never)]
public static void SetBinding<TNativeView>(TNativeView target, string targetProperty, BindingBase bindingBase, INotifyPropertyChanged propertyChanged) where TNativeView : class
{
if (target == null)
throw new ArgumentNullException(nameof(target));
@ -93,6 +95,7 @@ namespace Xamarin.Forms
bindable.SetValueCore(property, value);
}
[EditorBrowsable(EditorBrowsableState.Never)]
public static void SetBinding<TNativeView>(TNativeView target, BindableProperty targetProperty, BindingBase binding) where TNativeView : class
{
if (target == null)
@ -106,6 +109,7 @@ namespace Xamarin.Forms
proxy.BindingsBackpack.Add(new KeyValuePair<BindableProperty, BindingBase>(targetProperty, binding));
}
[EditorBrowsable(EditorBrowsableState.Never)]
public static void SetValue<TNativeView>(TNativeView target, BindableProperty targetProperty, object value) where TNativeView : class
{
if (target == null)
@ -117,6 +121,7 @@ namespace Xamarin.Forms
proxy.ValuesBackpack.Add(new KeyValuePair<BindableProperty, object>(targetProperty, value));
}
[EditorBrowsable(EditorBrowsableState.Never)]
public static void SetBindingContext<TNativeView>(TNativeView target, object bindingContext, Func<TNativeView, IEnumerable<TNativeView>> getChild = null) where TNativeView : class
{
if (target == null)
@ -134,7 +139,8 @@ namespace Xamarin.Forms
SetBindingContext(child, bindingContext, getChild);
}
internal static void TransferBindablePropertiesToWrapper<TNativeView, TNativeWrapper>(TNativeView nativeView, TNativeWrapper wrapper)
[EditorBrowsable(EditorBrowsableState.Never)]
public static void TransferBindablePropertiesToWrapper<TNativeView, TNativeWrapper>(TNativeView nativeView, TNativeWrapper wrapper)
where TNativeView : class
where TNativeWrapper : View
{

Просмотреть файл

@ -3,11 +3,11 @@ using System.Collections.Generic;
using System.Linq;
using Xamarin.Forms.Platform;
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
// Mark as internal until renderers are ready for release after 1.0
[RenderWith(typeof(_NavigationMenuRenderer))]
internal class NavigationMenu : View, IElementConfiguration<NavigationMenu>
public class NavigationMenu : View, INavigationMenuController, IElementConfiguration<NavigationMenu>
{
readonly List<Page> _targets = new List<Page>();
@ -64,12 +64,7 @@ namespace Xamarin.Forms
return _platformConfigurationRegistry.Value.On<T>();
}
internal void SendTargetSelected(Page target)
{
TargetSelected(target);
}
void TargetSelected(Page target)
void INavigationMenuController.SendTargetSelected(Page target)
{
Navigation.PushAsync(target);
}

Просмотреть файл

@ -2,9 +2,9 @@ using System;
using System.Collections.Generic;
using System.Linq;
namespace Xamarin.Forms
namespace Xamarin.Forms.Internals
{
internal class NavigationModel
public class NavigationModel
{
readonly List<Page> _modalStack = new List<Page>();
readonly List<List<Page>> _navTree = new List<List<Page>>();

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше