PluralNet: Pluralization for your .Net application

PluralNet: Pluralization for your .Net application

Intro: http://www.rudyhuyn.com/blog/2016/09/28/pluralization-the-missing-part-of-net/ I created a new library named PluralNet, managing plural forms for you, very easy to use and compatible with RESW files as well as RESX files. Contrary to other ios/android libraries, this one will also manage decimal numbers, the code is a little more complex but very useful. How to use it? A Nuget package named PluralNet is available, so install it from Visual Studio or using the following command line: Install-Package PluralNet How to manage plural forms in…

Read More Read More

Pluralization: the missing part of .Net

Pluralization: the missing part of .Net

Plural forms are a lot more complex than we think, there is no generic rules to manage plurals, each languages have their specific rules. A lazy way is to ignore them: 3 item(s) in your cart As a designer, I hate that, it’s laziness. So a lot of applications write a code similar to this one: if(numberOfItem == 1) return SINGULAR; else return PLURAL; It’s better but still wrong, except if you only support english, did you know that this rule is…

Read More Read More

AdaptivePanel: a smarter way to restrict the size of your controls

AdaptivePanel: a smarter way to restrict the size of your controls

One of the big challenge when you write an UWP application is to adapt your UI to 5″ screens (phones) as well as to 84″ screens (Surface Hub). Let be honest: it’s not the easiest task, especially because the framework misses some controls made for your adaptive UI, for example MinWidth and MaxWidth (+ MinHeight/MaxHeight or course). In order to simplify this article, we will only focus on the horizontal plan (MinWidth, Width, MaxWidth and HorizontalAlignment), of course, all the content…

Read More Read More

Delay an action: Debounce and throttle

Delay an action: Debounce and throttle

It can be sometimes interesting to delay an action, for many reasons, but performance is the principal one. Let take an example: you have a searchbox and you need to make a request each time the content changes, if the user types very quickly, it will be totally useless to make a request at every KeyUp events. Solution: Debouncing What is deboucing? The origin is electronic. Mechanical switches don’t make or break a connection cleanly due to microscopic conditions on the…

Read More Read More

Optimize your UWP app without laziness

Optimize your UWP app without laziness

UWP apps are powerful, but due to adaptive design and the many form factors to support, your pages can be a lot more complex than with Windows phone for instance. Let’s take an example, I recently release 6tin as a UWP app, it supports 5 different UI to adapt the user experience to many factors: device family, orientation, theme, user interaction (mouse/touch/gamepad) and of course screen size and density. Here is an example of 2 different states: In blue, controls…

Read More Read More

Gérer la synchronisation de ses agents avec l’application

Gérer la synchronisation de ses agents avec l’application

Il existe de nombreux scénarios où un développeur ne souhaite pas lancer un background agent (périodique par exemple) lorsque son application est lancée, ceci pour différentes raisons: l’application en foreground réalise un traitement équivalent à celui dans le background agent, voire + complet résoudre des problématiques d’accès de fichiers obiwan kenobi C’est une question que je vois régulièrement sur les forums, malheureusement, aucune solution n’est indiquée si ce n’est quelques idées et propositions, mais rien de concret. Donc corrigeons cela pour la nouvelle…

Read More Read More

Display an AppBarButton on the left inside a CommandBar

Display an AppBarButton on the left inside a CommandBar

With Windows 8.1, it was easy to add a button to the left side or the right side of a CommandBar using PrimaryCommands and SecondaryCommands. But Windows 10 uses a different template for CommandBar, similar to the one used by Windows Phone 8.1: primary commands as a button (aligned to the right) secondary commands as a menuitem So, here is the question: How can I align a button to the left? Have a button to the left can be very…

Read More Read More

Detect if your 8.1 app runs on Windows 10

Detect if your 8.1 app runs on Windows 10

Here is a little helper I use on my apps to detect if the OS is Windows 10 or higher. For this purpose, I use the property “Status” of the class Package, why? Cause it’s a new property only available on Windows 10. So using reflection, I can test if this property is available or not and therefore, detect if the app runs on Windows 10. Voici une petite astuce pour détecter si votre application 8.1 tourne sur Windows 10…

Read More Read More

How to use the Clipboard on Windows Phone 8.1 apps

How to use the Clipboard on Windows Phone 8.1 apps

Clipboard api are only available for Windows 8.1 and Windows 10, but not for Windows Phone 8.1 apps Yes and no Yes, Windows Phone 8.1 apps have no access to this cool feature, but only on Windows Phone 8.1 devices! If your app runs on Windows 10 mobile, you can use reflection to use it! Here is the code to use: var clipboardType= typeof(DataPackage).GetTypeInfo().Assembly.GetType(“Windows.ApplicationModel.DataTransfer.Clipboard”); if (clipboardType != null) { var dataPackage = new DataPackage(); dataPackage.SetText(“Hello You!”); clipboardType.GetRuntimeMethod(“SetContent”,new[] {typeof(DataPackage) }).Invoke(null,new object[]…

Read More Read More

[TrucASavoir] Lock screen, Background Agents et Windows 10

[TrucASavoir] Lock screen, Background Agents et Windows 10

Avec Windows 8 et Windows 8.1, les développeurs avaient le choix parmi plusieurs Background Agent afin de faire vivre leurs applications même si celles-ci n’étaient pas lancées. Parmi ces agents, on trouve notamment 4 agents bien spécifiques : Timer Raw Push Notification Location Control Channel Ces 4 agents avaient une contrainte très forte : pour pouvoir s’exécuter, votre application devait être épinglée à l’écran de verrouillage… Soyons honnête, ceci est difficilement compréhensible, quel est le rapport entre le lock screen…

Read More Read More