summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WinRT
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.WinRT')
-rw-r--r--Xamarin.Forms.Platform.WinRT/ButtonRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.WinRT/EditorRenderer.cs1
-rw-r--r--Xamarin.Forms.Platform.WinRT/EntryRenderer.cs1
-rw-r--r--Xamarin.Forms.Platform.WinRT/FontExtensions.cs1
-rw-r--r--Xamarin.Forms.Platform.WinRT/FrameworkElementExtensions.cs3
-rw-r--r--Xamarin.Forms.Platform.WinRT/ImageConverter.cs2
-rw-r--r--Xamarin.Forms.Platform.WinRT/NativeBindingExtensions.cs1
-rw-r--r--Xamarin.Forms.Platform.WinRT/NativeEventWrapper.cs1
-rw-r--r--Xamarin.Forms.Platform.WinRT/PickerRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.WinRT/PlatformWinRT.cs1
-rw-r--r--Xamarin.Forms.Platform.WinRT/UriImageSourceHandler.cs1
-rw-r--r--Xamarin.Forms.Platform.WinRT/VisualElementRenderer.cs4
-rw-r--r--Xamarin.Forms.Platform.WinRT/VisualElementTracker.cs1
-rw-r--r--Xamarin.Forms.Platform.WinRT/WebViewRenderer.cs23
-rw-r--r--Xamarin.Forms.Platform.WinRT/WindowsBasePage.cs2
-rw-r--r--Xamarin.Forms.Platform.WinRT/WindowsDeviceInfo.cs1
-rw-r--r--Xamarin.Forms.Platform.WinRT/WindowsExpressionSearch.cs3
-rw-r--r--Xamarin.Forms.Platform.WinRT/WindowsIsolatedStorage.cs25
-rw-r--r--Xamarin.Forms.Platform.WinRT/WindowsSerializer.cs1
19 files changed, 46 insertions, 30 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/ButtonRenderer.cs b/Xamarin.Forms.Platform.WinRT/ButtonRenderer.cs
index acc41db..1b3960e 100644
--- a/Xamarin.Forms.Platform.WinRT/ButtonRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/ButtonRenderer.cs
@@ -155,7 +155,7 @@ namespace Xamarin.Forms.Platform.WinRT
bmp.ImageOpened += (sender, args) => {
image.Width = bmp.PixelWidth;
image.Height = bmp.PixelHeight;
- Element.InvalidateMeasureInternal(InvalidationTrigger.RendererReady);
+ Element.InvalidateMeasureNonVirtual(InvalidationTrigger.RendererReady);
};
// No text, just the image
diff --git a/Xamarin.Forms.Platform.WinRT/EditorRenderer.cs b/Xamarin.Forms.Platform.WinRT/EditorRenderer.cs
index c69debd..e67b9d9 100644
--- a/Xamarin.Forms.Platform.WinRT/EditorRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/EditorRenderer.cs
@@ -2,6 +2,7 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
+using Xamarin.Forms.Internals;
#if WINDOWS_UWP
diff --git a/Xamarin.Forms.Platform.WinRT/EntryRenderer.cs b/Xamarin.Forms.Platform.WinRT/EntryRenderer.cs
index c6e439e..a02b11c 100644
--- a/Xamarin.Forms.Platform.WinRT/EntryRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/EntryRenderer.cs
@@ -5,6 +5,7 @@ using Windows.Foundation.Metadata;
using Windows.System;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
+using Xamarin.Forms.Internals;
#if WINDOWS_UWP
diff --git a/Xamarin.Forms.Platform.WinRT/FontExtensions.cs b/Xamarin.Forms.Platform.WinRT/FontExtensions.cs
index 069a997..bdd7277 100644
--- a/Xamarin.Forms.Platform.WinRT/FontExtensions.cs
+++ b/Xamarin.Forms.Platform.WinRT/FontExtensions.cs
@@ -3,6 +3,7 @@ using Windows.UI.Text;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Documents;
using Windows.UI.Xaml.Media;
+using Xamarin.Forms.Internals;
using WApplication = Windows.UI.Xaml.Application;
#if WINDOWS_UWP
diff --git a/Xamarin.Forms.Platform.WinRT/FrameworkElementExtensions.cs b/Xamarin.Forms.Platform.WinRT/FrameworkElementExtensions.cs
index 6affa16..a16c634 100644
--- a/Xamarin.Forms.Platform.WinRT/FrameworkElementExtensions.cs
+++ b/Xamarin.Forms.Platform.WinRT/FrameworkElementExtensions.cs
@@ -6,6 +6,7 @@ using System.Reflection;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
+using Xamarin.Forms.Internals;
using WBinding = Windows.UI.Xaml.Data.Binding;
using WBindingExpression = Windows.UI.Xaml.Data.BindingExpression;
@@ -117,7 +118,7 @@ namespace Xamarin.Forms.Platform.WinRT
DependencyProperty foregroundProperty;
if (!ForegroundProperties.Value.TryGetValue(type, out foregroundProperty))
{
- FieldInfo field = type.GetFields().FirstOrDefault(f => f.Name == "ForegroundProperty");
+ FieldInfo field = ReflectionExtensions.GetFields(type).FirstOrDefault(f => f.Name == "ForegroundProperty");
if (field == null)
throw new ArgumentException("type is not a Foregroundable type");
diff --git a/Xamarin.Forms.Platform.WinRT/ImageConverter.cs b/Xamarin.Forms.Platform.WinRT/ImageConverter.cs
index e111be4..014c479 100644
--- a/Xamarin.Forms.Platform.WinRT/ImageConverter.cs
+++ b/Xamarin.Forms.Platform.WinRT/ImageConverter.cs
@@ -16,7 +16,7 @@ namespace Xamarin.Forms.Platform.WinRT
var source = (ImageSource)value;
IImageSourceHandler handler;
- if (source != null && (handler = Registrar.Registered.GetHandler<IImageSourceHandler>(source.GetType())) != null)
+ if (source != null && (handler = Internals.Registrar.Registered.GetHandler<IImageSourceHandler>(source.GetType())) != null)
{
Task<Windows.UI.Xaml.Media.ImageSource> task = handler.LoadImageAsync(source);
return new AsyncValue<Windows.UI.Xaml.Media.ImageSource>(task, null);
diff --git a/Xamarin.Forms.Platform.WinRT/NativeBindingExtensions.cs b/Xamarin.Forms.Platform.WinRT/NativeBindingExtensions.cs
index cc88c87..a3c9261 100644
--- a/Xamarin.Forms.Platform.WinRT/NativeBindingExtensions.cs
+++ b/Xamarin.Forms.Platform.WinRT/NativeBindingExtensions.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel;
using Windows.UI.Xaml;
+using Xamarin.Forms.Internals;
using static System.String;
#if WINDOWS_UWP
diff --git a/Xamarin.Forms.Platform.WinRT/NativeEventWrapper.cs b/Xamarin.Forms.Platform.WinRT/NativeEventWrapper.cs
index e28ca0e..d810d79 100644
--- a/Xamarin.Forms.Platform.WinRT/NativeEventWrapper.cs
+++ b/Xamarin.Forms.Platform.WinRT/NativeEventWrapper.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.UI.Xaml;
+using Xamarin.Forms.Internals;
#if WINDOWS_UWP
namespace Xamarin.Forms.Platform.UWP
diff --git a/Xamarin.Forms.Platform.WinRT/PickerRenderer.cs b/Xamarin.Forms.Platform.WinRT/PickerRenderer.cs
index 432b1d4..a7aa16f 100644
--- a/Xamarin.Forms.Platform.WinRT/PickerRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/PickerRenderer.cs
@@ -53,7 +53,7 @@ namespace Xamarin.Forms.Platform.WinRT
Control.Loaded += ControlOnLoaded;
}
- Control.ItemsSource = ((Picker.LockableObservableListWrapper)Element.Items)._list;
+ Control.ItemsSource = ((LockableObservableListWrapper)Element.Items)._list;
UpdateTitle();
UpdateSelectedIndex();
diff --git a/Xamarin.Forms.Platform.WinRT/PlatformWinRT.cs b/Xamarin.Forms.Platform.WinRT/PlatformWinRT.cs
index 5e11c8d..df43345 100644
--- a/Xamarin.Forms.Platform.WinRT/PlatformWinRT.cs
+++ b/Xamarin.Forms.Platform.WinRT/PlatformWinRT.cs
@@ -7,6 +7,7 @@ using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Animation;
+using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Platform.WinRT
{
diff --git a/Xamarin.Forms.Platform.WinRT/UriImageSourceHandler.cs b/Xamarin.Forms.Platform.WinRT/UriImageSourceHandler.cs
index 1263c35..9050c6e 100644
--- a/Xamarin.Forms.Platform.WinRT/UriImageSourceHandler.cs
+++ b/Xamarin.Forms.Platform.WinRT/UriImageSourceHandler.cs
@@ -5,6 +5,7 @@ using System.Threading;
using System.Threading.Tasks;
using Windows.Storage.Streams;
using Windows.UI.Xaml.Media.Imaging;
+using Xamarin.Forms.Internals;
#if WINDOWS_UWP
diff --git a/Xamarin.Forms.Platform.WinRT/VisualElementRenderer.cs b/Xamarin.Forms.Platform.WinRT/VisualElementRenderer.cs
index 402d1da..9c3a4c9 100644
--- a/Xamarin.Forms.Platform.WinRT/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/VisualElementRenderer.cs
@@ -309,8 +309,8 @@ namespace Xamarin.Forms.Platform.WinRT
protected virtual void OnRegisterEffect(PlatformEffect effect)
{
- effect.Container = this;
- effect.Control = Control;
+ effect.SetContainer(this);
+ effect.SetControl(Control);
}
protected virtual void SetAutomationId(string id)
diff --git a/Xamarin.Forms.Platform.WinRT/VisualElementTracker.cs b/Xamarin.Forms.Platform.WinRT/VisualElementTracker.cs
index 760b9b3..e8684ff 100644
--- a/Xamarin.Forms.Platform.WinRT/VisualElementTracker.cs
+++ b/Xamarin.Forms.Platform.WinRT/VisualElementTracker.cs
@@ -7,6 +7,7 @@ using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
+using Xamarin.Forms.Internals;
#if WINDOWS_UWP
diff --git a/Xamarin.Forms.Platform.WinRT/WebViewRenderer.cs b/Xamarin.Forms.Platform.WinRT/WebViewRenderer.cs
index e3fcb89..c768bb5 100644
--- a/Xamarin.Forms.Platform.WinRT/WebViewRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/WebViewRenderer.cs
@@ -31,6 +31,7 @@ var bases = head.getElementsByTagName('base');
if(bases.length == 0){
head.innerHTML = 'baseTag' + head.innerHTML;
}";
+ IWebViewController ElementController => Element;
public void LoadHtml(string html, string baseUrl)
{
@@ -98,9 +99,10 @@ if(bases.length == 0){
if (e.OldElement != null)
{
- e.OldElement.EvalRequested -= OnEvalRequested;
- e.OldElement.GoBackRequested -= OnGoBackRequested;
- e.OldElement.GoForwardRequested -= OnGoForwardRequested;
+ var oldElementController = e.OldElement as IWebViewController;
+ oldElementController.EvalRequested -= OnEvalRequested;
+ oldElementController.GoBackRequested -= OnGoBackRequested;
+ oldElementController.GoForwardRequested -= OnGoForwardRequested;
}
if (e.NewElement != null)
@@ -114,9 +116,10 @@ if(bases.length == 0){
SetNativeControl(webView);
}
- e.NewElement.EvalRequested += OnEvalRequested;
- e.NewElement.GoForwardRequested += OnGoForwardRequested;
- e.NewElement.GoBackRequested += OnGoBackRequested;
+ var newElementController = e.NewElement as IWebViewController;
+ newElementController.EvalRequested += OnEvalRequested;
+ newElementController.GoForwardRequested += OnGoForwardRequested;
+ newElementController.GoBackRequested += OnGoBackRequested;
Load();
}
@@ -190,7 +193,7 @@ if(bases.length == 0){
{
var args = new WebNavigatingEventArgs(_eventState, new UrlWebViewSource { Url = uri.AbsoluteUri }, uri.AbsoluteUri);
- Element.SendNavigating(args);
+ ElementController.SendNavigating(args);
e.Cancel = args.Cancel;
// reset in this case because this is the last event we will get
@@ -205,7 +208,7 @@ if(bases.length == 0){
((IElementController)Element).SetValueFromRenderer(WebView.SourceProperty, source);
_updating = false;
- Element.SendNavigated(new WebNavigatedEventArgs(evnt, source, source.Url, result));
+ ElementController.SendNavigated(new WebNavigatedEventArgs(evnt, source, source.Url, result));
UpdateCanGoBackForward();
_eventState = WebNavigationEvent.NewPage;
@@ -213,8 +216,8 @@ if(bases.length == 0){
void UpdateCanGoBackForward()
{
- Element.CanGoBack = Control.CanGoBack;
- Element.CanGoForward = Control.CanGoForward;
+ ElementController.CanGoBack = Control.CanGoBack;
+ ElementController.CanGoForward = Control.CanGoForward;
}
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.WinRT/WindowsBasePage.cs b/Xamarin.Forms.Platform.WinRT/WindowsBasePage.cs
index e1700a8..c8b3bda 100644
--- a/Xamarin.Forms.Platform.WinRT/WindowsBasePage.cs
+++ b/Xamarin.Forms.Platform.WinRT/WindowsBasePage.cs
@@ -30,7 +30,7 @@ namespace Xamarin.Forms.Platform.WinRT
if (application == null)
throw new ArgumentNullException("application");
- Application.Current = application;
+ Application.SetCurrentApplication(application);
Platform = CreatePlatform();
Platform.SetPage(Application.Current.MainPage);
application.PropertyChanged += OnApplicationPropertyChanged;
diff --git a/Xamarin.Forms.Platform.WinRT/WindowsDeviceInfo.cs b/Xamarin.Forms.Platform.WinRT/WindowsDeviceInfo.cs
index 235fe2d..07cb847 100644
--- a/Xamarin.Forms.Platform.WinRT/WindowsDeviceInfo.cs
+++ b/Xamarin.Forms.Platform.WinRT/WindowsDeviceInfo.cs
@@ -2,6 +2,7 @@
using Windows.Foundation;
using Windows.Graphics.Display;
using Windows.UI.Xaml;
+using Xamarin.Forms.Internals;
#if WINDOWS_UWP
diff --git a/Xamarin.Forms.Platform.WinRT/WindowsExpressionSearch.cs b/Xamarin.Forms.Platform.WinRT/WindowsExpressionSearch.cs
index 778cc13..417b23e 100644
--- a/Xamarin.Forms.Platform.WinRT/WindowsExpressionSearch.cs
+++ b/Xamarin.Forms.Platform.WinRT/WindowsExpressionSearch.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
+using Xamarin.Forms.Internals;
#if WINDOWS_UWP
@@ -159,7 +160,7 @@ namespace Xamarin.Forms.Platform.WinRT
object container = ((ConstantExpression)member.Expression).Value;
object value = ((FieldInfo)member.Member).GetValue(container);
- if (_targeType.IsInstanceOfType(value))
+ if (ReflectionExtensions.IsInstanceOfType(_targeType, value))
{
_results.Add(value);
}
diff --git a/Xamarin.Forms.Platform.WinRT/WindowsIsolatedStorage.cs b/Xamarin.Forms.Platform.WinRT/WindowsIsolatedStorage.cs
index a6e48fe..42bdc3b 100644
--- a/Xamarin.Forms.Platform.WinRT/WindowsIsolatedStorage.cs
+++ b/Xamarin.Forms.Platform.WinRT/WindowsIsolatedStorage.cs
@@ -4,6 +4,7 @@ using System.Threading.Tasks;
using Windows.Storage;
using Windows.Storage.FileProperties;
using Windows.Storage.Streams;
+using Xamarin.Forms.Internals;
#if WINDOWS_UWP
@@ -63,27 +64,27 @@ namespace Xamarin.Forms.Platform.WinRT
return properties.DateModified;
}
- public async Task<Stream> OpenFileAsync(string path, FileMode mode, FileAccess access)
+ public async Task<Stream> OpenFileAsync(string path, Internals.FileMode mode, Internals.FileAccess access)
{
StorageFile file;
switch (mode)
{
- case FileMode.CreateNew:
+ case Internals.FileMode.CreateNew:
file = await _folder.CreateFileAsync(path, CreationCollisionOption.FailIfExists).AsTask().ConfigureAwait(false);
break;
- case FileMode.Create:
- case FileMode.Truncate: // TODO See if ReplaceExisting already truncates
+ case Internals.FileMode.Create:
+ case Internals.FileMode.Truncate: // TODO See if ReplaceExisting already truncates
file = await _folder.CreateFileAsync(path, CreationCollisionOption.ReplaceExisting).AsTask().ConfigureAwait(false);
break;
- case FileMode.OpenOrCreate:
- case FileMode.Append:
+ case Internals.FileMode.OpenOrCreate:
+ case Internals.FileMode.Append:
file = await _folder.CreateFileAsync(path, CreationCollisionOption.OpenIfExists).AsTask().ConfigureAwait(false);
break;
- case FileMode.Open:
+ case Internals.FileMode.Open:
file = await _folder.GetFileAsync(path);
break;
@@ -93,16 +94,16 @@ namespace Xamarin.Forms.Platform.WinRT
switch (access)
{
- case FileAccess.Read:
+ case Internals.FileAccess.Read:
return await file.OpenStreamForReadAsync().ConfigureAwait(false);
- case FileAccess.Write:
+ case Internals.FileAccess.Write:
Stream stream = await file.OpenStreamForWriteAsync().ConfigureAwait(false);
- if (mode == FileMode.Append)
+ if (mode == Internals.FileMode.Append)
stream.Position = stream.Length;
return stream;
- case FileAccess.ReadWrite:
+ case Internals.FileAccess.ReadWrite:
IRandomAccessStream randStream = await file.OpenAsync(FileAccessMode.ReadWrite).AsTask().ConfigureAwait(false);
return randStream.AsStream();
@@ -111,7 +112,7 @@ namespace Xamarin.Forms.Platform.WinRT
}
}
- 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)
{
return OpenFileAsync(path, mode, access);
}
diff --git a/Xamarin.Forms.Platform.WinRT/WindowsSerializer.cs b/Xamarin.Forms.Platform.WinRT/WindowsSerializer.cs
index 0eeb2f8..834483d 100644
--- a/Xamarin.Forms.Platform.WinRT/WindowsSerializer.cs
+++ b/Xamarin.Forms.Platform.WinRT/WindowsSerializer.cs
@@ -5,6 +5,7 @@ using System.IO;
using System.Runtime.Serialization;
using System.Threading.Tasks;
using Windows.Storage;
+using Xamarin.Forms.Internals;
#if WINDOWS_UWP