locked
WPF and learning the ropes RRS feed

  • Question

  • I've spent the best part of today evaluating Blend and its integration into VS2008.  The idea of the exercise is determine how well Blend and VS2008 match up together in the scenario that I'm currently facing.  At present the client utilises Flash in a Windows Application to provide their RIA and link the two together using Flash's interoperability elements - however, whilst Flash is adequate to the task - WPF (on the face of things) may provide a more seemless approach with countless advantages, e.g. no reliance on Actionscript, utilising GPU, better IDE, etc, etc.  Note: this is specifically for WinForms only.

    However, I've got to say I've found things very frustrating and in particular reviewing Blend as a designer friendly application for those non-coder types to utilise, as well as, developers being able to jump into the code easily through VS2008.

    So - here's a few of things I noticed and I'm wondering whether I'm getting frustrated due to my bumbling around the software or whether I'm expected too much out of this...

    (Using Blend 1.0.1083.0 and VS2008).

    • I get the feeling that creating your images / assets can be a bit of a pain if you rely on third-party tools, e.g. Fireworks / Photoshop.  If I'm say creating a graphic for a button and importing into Blend for use - what's my best approach?  Using an image control and capturing the 'MouseDown' event - or should I somehow mangle a button to perform this for me?  I've got a sneaking suspicion I should be looking towards creating say a rectangle, slapping an image control onto that - then use the 'Make Button' command to wrap everything up?

    • What's a good approach to navigating to specific elements within a WPF application.  In say Flash, you can create MovieClips and load them dynamically into the production and swap them out - however, what's the WPF way of doing this?  I'm thinking that you can have a WPF window as your startup window and then load and unload pages, etc. quite easily - however, the only documentation I've found so far is specific to Silverlight and not WPF Page.xaml's.  As you can imagine its desirable for a WPF application to encapsulate everything it needs, so one WPF Window that can then load 'pages' into it.  Even more importantly ensuring that this navigation can be easily performed through Blend...

    • One problem I'm experiencing is adding some images into Blend through image controls and performing some simple navigation.  Now this works and a quick build works great.  However, swapping over to VS2008 the XAML preview doesn't work and complains that...

      The file 'XXX.png' is not part of the project or its 'Build Action' property is not set to 'Resource'

      ...but if I build the project from VS2008 it shows the images just fine.  I've got the feeling I need to add the images through the Resource Dictionary in Blend - but how?  (Note: removing the images from VS2008, re-linking/adding them and setting the build action doesn't work - nor does this ->http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3279257&SiteID=1.

    • The clipping region is not easy to play around IMHO.  Let's say you get two shapes, overlay them, select both, hold down 'ctrl' and select 'Make Clipping Region'.  The clipped shape disappears showing the defined shape where the two overlap.  Great, but now there will only be one object in the 'Objects and Timelines' navigator - and if you remove the clipping the previous shape disappears.  Like how would you animate a clipping region or even know one is there?  More importantly - how would you do this through Blend without touching XAML.  I don't want to make the comparison with Flash and its 'Masks' but I'm a bit stumped on this one.
    I guess my problem is that I'm comparing Blend with Flash and looking for the commonality and potential improvements (and if you know any half decent materials on moving from Flash Development/Design to Blend I'll be very happy to check them out) - but that's the crux of the problem as I'm going to have to sell Blend to some established Flash individuals who will freak at delving into XAML so whilst I can heartly recommend VS2008 - Blend is different beastie all together...

    Cheers and thanks for reading - M
    Tuesday, May 6, 2008 4:18 PM

All replies

  • Heyup, back again...
    Drydo said:
    • I get the feeling that creating your images / assets can be a bit of a pain if you rely on third-party tools, e.g. Fireworks / Photoshop.  If I'm say creating a graphic for a button and importing into Blend for use - what's my best approach?  Using an image control and capturing the 'MouseDown' event - or should I somehow mangle a button to perform this for me?  I've got a sneaking suspicion I should be looking towards creating say a rectangle, slapping an image control onto that - then use the 'Make Button' command to wrap everything up?
    I've played around with a couple of methods and whilst its desirable to utilise Expression Design - adding the image to the project, making it a Image Brush Resource, creating a rect and the image brush as the resource worked...
    Drydo said:
    • What's a good approach to navigating to specific elements within a WPF application.  In say Flash, you can create MovieClips and load them dynamically into the production and swap them out - however, what's the WPF way of doing this?  I'm thinking that you can have a WPF window as your startup window and then load and unload pages, etc. quite easily - however, the only documentation I've found so far is specific to Silverlight and not WPF Page.xaml's.  As you can imagine its desirable for a WPF application to encapsulate everything it needs, so one WPF Window that can then load 'pages' into it.  Even more importantly ensuring that this navigation can be easily performed through Blend...
    The best I've come up with is using UserControls - no biggie for developer types. These can be loaded dynamically via VS2008. However, I guess here is where Blend isn't helpful where a designer has to jump into VS2008 to make the link OR they can utilise a new timeline to hide/show the element. What would be nice is if you place a usercontrol onto the Window / Page and then you could Edit the control (which it can). But with the background / underlying control showing through to give reference / context to the edit (if applicable).
    Drydo said:
    • One problem I'm experiencing is adding some images into Blend through image controls and performing some simple navigation.  Now this works and a quick build works great.  However, swapping over to VS2008 the XAML preview doesn't work and complains that...

      The file 'XXX.png' is not part of the project or its 'Build Action' property is not set to 'Resource'

      ...but if I build the project from VS2008 it shows the images just fine.  I've got the feeling I need to add the images through the Resource Dictionary in Blend - but how?  (Note: removing the images from VS2008, re-linking/adding them and setting the build action doesn't work - nor does this ->http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3279257&SiteID=1.
    This *might* be a bug. If you add an image using the 'Add Existing Item' everything is fine and dandy. Try the same thing with 'Link to existing item' and it causes the above problem. This is after SP1 and replicated in 3 separate projects. Haven't tried it through VS2008 to add the items... If anyone's got any comments re: Clipping Region or whether the above makes sense or doesn't I'll appreciate the feedback...
    Wednesday, May 7, 2008 2:58 PM