Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

10 Mar 2006 - Developer Blogs in United Kingdom

<March 2006>
SunMonTueWedThuFriSat
1234
567891011
12131415161718
19202122232425
262728293031

Blog Entries (10 Mar 2006) RSS << Earlier | Later >>

  • Creating Images from Raw Pixel Data in WPF

    Published on 10 Mar 2006 from

    One of the restrictions I've often run into with GDI+ is that it makes life awkward if you want to work with raw pixel values. (E.g., for generating images from scratch or performing image processing.) It's possible, your two options being (1) the GetPixel and SetPixel methods, or (2) LockBits and UnlockBits. The first option is abominably slow if you're dealing with large volumes of pixels - you call the methods for every single pixel. The second approach requires unsafe code, which rules out partial trust scenarios, and leaves me with an uneasy tense feeling - I prefer to write verifiable code whenever possible.

    In WPF, things are better.

    WPF lets you pass in a big array of pixel values to create a new BitmapSource. It also offers CopyPixel methods that copies pixel data out of the bitmap into an array.

    This means you can write verifiable code that generates or process pixel data efficiently. Here's a very simple example:

    double dpi = 96;
    int width = 128;
    int height = 128;
    byte[] pixelData = new byte[width*height];
    
    for (int y = 0; y < height; ++y)
    {
        int yIndex = y * width;
        for (int x = 0; x < width; ++x)
        {
            pixelData[x + yIndex] = (byte) (x + y);
        }
    }
    
    BitmapSource bmpSource = BitmapSource.Create(width, height, dpi, dpi,
        PixelFormats.Gray8, null, pixelData, width);

    This creates a BitmapSource of a linear gradient fill from black to white from top left to bottom right. Yes, there are much easier ways to do that in WPF, but the point here is to illustrate how you can take raw pixel data and turn it into a BitmapSource.

    Once you've got a BitmapSource you can then use it, say, to set the Source property of an Image element in order to display the bitmap:

    <Image x:Name="imageDisplay" />
    
    ...
    
    imageDisplay.Source = bmpSource;

    And of course you can use with an ImageBrush, or do all the other things you can do with bitmaps in WPF.

  • Mars orbiter reaches Red Planet

    Published on 10 Mar 2006 from

    The US space agency's latest Mars probe successfully places itself in an orbit around the Red Planet.

  • Managed Exchange services

    Published on 10 Mar 2006 from

    I was looking around the Exchange home page today and noticed that we're now offering a managed Exchange service through Frontbridge.  This is a great idea for those who don't want the worry of managing their Exchange environment at their own premises, and want to  switch to a totally hosted solution.  To take the worry away so to speak, and let someone else manage the uptime requirements for you.

    I'm not all that specialised in Hosted Exchange technologies, so I can't evangelise about this effectively... Are there good Hosted Exchange guys who would be interested in working in the UK as a hosting evangelist at some stage in the future?  I wonder if I need to increase the size of my team...?

    By the way -   This is a different offer than the Managed Exchange offer in conjunction with MOM.  The Managed Exchange Offer: The new smart way to buy Exchange Server. Customers can now buy a ‘Managed Exchange Server’, combining the world’s leading messaging server with Microsoft’s most advanced monitoring and management tool, Microsoft Operations Manager (MOM) 2005. There are two new Managed Exchange products, Standard and Enterprise editions, which include both the full Exchange Server 2003 product and the Operations Manager License (OML) needed to monitor and manage your business-critical messaging environment.

    From March 1–August 31, 2006, Microsoft Select and Enterprise Agreement License program (non-Academic) participants can enjoy the following worldwide promotion:  Improve your management experience with Exchange Server 2003 by purchasing a promotional offer for Managed Exchange. This promotion allows customers to purchase a "Managed Exchange" server that includes the rights to be managed by MOM 2005 and a free copy of the MOM 2005 Server.  

  • Just how many buttons do you need?

    Published on 10 Mar 2006 from

    When Frontrow was announced Steve Jobbs made a point of saying that the Apple remote was so much better than the Media Center remotes because it had nowhere near as many buttons. In fact is has 6 buttons. Volume up and down, forwards and backwards. Play/Pause and menu. This works great for things like the music part of the application. The video player works fine too. So do the pictures. The DVD player on the other hand is another matter. How the hell do you navigate DVD menus? I've tried and I can't figure it out. At the moment as far as I can see Frontrow is utterly useless as a digital media hub for your home. So close, and yet so far. Add the fact that you can't make Frontrow region free and so far my DVD player choices are this: Fork out £600 for a Mac Mini (plus cables) or £30 for a DVD player. Outclassed by a disposable DVD player, now that's a massive failure for Apple.

  • Fuels cells to change laptop use

    Published on 10 Mar 2006 from

    Laptop computers could soon run all day without recharge as commercial versions of fuel cells go on sale.

  • Fuel cells to change laptop use

    Published on 10 Mar 2006 from

    Laptop computers could soon run all day without recharge as commercial versions of fuel cells go on sale.

  • Expression Interactive Designer and Graphic Designer March CTP

    Published on 10 Mar 2006 from

    Psst - don't tell anyone - but the March release of Expression Interactive Designer ("Sparkle") and Expression Graphics Designer ("Acrylic") are now available. These releases are compatible with the February CTP of the WinFX Runtime Components, just to confuse everyone :)

    As a quick reminder, Expression Interactive Designer is the designer-orientated tool for building WPF user interfaces; Expression Graphics Designer is a vector and bitmap graphics tool that happens to offer a very nice XAML export function. (For completeness, we also have some extensions for building WinFX applications using Visual Studio, available from the MSDN WinFX site.)

    One caveat that you might want to be aware of: the February CTP of the Visual Studio Extensions for WinFX shipped with a bug in how it handles markup compatibility namespaces.  This bug manifests most quickly if you use the Expression Interactive Designer March CTP on the same XAML file. We've added a hotfix into the February CTP and have slipstreamed the fix into the download site. This will be available in the next day or two, and I'll add a further announcement when that happens. For now, don't expect seamless interoperability between the two tools.

  • Microsoft faces new fines threat

    Published on 10 Mar 2006 from

    Microsoft could soon face daily fines as its efforts to comply with a 2004 anti-trust ruling are "inadequate", Brussels warns.

  • Windows Mobile 5: How do I set a static IP for wifi on my smartphone?

    Published on 10 Mar 2006 from

    My i-mate SP5 has WLAN, Wi-Fi, whatever you want to call it. It still runs the smartphone edition of Windows Mobile 5, where things are a bit different from the Pocket PC stuff, apparently. I can’t figure out a way to set a static IP for that WLAN connection. I guess I could probably go [...]

  • SXSW - I've arrived

    Published on 10 Mar 2006 from

    As I'm here for free, and there's a couple of people who've asked me to, I'm going to blog as much as I can about South by South West.

    The travelling was hard work. The first flight (Gatwick to Atlanta) was fine. I had to wait 6 hours in Atlanta, which I was dreading, as I thought it was underwater. It wasn't, so I guess they've drained it. It was only supposed to be a 5 hour wait, but we had to let Air Force One jump the queue. I got to see it take off from my seat, which was vaguely interesting. It's just like a normal plane, but with the stars and stripes on the tail. They've done a good job rebuilding it since it was shot down in 24.

    I've broken some personal bests. In one day, I've been the furthest north, the furthest south, and the furthest from home that I've ever been.

    There hasn't been much going on yet today. I've registered, and received a nice canvas bag full of flyers and magazines and stuff. I've used several of the Hilton's facilities, which is great, as I'm not even staying there. I'm staying in the "Best Value" on Interstate 35, which is good on value, but not so good on best. Still, it's all I need - bed (2 in fact - I might sleep in the other one tonight), TV (57 channels and nothing on), and breakfast.

    America is such a foreign country. Nobody understands my accent first time, so I'm putting on an American accent to make myself understood: "water" becomes "warder", "coffee" becomes "cwaffee" etc. Everything is similar but slightly different. This keyboard has the @ where the " should be. I've had to ask how much to tip the taxi cab driver, and I'm going to have to ask about crossing the road.

    Anyway, more to follow when I've actually been to something...

  • Hm… Here’s the reason why ActiveSync was killing my settings

    Published on 10 Mar 2006 from

    I’m glad I know Sarah Blow and she’s got better eyesight than me, apparently  – okay, and a lot more experience with Windows Mobile. She found the problem I had with ActiveSync immediately and pointed me to a setting in the Connection Settings dialog (File ¦ Connection Settings), called This computer is connected to. This [...]

  • Here’s Something That’s Been Done Before…

    Published on 10 Mar 2006 from

    …but it’s worth doing again, ‘cos it’s fun. I’ve created a little mashup that gets realtime(ish) info from the USGS regarding earthquakes and then plots them on a Google map control. You can click on the pin to get more information on the quake, or you can select to get an aerial view of the [...]

  • Windows Mobile 5: Why does ActiveSync kill my settings?

    Published on 10 Mar 2006 from

    I have this nice new i-mate SP5 phone, which runs Windows Mobile 5. My desktop PC, to which that phone is usually connected with ActiveSync, has the ISA Server firewall client installed and the proxy settings in Internet Explorer come from that client automatically. So far, so good. Now, as soon as I connect the phone [...]

  • Technology vs Business vs Process

    Published on 10 Mar 2006 from

    Joel Spolsky says he looks to recruit people who are "smart" and who "get things done".

    Joel seems to focus on the technology, but I think people who are "smart" understand the technology and the business problem the technology will solve, and how to best combine the two.

    People who "get things done" understand how deliver the solution. They might learn about techniques such as agile methodologies to support them, but the important thing is they actually deliver something.

    These can be represented on the following Venn diagram:



    Many people are great at one of these, sometimes two, but if you want to be able to deliver successful projects, you need to maximise the area of intersection of all three circles, and expand your smallest circle until it is the size of the others. If you as an individual prefer one circle to the others, make sure that others you work with can balance the sizes of the circles.

  • BTS Diary II - 2: Mapping error notes

    Published on 10 Mar 2006 from

    Im posting this here in case anyone comes across this error and cant figure it out. While validating a map you may get an error saying "Cannot load source/destination schema: Either the file/type does not exist, or if a project dependency exists, the dependent project is not built"  .

    I got this when creating a map which referenced an external schema (compiled into a DLL) and another schema in a project in the same solution. I had directly tried to 'validate' the map before checking that the local schema project had compiled successfully. Of course, there was no DLL to pick up only a namespace and hence the error (sheepish grin!)

  • BTS Diary II - 2: Mapping error notes

    Published on 10 Mar 2006 from

    Im posting this here in case anyone comes across this error and cant figure it out. While validating a map you may get an error saying "Cannot load source/destination schema: Either the file/type does not exist, or if a project dependency exists, the dependent project is not built"  .

    I got this when creating a map which referenced an external schema (compiled into a DLL) and another schema in a project in the same solution. I had directly tried to 'validate' the map before checking that the local schema project had compiled successfully. Of course, there was no DLL to pick up only a namespace and hence the error (sheepish grin!)

  • Uk Traffic Map Gadget

    Published on 10 Mar 2006 from

    Checkout this really nice example of using the Mappoint Web Service and also the Backstage.bbc.co.uk service to bring an interactive traffic map to your browser, or to www.live.com as a gadget (http://microsoftgadgets.com/forums/3399/ShowPost.aspx)

    http://traffic.dotnetsolutions.ltd.uk/

    Ian

  • Total home control within reach

    Published on 10 Mar 2006 from

    Smart homes where everything can be controlled at the touch of a button are becoming more affordable.

  • Microsoft Moon

    Published on 10 Mar 2006 from

    Do you remember Google Moon?

    Just spotted this in the MapPoint Web Service Api:  MapPoint.Moon Data Source - not sure how long it has been there, but it's a shame it doesn't support routing.  From the docs:

    Rendering maps of a route, for example, the path of a lunar rover, is not available with the MapPoint.Moon data source.

    Ian

  • Jobs ahoy!

    Published on 10 Mar 2006 from

    Arrr me hearties! There be treasure aplenty in the jobs below, so get yer diggin' irons aready and apply away! Remember that X marks the spot! (Can you tell there has been a pirate theme here at the fortress this week?)

    Computer Support Officer


    The University of Edinburgh
    £13,966 – £16,411

    As part of a small team, you will be responsible for first line support of EPCC staff and projects, systems and networks. This position will require a professional and courteous approach at all times, in addition to disciplined and methodical work practices. You will operate a helpdesk system, resolving incoming support requests where possible, and escalating to senior colleagues where appropriate. As well as responding to support requests in a timely and effective manner, you will carry out routine operational tasks (e.g. account creation, machine installation and simple troubleshooting) within a multiplatform (MS Windows, Sun Solaris, RedHat Linux) environment.

    Experience of installing and configuring either Windows XP or any flavour of Unix-like operating system within a multi-platform, multi-user environment is essential. A strong personal interest in computing is desirable as well as having good communication skills and the ability to work effectively within a team.

    Ref:3005614SC.

    Closing date:24 March 2006.

    jobs.ed.ac.uk

    NeSC Project Manager


    (EGEE Training Activity)
    £31274 - 36959

    A highly motivated individual, with expertise in computing and excellent communication skills, you will join an expanding and exceptionally successful team at the National e-Science Centre (NeSC). You will take on the role of further developing the team and its role in the largest European Union Framework Programme 6 project (EGEE, 35 M Euro) which is focussed on creating a round-the-clock production grid backbone to support European e-Science. The project has developed world leadership in this area.

    NeSC leads the training in this programme which will involve 35 partner institutes throughout the world and a team of eight at NeSC. You will be able to grasp the breadth of technical knowledge needed and lead and strengthen collaborations based on existing excellent relationships.

    Joining a very successful and dedicated international team, you will develop a deep technical understanding of a fast moving area of computing. It offers close networking with international research leaders. This is a fixed-term post for two years.

    Ref:3005609SC.

    Closing date: 31 March 2006.
    www.jobs.ed.ac.uk

    ICT Technician


    GEORGE HERIOT'S SCHOOL

    We are looking for an ICT Technician to join our team which administers and supports the network infrastructure and its staff and pupil users in a key area of the School's provision. George Heriot's School operates a Windows 2003 Server platform with all clients running Windows XP Professional. Day to day duties will include identification and resolution of PC, e-mail and Printer problems, MS Office queries and telephone support, requiring a proactive approach, good technical skills, individual initiative and good teamwork and interpersonal ability.

    Lauriston Place
    Edinburgh
    EH3 9EQ
    Tel: 0131 229 7263
    Fax: 0131 229 6363
    Email: enquiries@georgeheriots.com

    Web Content Developer
    Edinburgh University
    £20,044 – £30,002

    A key member of the team charged with the development of the University's corporate web site, you should be capable of creating and sub-editing marketing orientated content, have strong web design and HTML coding skills, and be familiar with common web publishing technologies. A minimum of two years' experience is required.

    Ref:3005626SC.

    Closing date: 27 March 2006.

    ICT Support Analyst


    £18,715-£24,797 pa

    As part of a team, you will provide customer facing 2nd/3rd line technical support to ICT users, support the Library's Integrated Library System and provide technical support to the Library's digitisation programme. You will have the ability to respond to new technologies. An in-depth knowledge of Windows operating systems and a good knowledge of databases are essential, together with experience in PC support. You must be an effective communicator with excellent organisational ability and time management skills.

    For a recruitment pack and application form, contact Human Resources – phone 0131 623 3700 or e-mail job@nls.uk. The closing date for this application is Friday 24 March.

    Intranet Developer


    This is an excellent opportunity for an experienced and enthusiastic intranet/internet developer to join a large IT division at a major blue chip organisation based in Edinburgh, Scotland.

    You will need a minimum of two years commercial experience in a web developer role (intranet and internet) using the full range of technologies but you must have CSS, HTML and video streaming. Additionally, candidates will ideally have graphics design skills including experience of Adobe Photoshop.

    You will be involved in the real design phase of the projects, making video clips and generally all the exciting and artistic side of development.

    You must be customer facing and be comfortable articulating to non-technology business users. Candidates must also have AA accessibility compliance knowledge. Day to day duties will involve liaising with users to determine and code the layout, design and content of Intranet sites. This role would suit a Computer Science (or similar) Degree educated Developer with 2-4 years commercial experience.

    Apply now if interested or call Helen on 0131 625 9604 to discuss in confidence. Intranet/internet developer, html, css, adobe based Edinburgh, Scotland with excellent large corporate benefits and career progression! Please apply now.

    Developer


    Our client, a successful SME developing innovative technology products, are looking to recruit an experienced Java developer to join their growing team. Degree educated you will have 2 years Java applications development experience and also be an experienced web developer. The required skills are Java, J2EE, JSP, SQL, XML, and HTML.

    If you are interested in this role please call Kirsty for a confidential chat on 0131 625 9620.

    Intranet Developer


    A key player in British Industry who are a very desirable employer require a new addition to the development team of their intranet. The role involves all aspects of intranet development, specifically the design, layout and communicating with users regarding the content. You must be driven and proactive as you will take a leading role in evaluation of the Intranet, and undertake coding and enhancing templates. The right candidate for this role will have in excess of 2 years intranet development experience and strong knowledge of HTML, CSS and other internet related applications. It would be desirable for you to be confident with Adobe Photoshop and generally with design. Contact me without delay! susan.eyton@jobs.hudson.com

    No applications will be accepted after 20/3/06

    Enjoy the booty me hearties, Ah'll be seein' ye all on the high seas or in Davey Jones'!

  • New life

    Published on 10 Mar 2006 from

    Nathan is now over three weeks old, and things are _starting_ to settle down just a bit. My life seems to have lost all sense of routine - I have no idea what time I will be able to eat breakfast or lunch (or even whether I'll get a chance to have them at all). Day time can either be a case of feeding Nathan a couple of times in the morning before he has an afternoon nap of at least a couple of hours, followed by near constant feeding and attention seeking before bedtime, or it's a case of constant feeding + attention for most of the day. One way to get him to sleep a bit is to pop out to a shop - we did Sainsburys for the first time yesterday and made use of their fabulous baby car seat-friendly trolleys, and he slept through the entire ordeal. We also walked to the post box yesterday - well, I walked, Nathan was carried in a Bjorn baby carrier, and he seemed to enjoy that too. Night times go pretty well if he gets enough food before bedtime, and we've even managed a couple of nights with about 5 hours of solid sleep before he wakes and needs a feed + nappy change.

    One of the best things that I can recommend to any new parent is a Sky+ box. While sitting in front of the telly, if Nathan needs attention, starts crying, or needs another nappy change, I can just pause the TV and come back and finish watching it later. I can also record any of the shows on late at night and watch them during the day when I have a bit more time, but I think the best feature is the live pause.

    I'm very much hoping to get back to the gym this weekend and start fighting to get rid of the extra weight I've put on. They say it's something like 9 months on, 9 months off, but personally, I'd like it to be gone sooner than that if possible, if only because my wardrobe is a bit limited in this size! When I lost weight before, I made a point of giving away old clothes to charity. I kept just some of the larger stuff, and thank goodness I did since I have two pairs of jeans that fit me and about five tops, but I have significantly more clothes in just one size smaller, so if I can get into those by the summer, then I won't need to go shopping for a while. Getting to the gym before was always tricky to fit round my work life - now I have to fit it round Nathan. Thankfully, James should be able to keep him occupied for the odd hour here and there!

  • Wordpress 2.0.2 Security Release

    Published on 10 Mar 2006 from

    Wordpress has released a security update for all users!

  • WPF Attached Properties and Complexity

    Published on 10 Mar 2006 from

    I've been working through the backlog (backblog?) of about 4000 unread items in my RSS reader. (I've been busy lately...) That's why I only just came across this post from Rob Relyea.

    He was responding to a question someone had posted on the WPF Forum. The original question can roughly be paraphrased as:

    If I want to set the X position of a rectangle, why can't I just write myRec.X = 42;? Why do I have to write Canvas.SetLeft(myRec, 42);?

    Rob provides a thorough and complete answer. However, I'd like to provide a different style of answer. Just to be clear, I don't think there's anything wrong with Rob's answer. It's just not how I'd have answered it. I'd like to give a less comprehensive (although probably more verbose) answer. :-) I hope it will offer a useful alternative point of view on the problem.

    Suppose It Did Work That Way...

    Imagine that WPF granted the wish of the person who asked the question. Here's exactly what he asked for, as he stated it in the forum:

    Why can't it be simple as myRectangle.X = value.

    In a hypothetical new world where WPF offers an X property on all its elements, here's the problem:

    The property wouldn't do anything in most scenarios.

    Why? Because most of the time in WPF we don't use absolute positioning. WPF's layout system is designed to adapt dynamically, taking into account both the content being presented, and the available space. It works out how large to make your elements and where to put them. If you really want to defeat this feature and use absolute positioning, you need to nest your elements inside of a special panel, Canvas. The idea of a prescribed X and Y position (or Left and Top as they're actually called) only makes sense within this particular panel - it's the only panel that lets you do this.

    Imagine how much confusion would be caused if these X and Y properties existed - developers all over the world would try to set these properties in contexts where they wouldn't work. Imagine the time wasted, first in discovering why the properties are being ignored, and then in cursing Microsoft for adding properties that don't work most of the time. So in practice, it makes perfect sense that the absolute positioning properties are defined as attached properties, provided by the only panel in which you can use them.

    (Of course there will still be a great deal of time expended across the world as developers come to terms with why they can't just provide explicit positions for everything. However, groking the WPF layout system is a valuable learning experience. Indeed, if you've come from a more traditional Windows development background, this is one of the Big Differences you need to get your head around in order to be productive with WPF. Until you've learned this lesson, you won't be getting the best out of the platform. So I don't see it as a waste of time, unlike the exercises in futility that would be the inevitable result of adding X and Y properties to everything.)

    Use Margin Instead

    Even though the idea of absolute positioning is only supported in one specific scenario, WPF does offer a facility that usually lets you achieve what you want, but with a little more flexibility: all elements offer a Margin property. This lets you specify how much space you want around the edges of an element. This of course gives you some control over its position. Not the absolute power that absolute positioning provides, but in practice, it often offers exactly what you want. And in return for relinquishing a small degree of control, we get to use a powerful, extensible, automatic layout system.

    Unlike Canvas.Left and its friends, Margin is not an attached property. It's an ordinary property, so it can be set using the normal property syntax of your language of choice.

    The big difference between Margin and absolute positioning is that Margin is something that can be accommodated by a wide range of layout styles. While it means the same thing in all scenarios - it indicates how much space the element wants around itself - each panel accommodates the margin in its own way. In the case of a Grid it lets you control the position precisely. For example:

    <Grid Background="Yellow">
      <Rectangle Fill="Red" Margin="20,10,0,0" Width="50" Height="30"
         HorizontalAlignment="Left" VerticalAlignment="Top" />
      <Rectangle Stroke="Green" Margin="30,15,0,0" Width="20" Height="30"
         HorizontalAlignment="Left" VerticalAlignment="Top" />
    </Grid>
    

    It looks like this:

    Two explicitly positioned rectangles

    So by using Margin, we obtained precise control over position thanks to how Grid chooses to deal with margins - they are always relative to the boundary of a grid cell. (Incidentally, this is how Expression Interactive Designer, aka Sparkle, and Cider, let you control position. When you drag a UI element around to set its position, you're actually editing the Margin property.)

    Because margin is a less rigid notion than absolute positioning, other panels can implement their margin handling slightly differently.

    In a StackPanel margin lets you control the position absolutely in one dimension (the X position for a vertical stack panel, and the Y position in the case of a horizontal stack panel). In the other dimension, you merely get to control the amount of space between one item and the next. Here's an example:

    <StackPanel Background="Yellow" Orientation="Vertical">
      <Rectangle Fill="Red" Margin="20,0,0,0" Width="50" Height="10"
                 HorizontalAlignment="Left" VerticalAlignment="Top" />
      <Rectangle Stroke="Green" Margin="30,0,0,0" Width="20" Height="10"
                 HorizontalAlignment="Left" VerticalAlignment="Top" />
      <Rectangle Fill="Blue" Margin="10,10,0,10" Width="40" Height="30"
                 HorizontalAlignment="Left" VerticalAlignment="Top" />
      <Rectangle Fill="Brown" Margin="20,0,0,0" Width="50" Height="10"
                 HorizontalAlignment="Left" VerticalAlignment="Top" />
    </StackPanel> 

    It looks like this:

    Two explicitly positioned rectangles

    All the rectangles control their exact X position through their margin. They don't have exact control over their vertical position, because the whole point of using a vertical stack panel is to save yourself the effort of specifying vertical positions manually. But note that the third rectangle down has some space above and below it. This is because it has a top and bottom margin of 10. So even when we're using a layout style where we cannot precisely control the vertical position, Margin lets us influence it.

    When used in flow-style layout, such as that offered by WrapPanel, the Margin doesn't have any control over the exact position, but allows you to control the position of an element relative to its neighbours. Of course in flow layout, absolute positioning wouldn't make any sense anyway, since the whole idea is to have all the elements positioned dynamically to fill whatever space is available. The ability to tweak the position relative to where the element appears in the flow is about as much as we can expect. Here's an example:

    <WrapPanel Background="Yellow">
      <Rectangle Fill="Red" Margin="20,0,0,0" Width="50" Height="10"
                VerticalAlignment="Top" />
      <Rectangle Stroke="Green" Margin="30,0,0,0" Width="20" Height="10"
                VerticalAlignment="Top" />
      <Rectangle Fill="Blue" Margin="10,10,0,10" Width="40" Height="30"
                VerticalAlignment="Top" />
      <Rectangle Fill="Brown" Margin="20,0,0,0" Width="50" Height="10"
                VerticalAlignment="Top" />
    </WrapPanel>
    

    It looks like this:

    Two explicitly positioned rectangles

    So even here, Margin offers some control. (For more advanced use of flow-based layouts, you could reasonably want to position some elements out of the flow and have the rest of the content flow around those elements. for example, consider text flowing around a figure. These more advanced flow-based layout scenarios are supported by the FlowDocument class. It offers a lot of control and flexibility, so simple X and Y properties wouldn't be any use there either.)

    Not only does Margin render hypothetical X and Y properties unnecessary, it also offers another trick: automatic resizing. (This is similar to what the Windows Forms Anchor property lets you do.) If you don't specify an explicit Width or Height, and you set the HorizontalAlignment or VerticalAlignment properties to Stretch