summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xamarin.Forms.Core.UnitTests/ImageTests.cs4
-rw-r--r--Xamarin.Forms.Core/IImageController.cs7
-rw-r--r--Xamarin.Forms.Core/Image.cs7
-rw-r--r--Xamarin.Forms.Core/Xamarin.Forms.Core.csproj1
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/ImageRenderer.cs4
-rw-r--r--Xamarin.Forms.Platform.WP8/ImageRenderer.cs4
-rw-r--r--Xamarin.Forms.Platform.WinRT/ImageRenderer.cs4
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs5
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/IImageController.xml34
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/Image.xml29
10 files changed, 85 insertions, 14 deletions
diff --git a/Xamarin.Forms.Core.UnitTests/ImageTests.cs b/Xamarin.Forms.Core.UnitTests/ImageTests.cs
index 1e2546db..1e14eb3c 100644
--- a/Xamarin.Forms.Core.UnitTests/ImageTests.cs
+++ b/Xamarin.Forms.Core.UnitTests/ImageTests.cs
@@ -249,9 +249,9 @@ namespace Xamarin.Forms.Core.UnitTests
{
if (initialLoad && Element.Source != null) {
initialLoad = false;
- ((IElementController)Element).SetValueFromRenderer (Image.IsLoadingPropertyKey, true);
+ ((IImageController)Element).SetIsLoading(true);
await (Element.Source as UriImageSource).GetStreamAsync ();
- ((IElementController)Element).SetValueFromRenderer (Image.IsLoadingPropertyKey, false);
+ ((IImageController)Element).SetIsLoading(false);
}
}
diff --git a/Xamarin.Forms.Core/IImageController.cs b/Xamarin.Forms.Core/IImageController.cs
new file mode 100644
index 00000000..8dce107a
--- /dev/null
+++ b/Xamarin.Forms.Core/IImageController.cs
@@ -0,0 +1,7 @@
+namespace Xamarin.Forms
+{
+ public interface IImageController
+ {
+ void SetIsLoading(bool isLoading);
+ }
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Core/Image.cs b/Xamarin.Forms.Core/Image.cs
index 9e329331..4528f3b9 100644
--- a/Xamarin.Forms.Core/Image.cs
+++ b/Xamarin.Forms.Core/Image.cs
@@ -4,7 +4,7 @@ using Xamarin.Forms.Platform;
namespace Xamarin.Forms
{
[RenderWith(typeof(_ImageRenderer))]
- public class Image : View
+ public class Image : View, IImageController
{
public static readonly BindableProperty SourceProperty = BindableProperty.Create("Source", typeof(ImageSource), typeof(Image), default(ImageSource), propertyChanging: OnSourcePropertyChanging,
propertyChanged: OnSourcePropertyChanged);
@@ -141,5 +141,10 @@ namespace Xamarin.Forms
oldvalue.SourceChanged -= OnSourceChanged;
await oldvalue.Cancel();
}
+
+ void IImageController.SetIsLoading(bool isLoading)
+ {
+ SetValue(IsLoadingPropertyKey, isLoading);
+ }
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
index ef4da083..1deca238 100644
--- a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
+++ b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
@@ -93,6 +93,7 @@
<Compile Include="ElementTemplate.cs" />
<Compile Include="EmailKeyboard.cs" />
<Compile Include="IEntryController.cs" />
+ <Compile Include="IImageController.cs" />
<Compile Include="Internals\EvalRequested.cs" />
<Compile Include="ExportEffectAttribute.cs" />
<Compile Include="ExpressionSearch.cs" />
diff --git a/Xamarin.Forms.Platform.Android/Renderers/ImageRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/ImageRenderer.cs
index be57b002..fb51f158 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/ImageRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/ImageRenderer.cs
@@ -69,7 +69,7 @@ namespace Xamarin.Forms.Platform.Android
if (previous != null && Equals(previous.Source, Element.Source))
return;
- ((IElementController)Element).SetValueFromRenderer(Image.IsLoadingPropertyKey, true);
+ ((IImageController)Element).SetIsLoading(true);
var formsImageView = Control as FormsImageView;
if (formsImageView != null)
@@ -101,7 +101,7 @@ namespace Xamarin.Forms.Platform.Android
if (bitmap != null)
bitmap.Dispose();
- ((IElementController)Element).SetValueFromRenderer(Image.IsLoadingPropertyKey, false);
+ ((IImageController)Element).SetIsLoading(false);
((IVisualElementController)Element).NativeSizeChanged();
}
}
diff --git a/Xamarin.Forms.Platform.WP8/ImageRenderer.cs b/Xamarin.Forms.Platform.WP8/ImageRenderer.cs
index ba0649fb..e0574095 100644
--- a/Xamarin.Forms.Platform.WP8/ImageRenderer.cs
+++ b/Xamarin.Forms.Platform.WP8/ImageRenderer.cs
@@ -76,7 +76,7 @@ namespace Xamarin.Forms.Platform.WinPhone
async void SetSource(System.Windows.Controls.Image image)
{
- ((IElementController)Element).SetValueFromRenderer(Image.IsLoadingPropertyKey, true);
+ ((IImageController)Element).SetIsLoading(true);
ImageSource source = Element.Source;
IImageSourceHandler handler;
@@ -100,7 +100,7 @@ namespace Xamarin.Forms.Platform.WinPhone
else
image.Source = null;
- ((IElementController)Element).SetValueFromRenderer(Image.IsLoadingPropertyKey, false);
+ ((IImageController)Element).SetIsLoading(false);
}
}
diff --git a/Xamarin.Forms.Platform.WinRT/ImageRenderer.cs b/Xamarin.Forms.Platform.WinRT/ImageRenderer.cs
index 47c674c7..29368aaf 100644
--- a/Xamarin.Forms.Platform.WinRT/ImageRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/ImageRenderer.cs
@@ -100,7 +100,7 @@ namespace Xamarin.Forms.Platform.WinRT
async void UpdateSource()
{
- Element.SetValueCore(Image.IsLoadingPropertyKey, true);
+ ((IImageController)Element).SetIsLoading(true);
ImageSource source = Element.Source;
IImageSourceHandler handler;
@@ -126,7 +126,7 @@ namespace Xamarin.Forms.Platform.WinRT
else
Control.Source = null;
- Element?.SetValueCore(Image.IsLoadingPropertyKey, false);
+ ((IImageController)Element)?.SetIsLoading(false);
}
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs
index ad07b591..4fd85c6a 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs
@@ -118,7 +118,8 @@ namespace Xamarin.Forms.Platform.iOS
}
IImageSourceHandler handler;
- ((IElementController)Element).SetValueFromRenderer(Image.IsLoadingPropertyKey, true);
+
+ ((IImageController)Element).SetIsLoading(true);
if (source != null && (handler = Registrar.Registered.GetHandler<IImageSourceHandler>(source.GetType())) != null)
{
@@ -143,7 +144,7 @@ namespace Xamarin.Forms.Platform.iOS
Control.Image = null;
if (!_isDisposed)
- ((IElementController)Element).SetValueFromRenderer(Image.IsLoadingPropertyKey, false);
+ ((IImageController)Element).SetIsLoading(false);
}
void SetOpacity()
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/IImageController.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/IImageController.xml
new file mode 100644
index 00000000..40a3cdd7
--- /dev/null
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/IImageController.xml
@@ -0,0 +1,34 @@
+<Type Name="IImageController" FullName="Xamarin.Forms.IImageController">
+ <TypeSignature Language="C#" Value="public interface IImageController" />
+ <TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract IImageController" />
+ <AssemblyInfo>
+ <AssemblyName>Xamarin.Forms.Core</AssemblyName>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Interfaces />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ <Members>
+ <Member MemberName="SetIsLoading">
+ <MemberSignature Language="C#" Value="public void SetIsLoading (bool isLoading);" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void SetIsLoading(bool isLoading) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Void</ReturnType>
+ </ReturnValue>
+ <Parameters>
+ <Parameter Name="isLoading" Type="System.Boolean" />
+ </Parameters>
+ <Docs>
+ <param name="isLoading">To be added.</param>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ </Members>
+</Type>
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/Image.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/Image.xml
index 0f863018..25453fd9 100644
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/Image.xml
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/Image.xml
@@ -1,6 +1,6 @@
<Type Name="Image" FullName="Xamarin.Forms.Image">
- <TypeSignature Language="C#" Value="public class Image : Xamarin.Forms.View" />
- <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Image extends Xamarin.Forms.View" />
+ <TypeSignature Language="C#" Value="public class Image : Xamarin.Forms.View, Xamarin.Forms.IImageController" />
+ <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Image extends Xamarin.Forms.View implements class Xamarin.Forms.IImageController" />
<AssemblyInfo>
<AssemblyName>Xamarin.Forms.Core</AssemblyName>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
@@ -14,7 +14,11 @@
<Base>
<BaseTypeName>Xamarin.Forms.View</BaseTypeName>
</Base>
- <Interfaces />
+ <Interfaces>
+ <Interface>
+ <InterfaceName>Xamarin.Forms.IImageController</InterfaceName>
+ </Interface>
+ </Interfaces>
<Attributes>
<Attribute>
<AttributeName>Xamarin.Forms.RenderWith(typeof(Xamarin.Forms.Platform._ImageRenderer))</AttributeName>
@@ -360,5 +364,24 @@ indicator.BindingContext = image;]]></code>
</remarks>
</Docs>
</Member>
+ <Member MemberName="Xamarin.Forms.IImageController.SetIsLoading">
+ <MemberSignature Language="C#" Value="void IImageController.SetIsLoading (bool isLoading);" />
+ <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void Xamarin.Forms.IImageController.SetIsLoading(bool isLoading) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Void</ReturnType>
+ </ReturnValue>
+ <Parameters>
+ <Parameter Name="isLoading" Type="System.Boolean" />
+ </Parameters>
+ <Docs>
+ <param name="isLoading">To be added.</param>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
</Members>
</Type>