<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	
	>
<channel>
	<title>
	Comments for Tommy Baggett	</title>
	<atom:link href="https://tommyb.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>https://tommyb.com</link>
	<description>Mobile App Developer</description>
	<lastBuildDate>Tue, 23 Oct 2018 15:56:49 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.6.17</generator>
	<item>
		<title>
		Comment on &#8220;Memory Management in Xamarin Apps&#8221; Series, Part Four by Reihaneh		</title>
		<link>https://tommyb.com/blog/memory-management-in-xamarin-apps-series-part-four/#comment-3</link>

		<dc:creator><![CDATA[Reihaneh]]></dc:creator>
		<pubDate>Tue, 23 Oct 2018 15:56:49 +0000</pubDate>
		<guid isPermaLink="false">https://tommyb.com/?p=756#comment-3</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://tommyb.com/blog/memory-management-in-xamarin-apps-series-part-four/#comment-2&quot;&gt;Tommy Baggett&lt;/a&gt;.

Hi Tommy,

Thank you so much for answering my questions and your explanations.

Best regards,
Reihaneh]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://tommyb.com/blog/memory-management-in-xamarin-apps-series-part-four/#comment-2">Tommy Baggett</a>.</p>
<p>Hi Tommy,</p>
<p>Thank you so much for answering my questions and your explanations.</p>
<p>Best regards,<br />
Reihaneh</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		Comment on &#8220;Memory Management in Xamarin Apps&#8221; Series, Part Four by Tommy Baggett		</title>
		<link>https://tommyb.com/blog/memory-management-in-xamarin-apps-series-part-four/#comment-2</link>

		<dc:creator><![CDATA[Tommy Baggett]]></dc:creator>
		<pubDate>Mon, 22 Oct 2018 14:37:26 +0000</pubDate>
		<guid isPermaLink="false">https://tommyb.com/?p=756#comment-2</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://tommyb.com/blog/memory-management-in-xamarin-apps-series-part-four/#comment-1&quot;&gt;Reihaneh&lt;/a&gt;.

Hi Reihaneh,

Thanks for the kind words regarding the article. As for your questions, the CloseHandle() method is an OS call to release a handle returned when opening a file. This was only an example, and for a Xamarin.Forms project, would be found in your platform-specific code if you had to use OS-specific functionality for some reason. You would more likely use .net file I/O methods in your cross platform code with a using statement, for example &quot;using (var sr = new StreamReader(&quot;testfile.txt&quot;)) { ... }&quot;. In that case, the disposal will be taken care of for you by the using statement. See the &lt;a href=&quot;https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using-statement&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;MS docs on the using statement&lt;/a&gt; if you&#039;re not familiar with that.

For your second question, yes you are correct, you would add and remove listeners in the OnAppearing and OnDisappearing methods, respectively. Be aware though that these methods are currently only available for Page-derived classes, not View-derived ones, despite them being requested for some time. Also, yes, you can remove them directly instead of creating a separate method to add and remove them. That was done to provide consistency across view classes to make the code easier to maintain over time. Having them allows you to perform a search for the methods to quickly locate where listeners are being added and removed.

Hope this info helps!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://tommyb.com/blog/memory-management-in-xamarin-apps-series-part-four/#comment-1">Reihaneh</a>.</p>
<p>Hi Reihaneh,</p>
<p>Thanks for the kind words regarding the article. As for your questions, the CloseHandle() method is an OS call to release a handle returned when opening a file. This was only an example, and for a Xamarin.Forms project, would be found in your platform-specific code if you had to use OS-specific functionality for some reason. You would more likely use .net file I/O methods in your cross platform code with a using statement, for example &#8220;using (var sr = new StreamReader(&#8220;testfile.txt&#8221;)) { &#8230; }&#8221;. In that case, the disposal will be taken care of for you by the using statement. See the <a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using-statement" target="_blank" rel="noopener nofollow">MS docs on the using statement</a> if you&#8217;re not familiar with that.</p>
<p>For your second question, yes you are correct, you would add and remove listeners in the OnAppearing and OnDisappearing methods, respectively. Be aware though that these methods are currently only available for Page-derived classes, not View-derived ones, despite them being requested for some time. Also, yes, you can remove them directly instead of creating a separate method to add and remove them. That was done to provide consistency across view classes to make the code easier to maintain over time. Having them allows you to perform a search for the methods to quickly locate where listeners are being added and removed.</p>
<p>Hope this info helps!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		Comment on &#8220;Memory Management in Xamarin Apps&#8221; Series, Part Four by Reihaneh		</title>
		<link>https://tommyb.com/blog/memory-management-in-xamarin-apps-series-part-four/#comment-1</link>

		<dc:creator><![CDATA[Reihaneh]]></dc:creator>
		<pubDate>Sat, 06 Oct 2018 09:06:10 +0000</pubDate>
		<guid isPermaLink="false">https://tommyb.com/?p=756#comment-1</guid>

					<description><![CDATA[Hello,

Thanks for your great article, I just have a couple of questions. Hope you&#039;d have the time to answer them.

1. In your first recommendation, what is CloseHandle() method? and what does it do exactly? Should I write it myself?
2. In the &quot;use named event handler&quot; recommendation, you have overridden the ViewWillAppear() and RemoveEventListener() methods, but since I&#039;m using Xamarin.Forms, there are no such methods available. So, can I use OnApperaing() method instead of ViewWillAppear()? and as for RemoveEventListener(), will it be enough if I just remove the listeners?

Thanks in advance]]></description>
			<content:encoded><![CDATA[<p>Hello,</p>
<p>Thanks for your great article, I just have a couple of questions. Hope you&#8217;d have the time to answer them.</p>
<p>1. In your first recommendation, what is CloseHandle() method? and what does it do exactly? Should I write it myself?<br />
2. In the &#8220;use named event handler&#8221; recommendation, you have overridden the ViewWillAppear() and RemoveEventListener() methods, but since I&#8217;m using Xamarin.Forms, there are no such methods available. So, can I use OnApperaing() method instead of ViewWillAppear()? and as for RemoveEventListener(), will it be enough if I just remove the listeners?</p>
<p>Thanks in advance</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
