Be careful with Path.GetExtension() and Path.GetFileName()

Be careful with Path.GetExtension() and Path.GetFileName()

Path.GetExtension as well as Path.GetFileName are very useful, but you will have some issues if you don’t read the document. One important thing to know about them is that they are very restricted and related to NTFS file system. It’s safe to use with NTFS/FAT32 paths and not with URI, HFS+ (OsX) and almost all LINUX paths. Invalid characters are: quote (“), less than (<), greater than (>), pipe (|), backspace (\b), null (\0), tab (\t). So if your string…

Read More Read More

More analytic data for your UWP apps

More analytic data for your UWP apps

If you go on the developer.microsoft.com/dashboard, click on your app then on analytics, you’re able to see some stats about your downloads:   You can see stats for each OS, but what about if you want to see stats about type of devices: mobile, desktop, xbox, hololens? Stats by device type To have this kind of information, you can go on: https://developer.microsoft.com/dashboard/analytics/reports/overview then click on change filter Select your application and click on device type: You will be able to filter your…

Read More Read More

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