Adding snapping to the AutoCAD MRU browser using WinRT

I visited another Windows 8-related conference in Zürich, yesterday. Despite much of the content being repeated from the last one I attended, I actually found it really useful: having spent time working with Windows 8 and WinRT over the last few weeks, I found I got more out of the demos and could also ask more intelligent questions of the Microsoft personnel in attendance (thanks for all your help, Ronnie :-). And there was some new content I hadn't seen, previously: I managed to sit in briefly on an Azure session (which was admittedly a bit too IT-centric for my personal tastes) and a couple of "WinRT via HTML5 & Javascript" sessions, too.

During the breaks, I also took the opportunity to finish off a half-completed feature in the MetroCAD app: snapping. Snapping allows you – on screens with a minimum resolution of 1366 x 768, something you could circumvent with the Windows 8 Developer Preview but not with the Consumer preview, it seems – to dock one application to one side of the screen while you have another application (even your traditional Windows desktop) available on the other side. This mode is the way Windows 8 enables users to "multi-task" (meant at the user-level rather than the process level), making use of multiple applications at the same time (as otherwise Metro-style applications run in full screen).

I won't go into the specific code changes, as most of the code was there, just needed tidying up (as I simply hadn't tested that mode of operation before yesterday).

Here's the updated source project, and here's snapping in action:

I'm now fairly happy with implementation of the snapping feature and the overall capabilities of the app, which means I can crack on with the series on moving application functionality to the cloud.

4 responses to “Adding snapping to the AutoCAD MRU browser using WinRT”

  1. Hi Kean,

    Cool app - my first foray into Metro. Do you have the mru.xml file that goes with the images in the project? I've hacked one up but it would be nice to have the one you used.

    Also, did you figure out why you sometimes have to do a manual refresh on the GroupedItemsPage for some images to appear? If the code that sets the ZoomedOutView ItemsSource is commented out or the sub-grid in the ZoomedOut xaml is removed then it never needs a refresh - is it timing out maybe?

    Cheers
    Jon

  2. Kean Walmsley Avatar

    Hi Jon,

    Glad to hear you're having a play! 🙂

    The mru.xml file should be in the Images sub-folder (along with it's related .png files). They all need copying to your My Documents folder (under a "MetroCAD" sub-folder, I believe), but it sounds as though you have that in place, already.

    I didn't figure out why the refresh is needed, although it's interesting to hear you've found out how it can be avoided (or what may be causing it). It may also be I'm setting the data-source incorrectly in the XAML and/or the code-behind... I should take a closer look, at some point. If you find anything further out, in the meantime, please do let me know!

    Cheers,

    Kean

  3. Found the mru.xml - going blind - thanks!

    I was able to remove the setting of the ZoomedOutView ItemSource in the code-behind as the DrawingData is set in the DataContext of the whole page from the LayoutAwarePage - the ZoomedOutView xaml was able to be changed to use the cvs2 CollectionViewSource. However, probably not worth sharing the code as it made no difference to the end result!

  4. Glad you found the file (and removed the redundancy), but sorry you weren't able to find the reason for the glitch.

    Thanks for trying, though!

    Kean

Leave a Reply

Your email address will not be published. Required fields are marked *