<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Paul Sheriff's Blog for the Real World - All Comments</title><link>http://weblogs.asp.net/psheriff/default.aspx</link><description>This blog is to share my tips and tricks garnered over 20+ years in the IT industry</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>re: Using Xml Files on Windows Phone</title><link>http://weblogs.asp.net/psheriff/archive/2010/12/14/using-xml-files-on-windows-phone.aspx#8291589</link><pubDate>Thu, 09 Feb 2012 20:53:56 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8291589</guid><dc:creator>psheriff</dc:creator><description>&lt;p&gt;Imran,&lt;/p&gt;
&lt;p&gt;Yes, using the xElem variable you can call the Save() method. You simply need to save the data into Isolated Storage on the phone.&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8291589" width="1" height="1"&gt;</description></item><item><title>re: Using Xml Files on Windows Phone</title><link>http://weblogs.asp.net/psheriff/archive/2010/12/14/using-xml-files-on-windows-phone.aspx#8291528</link><pubDate>Thu, 09 Feb 2012 19:42:03 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8291528</guid><dc:creator>Imran</dc:creator><description>&lt;p&gt;You show how to read. Any way to write&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8291528" width="1" height="1"&gt;</description></item><item><title>re: Using a WPF ListView as a DataGrid</title><link>http://weblogs.asp.net/psheriff/archive/2010/03/08/using-a-wpf-listview-as-a-datagrid.aspx#8288927</link><pubDate>Wed, 08 Feb 2012 13:07:26 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8288927</guid><dc:creator>hemantnaik</dc:creator><description>&lt;p&gt;Nice and Informative, Gr8 Work&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8288927" width="1" height="1"&gt;</description></item><item><title>re: Wrapping up Configuration Manager</title><link>http://weblogs.asp.net/psheriff/archive/2012/02/06/wrapping-up-configuration-manager.aspx#8287416</link><pubDate>Tue, 07 Feb 2012 16:10:39 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8287416</guid><dc:creator>eidand</dc:creator><description>&lt;p&gt;Yes I can see your point Paul.&lt;/p&gt;
&lt;p&gt;I work with AppSettings quite a bit and never needed anything but a generic library class for it hence why I code it in this manner.&lt;/p&gt;
&lt;p&gt;The reason I do like extension methods is because they keep the code extremely clean and readable which is very important to me. I can look at that 1 line method and I&amp;#39;ll never have to ask myself what it does because it&amp;#39;s pretty clear.&lt;/p&gt;
&lt;p&gt;In the end I guess it&amp;#39;s all down to personal preference. It&amp;#39;s good to have alternatives and and it&amp;#39;s even better to see how others do exactly what you are doing, just in a very different way :).&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8287416" width="1" height="1"&gt;</description></item><item><title>re: Wrapping up Configuration Manager</title><link>http://weblogs.asp.net/psheriff/archive/2012/02/06/wrapping-up-configuration-manager.aspx#8287369</link><pubDate>Tue, 07 Feb 2012 15:43:08 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8287369</guid><dc:creator>psheriff</dc:creator><description>&lt;p&gt;Andrei,&lt;/p&gt;
&lt;p&gt;Thanks for posting your code. Yes, you can use static methods. However, I often find that when I use static I end up needing an instance of my properties at some point. I will then often use a singleton pattern where I add code like the following:&lt;/p&gt;
&lt;p&gt; &amp;nbsp;private static AppConfig _Instance = null;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;public static AppConfig Instance&lt;/p&gt;
&lt;p&gt; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;get&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (_Instance == null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_Instance = new AppConfig();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;return _Instance;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;set&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;_Instance = value;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;By doing this, I can use 1 line of code:&lt;/p&gt;
&lt;p&gt;string path = AppConfig.Instance.GetSetting(&amp;quot;XmlPath&amp;quot;, &amp;quot;&amp;quot;);&lt;/p&gt;
&lt;p&gt;Personally I am not a big fan of extension methods. I find programmer's do not always know they are there and I don't trust Microsoft to keep supporting them. This was one of the main points of my blog, I am trying to wrap up Microsoft's stuff so &amp;quot;when&amp;quot; they change things, I can modify my stuff in one place. :)&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8287369" width="1" height="1"&gt;</description></item><item><title>re: Wrapping up Configuration Manager</title><link>http://weblogs.asp.net/psheriff/archive/2012/02/06/wrapping-up-configuration-manager.aspx#8286691</link><pubDate>Tue, 07 Feb 2012 09:42:02 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8286691</guid><dc:creator>Andrei</dc:creator><description>&lt;p&gt;that&amp;#39;s a lot of code for something which is inherently very simple.&lt;/p&gt;
&lt;p&gt;I use a static function for this type of work which simply checks for null and returns an empty string if the value is missing from appsettings.&lt;/p&gt;
&lt;p&gt;If I need the result returned as a specific type then I have a few extension methods which do what I need in one simple call. This is really a library function, does not require an instance of a class and can be called with 1 line of code.&lt;/p&gt;
&lt;p&gt;More than that, the extension methods can be applied to anything of a certain type, so the code is reusable and used in other parts of the system not by a wrapper class.&lt;/p&gt;
&lt;p&gt;Example : &lt;/p&gt;
&lt;p&gt;public static class GenericFunctionality&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public static string RetrieveAppSetting(string AppSettingName)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string result = string.Empty;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (ConfigurationManager.AppSettings[AppSettingName] != null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;result = ConfigurationManager.AppSettings[AppSettingName].ToString();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return result;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Extension : &lt;/p&gt;
&lt;p&gt;public static int ToInt(this string source)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int result = 0;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int.TryParse(source, out result);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return result;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;Usage : int result = GenericFunctionality.RetrieveAppSetting(&amp;quot;something&amp;quot;).ToInt();&lt;/p&gt;
&lt;p&gt;a bit more code can be added to ensure against passing nulls to the function I suppose but, I feel this implementation is a bit more useful&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8286691" width="1" height="1"&gt;</description></item><item><title>re: Creating a Base Window Class in WPF</title><link>http://weblogs.asp.net/psheriff/archive/2009/11/02/creating-a-base-window-class-in-wpf.aspx#8285514</link><pubDate>Mon, 06 Feb 2012 16:05:50 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8285514</guid><dc:creator>psheriff</dc:creator><description>&lt;p&gt;Clint,&lt;/p&gt;
&lt;p&gt;No, this still works. I use this technique all the time. I am using Visual Studio 2010.&lt;/p&gt;
&lt;p&gt;The one thing I notice is that your x:Class=&amp;quot;myEmailer...&amp;quot;, but your base class is in another namespace. Is your ClientWindow in another DLL? If so, then you need the Assembly reference in your xmlns:src=&amp;quot;...&amp;quot;.&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8285514" width="1" height="1"&gt;</description></item><item><title>re: Creating a Base Window Class in WPF</title><link>http://weblogs.asp.net/psheriff/archive/2009/11/02/creating-a-base-window-class-in-wpf.aspx#8281517</link><pubDate>Sat, 04 Feb 2012 17:29:46 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8281517</guid><dc:creator>Clint</dc:creator><description>&lt;p&gt;Has this changed in the last few months or recent WPF release/C# 4 release?&lt;/p&gt;
&lt;p&gt;I get an error of &amp;quot;Only a root tag can specify attribute &amp;#39;x:Class&amp;#39;. Line 2 Postition 5&amp;quot; &amp;nbsp;Which is this:&lt;/p&gt;
&lt;p&gt;&amp;lt;src:myClient.ClientWindow &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;x:Class=&amp;quot;myEmailer.EmailMessageWindow&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;xmlns=&amp;quot;&lt;a rel="nofollow" target="_new" href="http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;"&gt;schemas.microsoft.com/.../presentation&amp;quot;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;xmlns:x=&amp;quot;&lt;a rel="nofollow" target="_new" href="http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;"&gt;schemas.microsoft.com/.../xaml&amp;quot;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;xmlns:src=&amp;quot;clr-namespace:myClient&amp;quot;&lt;/p&gt;
&lt;p&gt;The theory being I&amp;#39;m working on a client/server package. &amp;nbsp;There will be several different types of client applications for different purposes all talking to the same server. &amp;nbsp;So I want each client to inherit from a client base where all the communication protocol stuff is located.&lt;/p&gt;
&lt;p&gt;So I made a base ClientWindow, then want to inherit from that for the EmailClient, UserClient, PosClient and so on.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8281517" width="1" height="1"&gt;</description></item><item><title>re: Windows Phone List Box with Images</title><link>http://weblogs.asp.net/psheriff/archive/2010/10/27/windows-phone-list-box-with-images.aspx#8278274</link><pubDate>Fri, 03 Feb 2012 02:05:32 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8278274</guid><dc:creator>Jayamohan</dc:creator><description>&lt;p&gt;This was really useful. I had used your source snippet in my application. I was planning to use a lot of source lines to implement the same. But your simple way of using the the XAML files to populate the values helped me a lot.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8278274" width="1" height="1"&gt;</description></item><item><title>re: Filtering CollectionView Data in Silverlight 4</title><link>http://weblogs.asp.net/psheriff/archive/2010/08/03/filtering-collectionview-data-in-silverlight-4.aspx#8270410</link><pubDate>Sat, 28 Jan 2012 04:58:43 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8270410</guid><dc:creator>ricardo</dc:creator><description>&lt;p&gt;You solve all my filtering and grouping problems which I spent most of my day looking for a solution, PagedCollectionView is the way to go...&lt;/p&gt;
&lt;p&gt;My filter is based on categories selected from a dropdown, all the same the .Filter = Query is what I needed...&lt;/p&gt;
&lt;p&gt;Thanks a million!!!&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8270410" width="1" height="1"&gt;</description></item></channel></rss>
