TAG: UWP

WinDays 16 session: UWP XAML Behaviors

This was my fifth year in a row of speaking at the most important Microsoft conference in Croatia, WinDays 16, where I gave two session. The first one was about XAML Behaviors, and the second one was about Entity Framework Core 1.0 in UWP apps. This article has the presentation I gave about XAML Behaviors plus the link to the demos for that session. PowerPoint presentation: Link to GitHub demos: https://github.com/igrali/UWP-Behaviors-demo…

UWP DropImageBehavior - drag and drop photos using a behavior

I wrote a simple but useful UWP behavior that's based on the great XAML Behaviors SDK and allows easy, reusable way to add drag and drop support for photos. The idea is to just be able to define the behavior on the drop surface and set the target image object. Dragging and dropping images usually takes some code behind unless behaviors are used so it can be plugged in anywhere in XAML declaratively. Here's the code…

How to render an SVG file in XAML on Windows 10 UWP

GitHub timeline can be pretty useful if you follow the right people. :) Lately I've discovered a couple of great open source projects this way, and one of them is SvgForXaml. It's using Win2D to draw SVG files straight into XAML! There are a couple of easy steps to take in order to get this library up and running. As far as I can see, there's no Nuget package at the moment, so one way to add…

Tips and tricks for better and faster Windows 10 UWP apps

I gave a session today about "10 tips for better Windows 10 UWP apps" at the Microsoft Advanced Technology Days event in Zagreb, Croatia. It's a 2 day event with 400+ attendees and it's pretty cool. The PowerPoint presentation is in the post! This is a selection from a bunch of resources made available over the last couple of months, starting from Build Build presentations and videos Channel9 videos MSDN blogs (and others) MSDN documentation Visual…

Image attached properties to make x:Phase work with BitmapImage source

Today I wanted to do a pretty simple thing - use UWP x:Phase on an Image object inside a DataTemplate, but also set the DecodePixelWidth/DecodePixelHeight properties on a BitmapImage source to ensure that the decoded image width/height is optimal. Turns out, it's not exactly such a simple thing, so I wrote a couple of attached properties to make it simpler. This is what I tried to do: <Image x:Name="Image" Stretch=…

Make FQL queries from the latest Windows 10 Facebook SDK

Facebook integration is often a vital component of any app that requires some sort of social network integration. That's probably why Microsoft wrote and open-sourced a new one in July, even before Windows 10 got officially released. Yeah, it's on GitHub and it's a bit different than the one we were used to back on Windows Phone 8.1 (however, it also works on Windows/Windows Phone 8.1!), but the functionalities should (mostly) match. If…

Using SwapChainPanelRenderer to improve real-time rendering in Lumia Imaging SDK 3

In my previous blog post about PropertyDescriptions in Lumia Imaging SDK 3 I wrote some code for rendering effect results in real-time that wasn't really that good and resulted in performance issues. To be fair, the blog post was about using PropertyDescriptions so rendering was used only for a more complete demo, but as I was reading the documentation I noticed a couple of ways to improve the code I wrote. In that code, whenever the…

Get valid effect range using property descriptions in Lumia Imaging SDK 3

Lumia Imaging SDK 3 is finally out. The long awaited SDK that was blocking some devs from porting their Windows 8.1 apps to Windows 10 UWP is now available with great new performance improvements and new features, but also some breaking changes. Highlights of the release are definitely Windows 10 support and GPU image processing that brings the performance improvements, but many more changes were squeezed in - you can find more details in the…

Contextual (activity and proximity) state triggers in Windows 10 UWP

I read a great post about contextual sensing in the new Microsoft Universal Windows Platform on Windows blog yesterday. Parts of it sounded very familiar, and for a good reason - previously, on Windows Phone 8.1, Nokia released SensorCore for (some) Lumia devices, which allowed developers to tap into various sensors to learn more about user's activities, step count, places he or she frequently visited and so on. According to Rinku Sreedhar, Senior Program Manager…

Three ways to set specific DeviceFamily XAML Views in UWP

The new Universal Windows Platform brings a new feature known as DeviceFamily specific views which allows developers to define specific XAML views for specific device families (Desktop, Mobile, Team, IoT etc.). This can be really useful if you want to have major differences in your UI for different device families. Yes, RelativePanel is nice, and so are the VisualStateTriggers, but XAML can get really huge if you want to make major changes. This way we can…

Why is my zoomable ScrollViewer snapping the image to the left?

FlipView is an interesting control that can be easily used for scenarios such as image galleries. Other than flipping through a bunch of images, users normally expect to be able to zoom in and out, and we all now that zooming in and out is easiest to implement with a ScrollViewer with enabled ZoomMode property. However, the default behavior of the ScrollViewer is a bit unusual. Let's create s simple repro case. Let's define a very…

Full screen mode in Windows 10 Universal apps

Windows 10 Universal apps can run both in full screen mode and windowed mode (window can be maximized/resized when not in full screen mode). This means that we have new APIs to use and set the mode programmatically. ApplicationView class is extended with new properties and methods which makes it really easy to determine whether the app is running in full screen mode or not, and to change it (or at least try to!). Note…

How to use compiled bindings (x:Bind) from a resource dictionary

Compiled bindings (often just referred to as x:Bind) is a new type of binding mechanism in Windows 10 Universal Windows Platform (UWP) which does all the heavy lifting during compile time, instead of doing it during runtime via reflection, which improves performance significantly but also has some other benefits such as strong typing and compile time validation (no more typos in binding expressions and then scratching your head and going through Output window trying to…

Getting started with Cocos2d-x game development on Windows 10

Cocos2d-x is an open source game engine, licensed under MIT license, that allows developers to develop cross-platform games using C++ (or even JavaScript). iOS, Android, Desktop... no problem! However, for Windows Phone and Windows 8, and now Windows 10, Microsoft Open Technologies jumped in and contributed to the project to help making Cocos2d-x available on those new Windows platforms. Really big names use Cocos2d-x (like Zynga, Konami, Glu, Gamevil...) but also a bunch of indie game…

Drag and drop photos into Windows 10 Universal apps

The new Windows 10 platform brings drag-and-drop functionality to Windows Universal apps for scenarios such as dragging a document or a photo from a folder straight into app. It allows us developers to support more intuitive experiences. Find out how simple it is to drag and drop a photo from desktop into your Windows 10 Universal apps in the rest of the article. Note that that everything here is written using Windows 10 Technical Preview build…

Microsoft Certified Solutions Developer: Windows Store Apps in C#