summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069_Page.xaml.cs
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2016-08-02 14:54:57 -0600
committerJason Smith <jason.smith@xamarin.com>2016-08-02 13:54:57 -0700
commit34048b7bb4e8bf55c712ffd92303cf260c491c0e (patch)
tree19236fb4e72b8833c87e19fd15d0958b947764fc /Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069_Page.xaml.cs
parent08e282350cb3f1c2345125682f14934111af2f9c (diff)
downloadxamarin-forms-34048b7bb4e8bf55c712ffd92303cf260c491c0e.tar.gz
xamarin-forms-34048b7bb4e8bf55c712ffd92303cf260c491c0e.tar.bz2
xamarin-forms-34048b7bb4e8bf55c712ffd92303cf260c491c0e.zip
Change SourceChanged event on ImageSource to weak event to allow Images (#268)
referencing application-wide StaticResource ImageSources to be GCed
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069_Page.xaml.cs')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069_Page.xaml.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069_Page.xaml.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069_Page.xaml.cs
new file mode 100644
index 00000000..2031e56c
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069_Page.xaml.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Diagnostics;
+using System.Threading;
+
+namespace Xamarin.Forms.Controls.Issues
+{
+ public partial class Bugzilla42069_Page : ContentPage
+ {
+ public const string DestructorMessage = ">>>>>>>>>> Bugzilla42069_Page destructor <<<<<<<<<<";
+
+ public Bugzilla42069_Page()
+ {
+ InitializeComponent();
+
+ ImageWhichChanges = ImageSource.FromFile("oasissmall.jpg") as FileImageSource;
+
+ ChangingImage.SetBinding(Image.SourceProperty, nameof(ImageWhichChanges));
+
+ Button.Clicked += (sender, args) => Navigation.PopAsync(false);
+
+ Button2.Clicked += (sender, args) =>
+ {
+ ImageWhichChanges.File = ImageWhichChanges.File == "bank.png" ? "oasissmall.jpg" : "bank.png";
+ };
+
+ BindingContext = this;
+ }
+
+ ~Bugzilla42069_Page()
+ {
+ Debug.WriteLine(DestructorMessage);
+ }
+
+ public FileImageSource ImageWhichChanges { get; set; }
+ }
+} \ No newline at end of file