DCSIMG
XAML - Pavel's Blog
Sign in | Join | Help

Pavel's Blog

Pavel is a software guy that is interested in almost everything
software related... way too much for too little time

Browse by Tags

My Wish List for Windows “Blue”
17 May 13 05:48 PM | pavely | with no comments
Many rumors are flying around at this time about the upcoming release of Windows 8.1 (code named “Blue”, which represents a wave of product updates, including Windows Phone and others). I thought I‘d state my hopes for this release, not just in terms of user features, but also from a developer’s perspective. As a developer, I spend most of my time on my trusty laptop, not some tablet based device. Naturally, the desktop world is my friend. The Windows 8 Start screen is close to perfect for tablet...
XAML as DSL
05 May 13 04:14 PM | pavely | 2 comment(s)
About 3 years ago, when .NET 4 and Visual Studio 2010 were just released, I’ve blogged (part 1, part 2) about the changes that took XAML from its WPF inception to the System.Xaml namespace and System.Xaml.Dll assembly, to be available more generally, not just for WPF. I’ve shown that XAML is just a declarative way of creating objects, setting their properties – sometimes in interesting ways. I did promise at the end of that second post that I’d show how to use attached properties, but never did have...
תגים:, , , , , ,
Windows Phone 8 Dev Camp
22 April 13 03:13 PM | pavely | with no comments
A few hours ago, Ariel Ben Horesh and myself presented two sessions for Windows Phone 8 development at Microsoft offices in Ra’anana (Israel). Thank you all for attending! It was fun – it was the second time I presented with someone else (Ariel) at the same time… we had no time to rehearse, but it was great! The code we showed can be found on github at https://github.com/arielbh/RightMyGuide . The slides links are below. Enjoy! BTW, the IMDB service I created to run on Azure will not be up forever...
Webcasts on Windows Phone 8 development
27 March 13 09:51 AM | pavely | with no comments
Recently, I’ve done two sessions on Windows Phone 8 development, that are available on YouTube . If you’re new to Windows Phone, these sessions may help you to get started. The session are in English and are comprised mostly of coding examples. A third session is planned to happen about 2 weeks from now. First session: Second session: Enjoy!
XAML Tip: Graphics with ItemsControl
23 February 13 12:04 AM | pavely | with no comments
Sometimes in a WPF or Windows Store or Windows Phone application we need to draw some things based on some collection of data items. Suppose we have the following simple data item: class CarData { public double Distance { get; set; } public string Image { get; set; } } Suppose we have a collection of CarData objects, and the requirement was to show a set of images along a line with a particular distance, like in the following screenshot: The distance from the left is determined by the Distance property...
Preview of Blend 5 available
25 December 12 03:41 AM | pavely | with no comments
When Visual Studio 2012 came out, one thing was sorely missing. An Expression Blend tool that can handle WPF 4.5 applications. Blend for Visual Studio that is currently available only supports Windows 8 Store Apps, but not WPF (or Silverlight). A few days ago, Microsoft released a preview of Blend 5 (with Sketchflow), that’s able to work with WPF and Silverlight, along with Windows 8 Store apps. The tool can be downloaded from here: http://www.microsoft.com/en-us/download/details.aspx?id=30702 Microsoft...
Windows Runtime: Where did TemplatePart go?
13 December 12 03:39 AM | pavely | with no comments
In WPF and Silverlight, controls define their named parts (those that have them) using the TemplatePart attribute. For example, here’s the class definition for the WPF ProgressBar control: [TemplatePart(Name = "PART_Track" , Type = typeof (FrameworkElement))] [TemplatePart(Name = "PART_GlowRect" , Type = typeof (FrameworkElement))] [TemplatePart(Name = "PART_Indicator" , Type = typeof (FrameworkElement))] public class ProgressBar : RangeBase { This indicates to those...
Windows 8 Store apps with C++/CX: thoughts & tips
05 October 12 02:47 PM | pavely | with no comments
I’ve been working on Windows 8 apps lately using C++, not C#. I’ve been doing a lot of C# work in the past few years, and I must admit I love the elegance of C# and the productivity of .NET, not to mention the powerful toolset bound with Visual Studio. Still, ever since WinRT was introduced, the idea of using native code only had its appeal. Even if the app does not require special libraries, such as DirectX or C++ AMP , native code has less overhead and lower memory consumption compared to a .NET...
Windows 8 & Phone 8 UG August Meeting
29 August 12 11:22 PM | pavely | with no comments
Last evening we had a User Group meeting in Microsoft Offices in Ra’anana, with a lot of activity and fun. Thank you all for participating! In the first part, we discussed the Windows 8 Store from various angles, end user and developer. In the second part, we discussed Windows Phone 7.x and the upcoming 8, along with other sporadic topics - C++, WinRT, DirectX, COM, XNA, XAML… it was fun! And don’t forget the giveaways! Just as a gentle reminder, out next meeting is on September 13th , where we’ll...
Can Windows 8 Apps Share Memory?
21 August 12 04:52 PM | pavely | 4 comment(s)
Windows 8 Applications (formerly Metro) run inside a sandbox, making communicating with other application difficult at best. There is no easy way to do it, and for good reason, too. When one app is running, all other may be suspended, so what’s the point of communicating anyway? Furthermore, there is no guarantee that the other app even exists on the machine. Still, suppose we wanted to share some information (I’m not talking about the standard share contract) via (say) shared memory. Can we achieve...
WPF Tip: Attached properties and bindings
12 May 12 10:04 PM | pavely | 1 comment(s)
Attached properties are a great way to extend capabilities of existing elements without the need to derive or otherwise tinker with those elements. Suppose we create an attached property that is a collection of objects of some particular kind. When that property changes, those objects are read, and that special functionality is applied. Here’s a hypothetical example of such a scheme: public static class SomeHelper { public static DemoCollection GetData( DependencyObject obj) { return ( DemoCollection...
תגים:, , ,
WPF 4.5 Cookbook
26 April 12 07:40 PM | pavely | with no comments
A few months back, I was approached by Packt publishing , asking me to write a WPF book, in their “cookbook” style, and I accepted. I haven’t written an entire book before, but I have written dozen of courses for Hi-Tech College, John Bryce Training and now for CodeValue , in a range of topics, from Windows Internals and device driver development, to advanced C++, to basic and advanced .NET topics, to WPF, and even some oddities such as the Windows Media Foundation . Writing a book, however, is different...
WPF 4.5: Markup Extension for Events
07 April 12 06:34 PM | pavely | with no comments
One of the new features coming in WPF 4.5 (already available through the Visual Studio 11 Beta and .NET 4.5 Beta) is the ability to create markup extensions that work on events (as opposed to properties, which have always had this capability). Markup extensions for properties are crucial, and there are quite a few useful ones, such as {Binding } and {StaticResource} . Would this ability be useful for events? One such case is when a command is needed to be invoked ( ICommand ) because of some event...
תגים:, , , , ,
Towers of Hanoi–WPF Style (Part 2)
13 February 12 10:45 PM | pavely | with no comments
In the first part , we saw how to recursively solve the Towers of Hanoi problem in C#. In this post I want to show a graphic view of the solution. This is a starting position with 7 discs: This is how it looks when the problem is solved: In between, the discs move with animation from pole to pole, as the solution dictates. Options include speeding up the process (with the slider, very useful), pausing the animation and resetting to the initial state. Here’s something in the middle: The Poles The...
A UniformGrid for Silverlight/Windows Phone
07 February 12 10:00 PM | pavely | 1 comment(s)
The UniformGrid panel in WPF has some useful features, especially as an items panel in an ItemsControl . I blogged about the usefulness of the UniformGrid here . But what about Silverlight? It has no UniformGrid , but we can create one as a custom panel. This would be usable in Silverlight for the desktop and for Windows Phone, and would be a simple enough example to show in one post. The layout process In WPF/Silverlight, layout is a two step process. The first step is Measure: the panel asks each...
More Posts Next page »