Coffeehouse Post

Single Post Permalink

View Thread: has Anders commented on WinRT?
  • User profile image

    I have to agree with Harlequin on the MSDN documentation. I find that there's lots of videos, articles and tutorials out there, but it's not on MSDN. The WinRT library documentation is obviously just automatically generated from the WinRT library's XML documentation. If it wasn't, then someone could have saved themselves a hell of a lot of time because the result is the same: short one sentence descriptions of types and members, but zero information on how to use all that stuff.

    The thing is that all those articles and tutorials elsewhere are fine for getting to grips with the basics, but when you want to dive deeper and read up on some type you found, MSDN is useless.

    Take ISupportIncrementalLoading, for instance. I wanted to find out how to make a gridview load more items as the user reaches the end, but all the forum posts and tutorials on the matter seemed confusing. I could gather that the ISupportIncrementalLoading.LoadMoreItemsAsync() method was key, so I decided to read up on it. All the MSDN documentation tells me is what the interface's member's are (which Visual Studio could already tell me) and that it "Specifies a calling contract for collection views that support incremental loading." That's too general and too vague. The LoadMoreItemsAsync() documentation simply says "Initializes incremental loading from the view." No information on the weird IAsyncOperation<LoadMoreItemsResult> return value. No information on how to implement this thing, exactly. Just very basic descriptions of the types and members that IntelliSense already gives me.

    Same with implementing drag and drop: the XAML editor told me about UIElement.AllowDrop, but the MSDN page simply says "Gets or sets a value that determines whether this UIElement can be a drop target for purposes of drag-and-drop operations." So, great, I kind of gathered that. So what do I do when it's set to true? I don't know, because the MSDN page doesn't bother to tell me about it. I just sort of assume there's a Drop event, and so there is, but that documentation also doesn't tell me a damned thing about wat to do when the event is fired. How do I figure out what has been dropped onto the UIElement? Can I tell wether it has been dragged there by mouse or by finger? Does it fire once for every item that has been dropped or is there a collection of all simultaneously dropped items that I can look at somewhere? MSDN sure won't tell me. I have to click on through to the DragEventHandler Delegate, for which the documentation is also completely barebones, and then onto the DragEventArgs page. Here, I find a Data property. Success! I can probably figure out what has been dropped in there. Oh wait, the documentation is again useless. All I can tell from it is that the Data property is of the weird DataPackage type. And what do you know, a Remarks section! But wait, it only supports text, RTF, HTML, Bitmap and StorageItems by default? Why can't I just get the object that was bound to whatever has been dragged from there? Maybe I can, because the documentation tells me that "It also has methods to support custom data formats". So how do those work? MSDN won't bother to tell me. It stops just short of giving me the finger. In the end, I just didn't bother with AllowDrop and the DataPackage and just rolled my own implementation using the ManipulationStarted, ManipulationDelta and ManipulationCompleted events. For which, incidentally, the WPF documentation has a whole section about what to do in this event and how to use the eventargs, where to go for more information about manipulations and a pointer to a walkthrough for touch enabled applications. The WinRT documentation has basic intellisense data and a single "Using manipulation events" link hidden in the See Also section.

    The MSDN documentation sucks. It sucks hard. The most useful sources of information on Metro app development for me have been the MSDN forums, google, and just poking around in intellisense. Apart from a few how to articles there is nothing on MSDN that you can't already find with intellisense, and that's not nearly enough.