Munkii Magic http://munkiisoft.com/blog/Default.aspx Too much monkey business en-GB Pat Subtext Version 2.5.2.0 Munkii Magic http://munkiisoft.com/blog/images/RSS2Image.gif http://munkiisoft.com/blog/Default.aspx 77 60 Updating the Footer on a Monotouch Dialog Section http://munkiisoft.com/blog/archive/2015/06/10/updating-the-footer-on-a-monotouch-dialog-section.aspx <p>I am using MVVMCross and Xamarin.iOS to build an iOS app and one of the pages we are laying out the UI using MVVMCross’ Fork of Montotouch Dialog (MT. D).</p> <p>The string Footer property of the Section is bindable and could be set using an MvxInlineBindingTarget&lt;T&gt;. The trouble is that subsequent  updates to that Footer property did not cause the Sectionto redraw its Footer. This is not a problem that is specific to MT.D as StackOverflow is full of questions around updating Rows and Footers in UITableViews and MT.D is UITableViews underneath anyway.</p> <p>After much poking around and trial and error I came up with an alternative Footer property in a derived Section class. See this Gist, <a title="https://gist.github.com/munkii/9709dad0bfef4bb43a34" href="https://gist.github.com/munkii/9709dad0bfef4bb43a34">https://gist.github.com/munkii/9709dad0bfef4bb43a34</a></p><img src="http://munkiisoft.com/blog/aggbug/49.aspx" width="1" height="1" /> Pat http://munkiisoft.com/blog/archive/2015/06/10/updating-the-footer-on-a-monotouch-dialog-section.aspx Wed, 10 Jun 2015 08:26:26 GMT http://munkiisoft.com/blog/archive/2015/06/10/updating-the-footer-on-a-monotouch-dialog-section.aspx#feedback http://munkiisoft.com/blog/comments/commentRss/49.aspx Sizing a custom iOS View to fit its children http://munkiisoft.com/blog/archive/2015/01/13/sizing-a-custom-ios-view-to-fit-its-children.aspx <p>Just spent a few hours wondering why my custom UIView I have created in Xamarin iOS was seemingly ignoring my request to set the BackgroundColor.</p> <p>There are many many theories on the web but one finally told me to check the Size of the View’s Frame. I had assumed there was not a problem with the View’s height because the UILabels that were SubViews were displaying as I expected</p> <p>It turns out that the even though the child controls were sizing correctly the containing control had zero 0 height. How very HTML\CSS of it. </p> <p><a href="http://stackoverflow.com/questions/3605393/iphone-uiview-resize-frame-to-fit-subviews">This stackoverflow Q&amp;A</a> explains how and why you calculate your own height based on your child items.</p> <p>I think I have been using decent UI SDKs like Windows8 XAML for too long as it think it is bad that this is not automatically created</p><img src="http://munkiisoft.com/blog/aggbug/48.aspx" width="1" height="1" /> Pat http://munkiisoft.com/blog/archive/2015/01/13/sizing-a-custom-ios-view-to-fit-its-children.aspx Tue, 13 Jan 2015 16:18:08 GMT http://munkiisoft.com/blog/archive/2015/01/13/sizing-a-custom-ios-view-to-fit-its-children.aspx#feedback http://munkiisoft.com/blog/comments/commentRss/48.aspx Trouble adding MVVM Cross 3.5 to Portable Class library http://munkiisoft.com/blog/archive/2014/12/17/trouble-adding-mvvm-cross-3-5-to-portable-class-library.aspx <p>Yesterday I had problems adding the MVVM Cross 3.5 (PreRelease) package to a .NET PCL. (<a href="http://stackoverflow.com/questions/27503929/new-ios-mvvmcross-project-which-nuget-package-and-or-pcl-targets">See question on SO</a>) </p> <p>I was getting this compatibility error</p> <blockquote> <p>Could not install package 'MvvmCross.PortableSupport 3.5.0-beta1'. You are trying to install this package into a project that targets 'portable-net45+sl50+Xamarin.iOS10+MonoAndroid10+MonoTouch10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.</p> </blockquote> <p>I tried cutting back the configured targets but Visual Studio kept telling me that the likes of Silverlight 5 were going to be  “automatically targeted” because they support the same set of portable APIs. Despite what people say Silverlight 5 would not die <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Smile" src="http://munkiisoft.com/blog/images/munkiisoft_com/blog/Windows-Live-Writer/Trouble-moving-to_719D/wlEmoticon-smile_2.png" />. <a href="https://twitter.com/slodge">@slodge</a> suggested editing the csproj file directly to change the targeted profile number. How anyone is supposed to know how to do that based on the error message is beyond me. If anyone can explain a detailed way of diagnosing the “Could not install package…” error messages please add a comment below.</p> <p>Once I’d changed the TargetFrameworkProfile and “reloaded” the project in Visual Studio the project had  “(Updated Required)” displayed next to it. </p> <p>Visual Studio however did not need updating it was just confused because the project now had a TargetFrameworkProfile of 259 but a TargetFrameworkVersion of “v4.0” these are not compatible and I simply needed to update it to “v4.5”. I discovered this in this <a href="http://stackoverflow.com/a/26127667/63286">Stack Overflow answer</a>. Once I had changed the TargetFrameworkProfile and TargetFrameworkVersion I could add the MVVM Cross Nuget Package.</p> <p>Hope the next person who stumbles into this area.</p><img src="http://munkiisoft.com/blog/aggbug/47.aspx" width="1" height="1" /> Pat http://munkiisoft.com/blog/archive/2014/12/17/trouble-adding-mvvm-cross-3-5-to-portable-class-library.aspx Wed, 17 Dec 2014 08:29:06 GMT http://munkiisoft.com/blog/archive/2014/12/17/trouble-adding-mvvm-cross-3-5-to-portable-class-library.aspx#feedback http://munkiisoft.com/blog/comments/commentRss/47.aspx The 3 Best WP7 Performance Analysis Articles Windows Phone http://munkiisoft.com/blog/archive/2012/05/25/the-3-best-wp7-performance-analysis-articles.aspx <p>When Microsoft shipped the Mango tools for Visual Studio they included Windows Phone Performance Analysis Toolset. This is a memory and cpu profiler specifically developed for Windows Phone 7. </p> <p>The original docs were IMHO atrocious, really unhelpful. However in the last few months there have been some great articles explaining how to really user the tool and more importantly understand and navigate its output</p> <p>My 3 favourites are</p> <ol> <li>Memory Profiling for Application Performance <br /><a href="http://windowsteamblog.com/windows_phone/b/wpdev/archive/2012/02/01/memory-profiling-for-application-performance.aspx">http://windowsteamblog.com/windows_phone/b/wpdev/archive/2012/02/01/memory-profiling-for-application-performance.aspx</a></li> <li>How to: Identify and Fix Common Performance Issues Using Windows Phone Performance Analysis <br /><a href="http://msdn.microsoft.com/en-us/library/hh202932(v=vs.92).aspx">http://msdn.microsoft.com/en-us/library/hh202932(v=vs.92).aspx</a></li> <li>How to: Capture and Analyze Performance Data Using Windows Phone Performance Analysis <br /><a href="http://msdn.microsoft.com/en-us/library/hh202935(v=vs.92).aspx">http://msdn.microsoft.com/en-us/library/hh202935(v=vs.92).aspx</a> <br /></li> </ol><img src="http://munkiisoft.com/blog/aggbug/45.aspx" width="1" height="1" /> Pat http://munkiisoft.com/blog/archive/2012/05/25/the-3-best-wp7-performance-analysis-articles.aspx Fri, 25 May 2012 00:13:00 GMT http://munkiisoft.com/blog/archive/2012/05/25/the-3-best-wp7-performance-analysis-articles.aspx#feedback http://munkiisoft.com/blog/comments/commentRss/45.aspx Useful error messages from a Serialiser? Surely not http://munkiisoft.com/blog/archive/2011/12/22/useful-error-messages-from-a-serialiser-surely-not.aspx <p>As many people will tell you I am a miserable old git at times and love a good moan. However I think it only fair to give credit where credit is due. I was updating some code today that used Microsoft’s XmlSerializer and had types decorated with DataContract attributes.</p> <p>My experience of serialisers and how they give out help via error messages is that clearly the person who wrote it thinks “I am super smart and can write a serialiser from scratch. If you are too stupid to configure your types for serialisation then tough ####.” If you are lucky they will throw an error like “Error occurred.” Great thanks a bunch sometimes they just silently fail Grrrrrr!</p> <p>Usual problems are no public parameter-less constructor or trying to deserialise read only properties. </p> <p>Well today I got some great error messages from the <a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx" target="_blank">XmlSerialiser</a> telling me that I was trying to deserialise a property that had no Setter and that the type I was trying to serialise was now a Known Type. The MSDN docs for the error explained that because the type was inheriting the base class needed to be decorated with a <a href="http://msdn.microsoft.com/en-us/library/ms730167.aspx" target="_blank">KnownType</a> attribute</p> <p>Thanks you Microsoft</p><img src="http://munkiisoft.com/blog/aggbug/44.aspx" width="1" height="1" /> Pat http://munkiisoft.com/blog/archive/2011/12/22/useful-error-messages-from-a-serialiser-surely-not.aspx Thu, 22 Dec 2011 14:46:34 GMT http://munkiisoft.com/blog/archive/2011/12/22/useful-error-messages-from-a-serialiser-surely-not.aspx#feedback 1 http://munkiisoft.com/blog/comments/commentRss/44.aspx Making sure your WP7 app updates successfully http://munkiisoft.com/blog/archive/2011/12/22/making-sure-your-wp7-app-updates-successfully.aspx <p>I am going to be pushing out a new version of my app soon. Whilst the app brings new design, imagery and ads I also took the opportunity to update namespaces and some class names.</p> <p>Towards the end of my update development I began worrying if data that had already been saved on the device would be compatible with the new code. The last thing I wanted was an unrecoverable crash after the update. After searching around I found this great article <a href="http://blogs.msdn.com/b/dohollan/archive/2011/12/07/debugging-the-update-process-for-windows-phone-apps.aspx">Debugging the Update Process for Windows Phone Apps</a> from <a href="http://social.msdn.microsoft.com/profile/doug%20holland/">Doug Holland</a>. </p> <p>Doug’s a smart guy and he keeps a copy of his previous XAP submissions so that he can test older versions. I on the other hand am not so smart and did not have a copy, dammit! We changed source control provider recently so I couldn’t get from a particular Label either. </p> <p>I thought all was lost as I could not see how I could get hold of a copy of the published XAP needed to follow’s Doug’s process. Then I found <a href="http://ried.cl/mobile/wp7desktopmarketplace.html" target="_blank">Phone7Market</a> this allows the download and install of Free or Trial versions of published Marketplace apps.</p> <p>So now I had a the published version of my app and my swanky new version. Unfortunately the version from Phone7Market is the signed version that has a separate product id. This means we cannot simply install it, use it and then try updating it as the <a href="http://wptools.codeplex.com/" target="_blank">Windows Phone Power Tools</a> will not see the two apps as the same app. There is a workaround  for this situation.</p> <ol> <li>Install the published version to the emulator\device using Phone7Market.</li> <li>Use the published version as much as is necessary to cause significant data to be stored in isolated storage.</li> <li>Using the power tools, connect to the emulator\device, switch to “file browser” view and “GET” the files onto your local machine</li> <li>Now deploy the swanky new version, use Visual Studio or whatever you find easier.</li> <li>You should now have two app nodes in the “file browser” view. One with a GUID name, that is your published one and one with the name of your app. That is the local debug version.</li> <li>With these two folder structures you can “PUT” the files that you “GOT” in step 3 into the IsolatedStorage node of the new debuggable version</li> <li>Start up your local app in debug mode and you can check what happens when your new codes tries to load old data files!"</li> </ol> <p>Many thanks to Doug for his original article; to the <a href="http://www.codeplex.com/site/users/view/nachmore" target="_blank">Windows Phone Power Tools  team</a> and to the <a href="http://erwin.ried.cl/" target="_blank">Phone7Market team</a>. Really useful tools, seeing as it is Christmas I should probably go hit the “Donate” button</p><img src="http://munkiisoft.com/blog/aggbug/43.aspx" width="1" height="1" /> Pat http://munkiisoft.com/blog/archive/2011/12/22/making-sure-your-wp7-app-updates-successfully.aspx Thu, 22 Dec 2011 13:37:39 GMT http://munkiisoft.com/blog/archive/2011/12/22/making-sure-your-wp7-app-updates-successfully.aspx#feedback http://munkiisoft.com/blog/comments/commentRss/43.aspx What&rsquo;s new in the Windows Phone 7.1 SDK http://munkiisoft.com/blog/archive/2011/10/14/whatrsquos-new-in-the-windows-phone-7.1-sdk.aspx <p>Search for “what’s new in WP7 Mango” and you get results that are aimed at consumers with lots of video walkthroughs on stuff like Voice Commands and how to play your favourite tunes in the background.</p> <p>As a developer I was looking for the official “What’s New” list not some excited geeks review of his favourite feature. Well here it is, <a href="http://msdn.microsoft.com/en-us/library/ff637516%28v=vs.92%29.aspx">What's New in the Windows Phone SDK</a>.  I wish I’d read it earlier because maybe I would have noticed the new <a href="How to: Use the Share Link Task for Windows Phone">ShareLinkTask</a> and not wasted my energy fixing my Facebook OAuth code that those toe-rags at Facebook broke! </p><img src="http://munkiisoft.com/blog/aggbug/42.aspx" width="1" height="1" /> Pat http://munkiisoft.com/blog/archive/2011/10/14/whatrsquos-new-in-the-windows-phone-7.1-sdk.aspx Fri, 14 Oct 2011 06:44:48 GMT http://munkiisoft.com/blog/archive/2011/10/14/whatrsquos-new-in-the-windows-phone-7.1-sdk.aspx#feedback http://munkiisoft.com/blog/comments/commentRss/42.aspx Shoot, Shag, Marry reviewed by T3.com http://munkiisoft.com/blog/archive/2011/03/30/shoot-shag-marry-reviewed-t3.com.aspx <p>I am was pretty excited today to see my app had been <a href="http://best-apps.t3.com/apps/windows7/entertainment/paid/shoot-shag-marry/">reviewed on T3.com</a>. Cool! You can download the app on your Windows Phone 7, or via <a href="http://redirect.zune.net/redirect?type=phoneApp&amp;id=1b467845-18dc-df11-a844-00237de2db9e&amp;source=VSGallery">Zune on your PC</a>.</p><img src="http://munkiisoft.com/blog/aggbug/41.aspx" width="1" height="1" /> Pat http://munkiisoft.com/blog/archive/2011/03/30/shoot-shag-marry-reviewed-t3.com.aspx Wed, 30 Mar 2011 22:48:19 GMT http://munkiisoft.com/blog/archive/2011/03/30/shoot-shag-marry-reviewed-t3.com.aspx#feedback http://munkiisoft.com/blog/comments/commentRss/41.aspx Finding Windows Phone 7 apps Windows Phone http://munkiisoft.com/blog/archive/2010/11/20/finding-windows-phone-7-apps.aspx <p>I mentioned AppFuze in my last post called "<a href="http://www.munkiisoft.com/blog/archive/2010/11/14/filling-in-the-gaps-in-the-windows-phone-7-marketplace.aspx">Filling in the gaps in the Windows Phone 7 marketplace</a>” and how they were filling in the gap for an online listing of WP7 apps. Well Bing have gone and blown that out of the water with their <a href="http://www.bing.com/visualsearch?g=uk_wp7&amp;qpvt=Windows+Phone+7+Apps&amp;FORM=Z9GE18#">Visual Search</a>, it is freakin awesome. The 3 apps I worked on Ministry of Sound, one for a broad sheet newspaper, and Shoot Shag Marry are 18th, 11th and 23rd in their respective categories. </p> <p><a rel="lightbox" href="http://www.munkiisoft.com/blog/images/www_munkiisoft_com/blog/Windows-Live-Writer/Finding-Windows-Phone-7-apps_EAF7/WP7BingWebBasedSearch-SShot_2.png"><img style="BACKGROUND-IMAGE: none; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px; PADDING-TOP: 0px" title="WP7BingWebBasedSearch-SShot" border="0" alt="WP7BingWebBasedSearch-SShot" width="482" height="249" src="http://www.munkiisoft.com/blog/images/www_munkiisoft_com/blog/Windows-Live-Writer/Finding-Windows-Phone-7-apps_EAF7/WP7BingWebBasedSearch-SShot_thumb.png" /></a></p> <p> </p> <p>Prefer Google as you search engine? Just look how rubbish the web based Android  App Search is. Yes Android is Google’s mobile OS, you would have thought they could have done a better job.</p> <p><a rel="lightbox" href="http://www.munkiisoft.com/blog/images/www_munkiisoft_com/blog/Windows-Live-Writer/Finding-Windows-Phone-7-apps_EAF7/AQndroidWebBasedSearch-SShot_2.png"><img style="BACKGROUND-IMAGE: none; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px; PADDING-TOP: 0px" title="AQndroidWebBasedSearch-SShot" border="0" alt="AQndroidWebBasedSearch-SShot" width="482" height="333" src="http://www.munkiisoft.com/blog/images/www_munkiisoft_com/blog/Windows-Live-Writer/Finding-Windows-Phone-7-apps_EAF7/AQndroidWebBasedSearch-SShot_thumb.png" /></a></p> <p>Android Apps search. I f you think that it does not look all that bad in screen shot, go try it, <a href="http://www.android.com/market/#app=basesign.alltie">here</a>. There is no Search!!!</p><img src="http://munkiisoft.com/blog/aggbug/40.aspx" width="1" height="1" /> Pat http://munkiisoft.com/blog/archive/2010/11/20/finding-windows-phone-7-apps.aspx Sat, 20 Nov 2010 17:03:53 GMT http://munkiisoft.com/blog/archive/2010/11/20/finding-windows-phone-7-apps.aspx#feedback 1 http://munkiisoft.com/blog/comments/commentRss/40.aspx Filling in the gaps in the Windows Phone 7 marketplace Windows Phone http://munkiisoft.com/blog/archive/2010/11/14/filling-in-the-gaps-in-the-windows-phone-7-marketplace.aspx <p>Well Windows Phone 7 launch has gone well with the number of apps growing at an excellent rate. However as a user of a WP7 and an app developer there are a few bits currently missing from the Marketplace</p> <h2>Usage Statistics</h2> <p>Download and purchase reports are not due to be available until Jan 2011. We are all going to be anxiously waiting those reports to find out how successful our apps have been. If you cannot wait that long Mark Monster explains how you can use <a href="http://mark.mymonster.nl/2010/06/24/capture-usage-information-of-a-windows-phone-7-application-using-google-analytics/">Google Analytics to capture usage information</a> or checkout the <a href="http://kodierer.blogspot.com/2010/11/tracking-sales-statistics-with.html">Silverlight Analytics Framework on WP7 at Kodierer [Coder]</a>.</p> <h2>App Listings</h2> <p>When I was developing for Android I was pretty disappointed by Google’s web based marketplace. At the moment the marketplace for Windows Phone 7 is officially via Zune on the desktop and obviously the phone. Unofficially there is an online browsing of the Windows Phone marketplace at <a href="http://www.appsfuze.com/">AppsFuze</a>.</p> <h2>App Reviews</h2> <p>There is currently no official way to easily read all the Reviews of your app. The unofficial solution comes from Tom Verhoeff, at <a href="http://wp7reviews.tomverhoeff.com/">Windows Phone 7 AppReviews</a>.</p><img src="http://munkiisoft.com/blog/aggbug/39.aspx" width="1" height="1" /> Pat http://munkiisoft.com/blog/archive/2010/11/14/filling-in-the-gaps-in-the-windows-phone-7-marketplace.aspx Sun, 14 Nov 2010 22:55:01 GMT http://munkiisoft.com/blog/archive/2010/11/14/filling-in-the-gaps-in-the-windows-phone-7-marketplace.aspx#feedback http://munkiisoft.com/blog/comments/commentRss/39.aspx