Skip to content
wpdev

.NET / C#

wpdev

[UWP] NavigationService with back button handler priority

2016-02-21
By: Kevin Gosse
On: February 21, 2016
Tagged: .NET, C#, universal apps, WinRT, wpdev

There’s an issue I’ve encountered in every single of my UWP applications, so it’s very likely you know about it. In Universal Apps, you can subscribe to the SystemNavigationManager.GetForCurrentView().BackRequested event. It’s usually done firsthand to mimic Windows Phone’s behavior where pressing the back button loads the previous page in the back stack. So far, so good. But then comes the moment when you need to implement a back button behavior that is specific to a page. For instance, you have a popup and you want to dismiss it when the user presses the back button. So you subscribe once more to the SystemNavigationManager.GetForCurrentView().BackRequested event, implementRead More →

[UWP] Bandwidth adaptive image control

2016-01-13
By: Kevin Gosse
On: January 13, 2016
Tagged: .NET, C#, universal apps, WinRT, wpdev

There’s a dilemma you probably faced if you’ve written a mobile application displaying a large number of pictures. You could display gorgeous hi-resolution pictures, but if you do so, you’ll provide a poor experience to users who use your app on the go. Particularly, users with a poor mobile connection who will have to wait minutes before the pictures are displayed. You may also discontent users with limited data plans, who don’t want to eat gigabytes of data just to display your pictures. On the other hand, if you settle for low-resolution pictures, you’ll provide a sub-optimal experience you are at home, with an unlimited andRead More →

[uwp] Animation orchestration using Caliburn.Micro coroutines

2015-10-25
By: Kevin Gosse
On: October 25, 2015
Tagged: .NET, C#, Caliburn.Micro, universal apps, wpdev, xaml

MVVM is a commonly used design pattern for XAML-based applications (WPF, Silverlight, and now WinRT). I won’t go into a full description of the pattern, but I’d like to spend some time on a design issue I’ve encountered ever since I’ve started Silverlight/WinRT development. The issue Everybody will tell you: nowadays, for a good UX, animations are a must-have. XAML applications have a very powerful animation system based on storyboards, but it doesn’t fit well with MVVM. How so? One of the recommendation when using the MVVM pattern is to make a clear separation between the viewmodel and the view. The viewmodel should have noRead More →

Should I await the last call in a method

2015-09-12
By: Kevin Gosse
On: September 12, 2015
Tagged: .NET, C#, WinRT, wpdev

I came to write a code looking like this: Then I stepped back a bit and thought: OnNavigatedTo is an event, and its return type can’t be changed from void. Therefore, is there a point in awaiting the last asynchronous call of the method, as this will provide no information at all to the caller? Would it result in a useless call to the dispatcher, just to execute an empty callback? Actually, is the compiler smart enough to detect this case and remove the seemingly useless await? Understanding what’s going on How to figure out whether the last await call has any impact? Let’s say I add some code atRead More →

Debugging Visual Studio from Visual Studio

2015-09-05
By: Kevin Gosse
On: September 5, 2015
Tagged: .NET, Visual Studio, Windows 10, wpdev

When used to install various extensions and beta SDKs on your development machine, it often occurs that Visual Studio starts acting erratically, even to the point of stopping working. Sometimes, the workaround can be easily found by browsing through specialized websites, sometimes it can be much harder because you’re lacking information on the precise issue. That’s when trying to debug your IDE can help putting you in the right direction. I encountered such situation today, so I thought it would be interesting to share the few steps I had to go through. The symptoms It all started when trying to create my first Windows 10 project onRead More →

Label placement issue in Telerik RadCartesianChart

2015-08-30
By: Kevin Gosse
On: August 30, 2015
Tagged: .NET, C#, Silverlight, Telerik, wpdev

