Simple Behavior for Binding to ActualWidth\ActualHeight

December 22, 2014

There are times when you want two or more elements in your XAML to share the same dimensions, usually you dint want to deal with static sizes and prefer that after an element got its size from the layout, all the other elements will be set to the same size. you can find the real sizes of an element quite easily by looking at its ActualHeight and ActualWidth properties, however those properties doesn’t behave nice with binding and attempting to bind an element to another element ActualWidth\ActualHeight will result in an expected results. to mitigate the problem I created...
no comments

StringSplitterConverter–binding to a part of a string in XAML

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

Getting the Free Storage Space in WinRT

December 16, 2014

I didnt find any documenation to this method other than the thread in StackOverflow: http://stackoverflow.com/questions/19510449/disk-space-in-winrt-using-c-sharp-in-windows-8 so im keeping it here so it wont get lost by the winds of time…. public static async Task<UInt64> GetFreeSpace(this IStorageItem sf) { var properties = await sf.GetBasicPropertiesAsync(); var filteredProperties = await properties.RetrievePropertiesAsync(new { "System.FreeSpace" }); var freeSpace = filteredProperties; return (UInt64)freeSpace; } Sample use: var freeSpace = await ApplicationData.Current.LocalFolder.GetFreeSpace(); Debug.WriteLine(freeSpace.GetSizeString()); Thank you  Filip Skakun
no comments

Making your WCF Service Task based without changing its code

December 9, 2014

WCF is a very powerful framework, it allows you to control your service behavior without even touch your code. You can change bindings, protocols, Timeouts and much more only through configurations and environmental changes. WCF also supports writing Task based asynchoronous service, for example:   Service Side: public interface ICalculator { Task AddAsync(int left,int right); }   public class Calculator : ICalculator { ...
no comments