Posted by: rcosic | 15/09/2009

Windows Apps 3.5 Exams Passed

Hello! I’ve just passed two more exams to get MCPD 3.5 D&D Windows Apps certificate!
The venture constisted of two exams needed to achive this, listed above:

  • 70-505 : TS : Microsoft .NET Framework 3.5, Windows Forms Application Developmentscored 978/1000, and
  • 79-563: Pro: Designing and Developing Windows Applications Using the Microsoft .NET Framework 3.5scored 971/1000.

And here are some of the topics and questions you might encounter on them:

70-505: Windows Forms on 3.5

You can expect several groups of questions:

- about multithreading (BackgroundWorker, DoWork method, picking up the results from thread execution),
- about controls and forms (MDI, inheritance chain, composite controls),
- printing (paging, printing controls),
- security (SafePrinting, lots of Vista-related questions!)
- installation (ClickOnce mostly is the answer, also MSI, versioning)…

70-563: D&D Windows Apps on 3.5

You can expect rather short questions (not typical for MCSD/MCPD certificates) describing a business case. You should, in most cases, propose one or more suitable strategies on how to solve the problem using one or more ‘trendy’ technologies provided by Microsoft. My suggestions follow:

- choose Microsoft Sync Framework when you have to deal with occasionally connected solutions (“have to work also on a local computer when offline..”),
- choose Microsoft SQL Server Compact Edition in case you have small portable scenario,
- choose the most ‘tough’ encryption algorythm in case you should protect data locally (Rijndael, TripleDES, etc.),
- learn how to migrate from Windows Forms to WPF and vice versa (ElementHost, WindowsFormsHost) -> hey, that’s the topic of my lecture!!,
- choose ClickOnce technology in most of the cases for installation scenario (if it does not include any GAC component or custom code),
- choose MicrosoftReportViewer in cases of reporting solution in most of cases (if not simple one),
- learn LINQ,  because you gonna need it for the exam.

Kind regards,
Ratko.

Posted by: rcosic | 10/09/2009

Migration to WPF

DevArena 2009

DevArena 2009

My new session is coming with a title:
Migration path towards Windows Presentation Foundation (WPF) platform – the client inteface of the future 

The lecture will be a part of the one-day developer conference organized by Ekobit in Zagreb (Croatia) on October 22 this year.

I will give a lecture with my colleage Dejan Martincevic, who is a professional web developer (MCPD) and also experienced in WPF. Together we will talk about how easy is to migrate to WPF taking several methodologies. Here is the summary of the session, so if you are interested and nearby Zagreb (Croatia), apply for it and join the session!

WPF technology offers us lots of revolutionary features, especially the important role plays XAML language which abstracts visualisation of user interface and experience (UX). As such, XAML becomes a building block not just for desktop apps, but also for web solutions by using Silverlight and other technologies (XPS documents, WF, etc.). It would be perfect if would be possible to begin with the new technology (such as WPF) from the scratch, but we know, it is not always possible – we do not live in the perfect world. This lecture will present exactly this tought – by using best practices of building client applications relying on Windows Forms, make our way for Windows Presentation Foundation platform – the client interface of the future!

What is good to know about the migration

  • there is not such thing as a ‘magic wand’ for doing the migration – of course, you can start to write your app from the ground up once again, but this is not an intention of the migration.
  • you can host the existing WinForms elements (windows, user controls, third-party and even ActiveX controls) inside a WPF application, as well as to host your WPF elements inside a Windows Forms application.
  • there are known issues regarding integration of WinForms via WindowsFormsHost into the WPF layout, such as: sizing, rotating, skewing, proportional scaling, layering (Z-Order), etc., that you should be aware of.
  • there is a helper class which you can use for reporting conditions of the browser environment for a WPF application that is hosted by a browser (BrowserInteropHelper).
  • there are controls which are not (yet) supported by WPF – MaskedTextBox, ImageList, LinkLabel; dialogs (ColorDialog, FolderBrowserDialog, FontDialog), date controls (DateTimePicker, MonthCalendar), printing controls (PageSetupDialog, PrintDocument, PrintPreviewDialog), and more others…
  • some of the controls are drammaticaly or just slightly changed, so you should be aware of all of these…
  • there are lots of documentation available on the internet about how to do it.
Posted by: rcosic | 11/08/2009

WPF : Geometry mini-language

It is really cool feature of WPF. Instead of typing lots of tags to describe visual elements in your GUI, you can just fill out the property Data of path element with special textual value. I like the way it is designed, because it gives somewhat old-school crypted form. The benefit is that it is short and very straightforward. Take a look!

Consider the following XAML code:

<Path Stroke=”Black”>
    <Path.Data>
        <PathGeometry>
            <PathFigure IsClosed=”true” StartPoint=”10,100″>
                <LineSegment Point=”100,100″ />
                <LineSegment Point=”100,50″ />
            </PathFigure>
        </PathGeometry>
    </Path.Data>
</Data>

And now, take a look on condensed “mini language” form:

<Path Stroke=”Blue” Data=”M 10 100 L 100 100 L 100 50 Z” />

Pretty cool, ha?

These are the commands for the Geometry Mini-Language:

F value - Sets the Geometry.FillRule property. Use 0 for EvenOdd, or 1 for NonZero. This command must appear at the beginning of the string (if you decide to use it).
M x,y - Creates a new PathFigure for the geometry and sets its start point. This command must be used before any other commands except F. However, you can also use it during your drawing sequence to move the origin of your coordinate system. (The M stands for move).
L x,y – Creates a LineSegment to the specified point.
H x – Creates a horizontal LineSegment using the specified X value and keeping the Y value constant.
V y - Creates a vertical LineSegment using the specified Y value and keeping the X value constant.
A radiusx, radiusY, degrees isLargeArch, isClockwise x,y  – Creates an ArcSegment to the indicated point. You specify the radii of the ellipse that describes the arc, the number of degrees the arc is rotated, and Boolean flags that set the IsLargeArc and SweepDirection properties.
C x1,y1 x2,y2 x,y - Creates a BezierSegment to the indicated point, using control points at (x1, y1) and (x2, y2).
Q x1,y1 x,y - Creates a QuadraticBezierSegment to the indicated point, with one control point at (x1, y1).
S x2,y2 x,y - Creates a smooth BezierSegment by using the second control point from the previous BezierSegment as the first control point in the new BezierSegment.
Z - Ends the current PathFigure and sets IsClosed to true. You don’t need to use this command if you don’t want to set IsClosed to true – instead, simply use M if you want to start a new PathFigure or end the string.

* The text was taken from the book: “Pro WPF in C# 2008″ by Mathew McDonald. Really must have book!

Older Posts »

Categories