This is a strange corner-case in the way Telerik’s RadCartesianChart control handles the placement of labels. There is very little chance that you ever meet this bug, but if you do it can be quite unsettling, and that’s why I chose to cover it in this post. The setup First, what is this bug about? Let’s start by displaying a simple chart. The only twist here is that I use a converter to display the labels, because I want the user to be able to change the format dynamically: Nothing fancy in the converter: it parses the input if it’s numeric, then calls string.Format withRead More →

Dispatcher.Yield – When and how to use it on WinRT

2015-05-15
By: Kevin Gosse
On: May 15, 2015
Tagged: .NET, C#, WinRT, wpdev

That’s an issue happening from time to time. You need to do some lengthy computation on the UI thread (for instance, a page navigation), and you want to display a progress indicator to ease up the user waiting. It’s possible on WinRT thanks to the compositor thread: a dedicated thread for animations that don’t impact the page layout, making them run smoothly even when the UI thread is busy. Some built-in controls automatically use the compositor thread, such as the ProgressRing. So, what the issue could be? Letting the UI refresh Let’s say that when the user taps on a button, we want to displayRead More →

Ken Burns effect with WinRT

2015-03-28
By: Kevin Gosse
On: March 28, 2015
Tagged: C#, WinRT, wpdev

In a mobile application, we often face the challenge of fitting a large picture in a limited, fixed-size space. One of the common solutions is to generate a thumbnail, but depending on the ratio of the picture the result will not necessarily meet the quality standards. In my case, I decided to try an alternative approach and mimic the built-in effect when pinning a picture as a secondary tile on Windows Phone, where the picture slowly scrolls from top to bottom (Ken Burns effect). There is no control on Windows Phone to produce this kind of effect, so I had to put together my own. FirstRead More →

Windows 10 SDK – SplitView

2015-03-03
By: Kevin Gosse
On: March 3, 2015
Tagged: C#, Windows 10, WinRT, wpdev

Another new addition to the Windows 10 SDK is the SplitView. It’s used to display a side menu, such as the one usually called “hamburger menu”. It’s quite straightforward to use. The “Pane” property contains the code of the menu itself. The page content goes into the control itself. The “OpenPaneLength” sets the width of the menu. Lastly, the “PanePlacement” property indicates on which side of the page the menu will appear (currently limited to left and right, top and bottom doesn’t seem to be supported). The menu is opened by setting the “IsPaneOpen” property to true, and closed when the property is set toRead More →

Windows 10 SDK – StateTriggers and RelativePanel

2015-03-02
By: Kevin Gosse
On: March 2, 2015
Tagged: universal apps, Windows 10, wpdev, xaml

While the Windows 10 SDK is still unavailable, and will likely remain so until the Build event in April, Microsoft allowed developers at Mobile World Congress to briefly try an early preview of the SDK. Two novelties have been publicly revealed: StateTriggers and the RelativePanel. I’ll present in this post all the information I could gather about those two features. StateTriggers Anyone who has used Visual States, be it manually or using Blend, will probably agree: the syntax is unnecessarily verbose, and having to use a storyboard to change even simple properties quickly gets tedious. The situation has been going on for a while, but with universalRead More →

Posts navigation

1 2 3 Next

Recent Posts

  • Uncovering a bug in Attribute.GetHashCode
  • [UWP] NavigationService with back button handler priority
  • [UWP] Bandwidth adaptive image control
  • [uwp] Animation orchestration using Caliburn.Micro coroutines
  • Should I await the last call in a method

Archives

  • March 2017 (1)
  • February 2016 (1)
  • January 2016 (1)
  • October 2015 (1)
  • September 2015 (2)
  • August 2015 (1)
  • May 2015 (1)
  • April 2015 (1)
  • March 2015 (3)
  • October 2014 (1)
  • September 2014 (1)
  • November 2013 (1)
  • August 2013 (1)
  • May 2013 (1)
  • February 2013 (1)
  • December 2012 (1)
  • October 2012 (2)
  • July 2012 (1)
  • May 2012 (1)
  • February 2012 (1)
  • January 2012 (4)

Follow me on Twitter

My Tweets

Designed using Dispatch. Powered by WordPress.