diff options
author | E.Z. Hart <hartez@users.noreply.github.com> | 2016-08-02 14:54:57 -0600 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-08-02 13:54:57 -0700 |
commit | 34048b7bb4e8bf55c712ffd92303cf260c491c0e (patch) | |
tree | 19236fb4e72b8833c87e19fd15d0958b947764fc /Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069_Page.xaml.cs | |
parent | 08e282350cb3f1c2345125682f14934111af2f9c (diff) | |
download | xamarin-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.cs | 36 |
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 |