File Open Picker in Windows Phone 8.1

February 18, 2015

The Windows 8 Store model introduced the FileOpenPicker class, which is kind of the modern replacement for the classic Windows open file dialog. Technically, it’s more than that – it can get files from “virtual” locations such as Facebook and OneDrive; and besides, it looks much better than the classic open file dialog. Showing the FileOpenPicker is just a matter of calling PickSingleFileAsync or PickMultipleFilesAsync and awaiting for the result: var picker = new FileOpenPicker {         FileTypeFilter = { ".jpg", ".png" },         ViewMode = PickerViewMode.Thumbnail }; var file = await picker.PickSingleFileAsync();   When Universal apps came along, it...
no comments

Tip: Enable Kernel Debug output on Vista and up

December 17, 2014

Those writing device drivers, or are interested in seeing outputs from a kernel driver’s calls to the KdPrint macro or the DbgPrint function may find that the messages don’t appear on Windows Vista or newer versions of Windows. Even when using a tool such as DebugView (from SysInternals), running with administrative privileges, with kernel capture turned on, nothing seem to appear from expected drivers: The reason is that in Vista and up kernel output is conditional, based on some flags that can be set in KdPrintEx, DbgPrintEx, etc. A complete explanation can be found in the MS...
no comments

Introduction to Win2D

November 19, 2014

The Windows Runtime UI stack uses XAML for general 2D layout and graphics. It provides various controls, such as TextBox, ItemsControl and DatePicker. It even provides shape-like elements such as Line, Ellipse, Rectangle and Path. However, the XAML layout and rendering engine, while flexible, may not be performant enough for certain kind of applications and games. Also, it does not support general “drawing” functions (WPF for example, does provide that with the DrawingContext class). Win2D is a new Windows Runtime library that is currently in development by Microsoft that provides a WinRT wrapper over Direct2D. Direct2D is a DirectX...
no comments

WRL Class Library Template for Windows Phone 8.1

October 6, 2014

The Windows Runtime Library (WRL) is a C++ class library that can be used to author Windows Runtime components in standard C++, without resorting to the C++/CX extensions. The flip side is that it’s much more verbose than C++/CX, looks somewhat similar to authoring COM components with the Active Template Library (ATL). Also, WRL can be used to consume WinRT types without any special extensions. Visual Studio does not provide a project template out of the box for authoring WinRT components with WRL. The team at Microsoft, however, created such a template back in the Windows 8, Visual Studio...
no comments

Windows 10 Preview – First Impressions

October 1, 2014

The curtain is lifted… Microsoft’s new OS is revealed in all its preview – Windows 10. Yes, the name is unexpected. Better guesses were “Windows 9”, “Windows One”, just “Windows” and probably a few others. I admit I don’t like the “10” name. Even-numbered Windows names/versions lately tend to have issues… To install Windows 10 all you need to do is go to , register as an “insider” (which really means anyone), download the bits and install. Of course, I would not use it on a production system. I installed mine on a Hyper-V virtual machine (I’ve used...

“Universal” Mandelbrot

September 10, 2014

Those of you following my blog may have noticed a somewhat “obsessiveness” with the Mandelbrot Set. In the past, I’ve created a WPF version and a C++ AMP version (and privately a few more versions). I thought it was high time to write yet another version as a “Universal” app, running on Windows 8.1 and Windows Phone 8.1, while sharing as much code and XAML as possible. My approach was to port the WPF version to universal. First, I created a blank new Universal App project in C#: This results in 3 projects being created – Mandelbrot.Windows, Mandelbrot.WindowsPhone...
no comments

Tip: Accessing Binary Resources in Portable Class Library

August 10, 2014

Portable Class Libraries (PCLs) provide a nice way to share code by allowing the library to be referenced from a number of different types of projects. As I’ve blogged before, when targeting Windows Phone 8.1 and Windows 8.1 the common surface for the PCL grows significantly and even allows sharing of XAML and other UI-related types. However, when targeting more frameworks such as the desktop .NET, the common surface drops significantly. One of the things we may want to do is to add some binary resource (image, XML file, etc.) and process it as part of the PCL. This...
no comments

Data Binding for a WPF TreeView

July 12, 2014

Although the Windows Runtime (WinRT) is all the hype these days (in the Microsoft world at least), WPF is still in heavy use in the “desktop apps” space. To me, WPF is the inspiration for everything XAML-based that came out after it – mainly Silverlight and WinRT. WinRT (and Silverlight before it) still plays catchup to all the WPF features (although WinRT has some nice features not present in the current version of WPF) – there’s even a “user voice” asking to bring some of WPF’s features to WinRT, such as multi bindings, binding in style setters, data typed...
one comment

My DevGeekWeek 2014 Session Demos

June 22, 2014

Today I presented three sessions in the DevGeekWeek 2014 conference held in the Daniel Hotel in Hertzliya (Israel). The session were part of the Core .NET and C# track. My three sessions were on the Task Parallel Library (1), Async programming with C# 5.0 (2) and C# Tips with some discussion of C# 6.0 features (3). Another session was given by my colleague, Igal Tabachnik on building compiler extensions with Roslyn. Thank you all for attending, although I know it was challenging in the first half day, at least, with the A/C cranked up (or should I say...
no comments

DevGeekWeek 2014

May 26, 2014

The DevGeekWeek 2014 conference is scheduled for the 22-26 of June and will be held in the Daniel Hotel in Hertzelia (Israel). This is a developer oriented conference with a lot of great sessions and topics. We at CodeValue are managing and delivering the .NET track (officially called “Extreme .NET with C#”) consisting of 6 full day sessions. There are other tracks covering things like mobile development, Java based development, User Experience, Database development, and more. I am managing the CodeValue sessions along with my colleague Alon Fliess. Our track consists of the following full day...