Dealing with page resize in Windows Store Applications using Caliburn.Micro

Sunday, March 1, 2015

Windows Store Applications allow the user to change the size of the application and change the the layout to e vertical or horizontal. in order to provide god user experience we want adapt our view to different modes. For instance, showing a grid like view when in Full Horizontal mode and change it a List when we are snapped to side (and look vertical). The examples and guidelines on how to change your view based on the page layout change are around those option: In your page XAML write the representation for both mode and change visibility...

StringSplitterConverter–binding to a part of a string in XAML

Sunday, December 21, 2014

I’m involved in a Windows Store project that needs to deal with localization. I already write a about localization in Windows Store application in January 2013 so you are welcome to read about it. Our Xaml designers came to me the other day with an issue they found irritating. They needed to show some text on the screen that contain both regular text (some as bold, some italic etc.) and hyperlinks and if that’s not enough the text-resource was localized. One way to solve this is to separate the text-resource to multiple parts and store each one independently...
no comments

Dependent DLLs are not copied if referenced only from XAML

Friday, September 19, 2014

I got a nasty exception in my project: A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll Additional information: Could not load file or assembly 'AThirdParty, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. To illusatrate, this how my solution looked like: I have a control library that uses another control library (doesn't matter if in the same solution or from 3rd party).MyControlLibrary reference a control from the AThirdParty dll only in one of its user-controls xaml:<Grid> <aThirdParty:ThirdPartyControl/> </Grid> MyWPFApplication used the user-control from MyControlLibrary inside its...
no comments

WPF Lite TreeView

Thursday, September 18, 2014

I received a call from a client last week about bad performance in their WPF application. It turns out that they expected that some view that holds a tree will need to show a few tens of items BUT when they deployed it to customer site they were surprised that the amount of items was actually a few thousands. Long story short – WPF TreeView doesn't scale very good, trying to expand a node with thousands of sub-items can take a long time. Virtualization doesn't work either (especially if you work with .NET framework prior to 4.5) because it...
no comments

System.Reflection.AmbiguousMatchException from xaml in Windows Phone

Wednesday, September 3, 2014

Lately I ran into a tricky bug inside a Windows Phone application. Sometimes an unhandled exception was thrown that caused the application to crash. Looking into the logs showed that the exception was System.Reflection.AmbiguousMatchException which is caused when the reflection mechanism finds more than one option for a member in a class. TL;DR; – Don't bind in xaml to a property with new modifer  The reason for the exception was that one of the team members decided to derive a class from some entity - lets call the entity Person. public class Person { public int Age...