Is it possible to mix Direct3D content in a WinRT XAML application? - windows-8

My XAML application could use some 3d elements. Is it possible to mix Direct3D content in a WinRT XAML application?

Yes, it's actually very easy to do. See the SurfaceImageSource class. That provides a DirectX surface that can be drawn to like any other surface. See this doc for a lot of detail on this.

Related

Xamarin forms designing for multiple resolutions

How can we design according to various resolutions in Xamarin forms application. I have been using Viewbox control for Windows application but it is not found in Xamarin forms.My requirement is, if I set 50 px for a control , it should scale up or down according to various resolutions. Please provide some design guide lines to achieve this. I have been using Grid row definitions and column definitions, but for some cases I have to manually set height / width or padding for some controls. Please help me.
Xamarin.Forms does not use pixels. It uses platform specific density aware units.
Xamarin.Forms has a philosophy of using the conventions of the
underlying platforms as much as possible. In accordance with this
philosophy, the Xamarin.Forms programmer works with sizes defined by
each particular platform. All sizes that the programmer encounters
through the Xamarin.Forms API are in these platform-specific
device-independent units.
That would be "points" in iOS and "dpi" on Android.
There's a whole book chapter about it (free)
https://download.xamarin.com/developer/xamarin-forms-book/BookPreview2-Ch05-Rel0203.pdf

Implementing Packed bubble Graph in WinRT

How I can implement packed bubble graph in WinRT. I am trying to achieve graph similar to attached image..
I tried for a similar implementation / sample for silverlight / Windows 8 in google, But didn't get any. Please anyone help me to achieve the same graph. My main issue is with implementing the logic correctly.
What kind of project are you using? There's actually a way to do this in each kind of supported project.
For javascript you can use the Canvas element, which has easy 2D api's for drawing circles and text.
In C++ you can use the DirectX 2D api's to draw circles. In C# you can embed a DirectX panel into your xaml and then use DirectX to draw the circles.
In C# or C++ you can also solve this problem with just xaml, using a ListView with Canvas for an ItemsPanel, and Circle objects. Here is a blog post I found with a tutorial (except with rectangles):
http://zamjad.wordpress.com/2010/03/17/using-canvas-as-a-itempanel-template-in-listbox/
Not sure if this fits your need. If you are not averse to using JS + HTML in WinRT, d3.js should be very very useful
Example of packed bubble chart - http://bl.ocks.org/mbostock/4063269
http://d3js.org/
Hope this helps!

Where to start on a tile view

I would like an exact copy of the windows 8 startpage (or windows phone if you like) as a control in my WinRT application..
Like this one in silverlight telerik but than for WinRT
Must be clickable (the easy part) and dragable (the hardest part)
I've been searching for examples but couldn't find any good.. does anybody has a good starting point or tip?
You should try Telerik HubTile.
Telerik offers different types of tile type
Windows 8 Style Tiles
Rotating and Sliding Tiles
Other Tile Types

Can I have a composite shape as a resource in WinRT XAML?

I'm developing a Windows 8 Metro-style application and I want to use vector images. As there seems to be no direct support for svg images, I am trying to use a xaml fragment consisting of multiple shapes (a path and some lines) as an image. I would like to have a resource dictionary entry with the composite shape and be able to include it in different pages. Ideally, I would also like to be able to resolve a specific composite shape from a data bound property.
From what I've read, the WPF approach was to have a VisualBrush or DrawingBrush consisting of the shapes, but there are no such classes in Windows 8 (and it seems like it's not even possible to derive from Brush).
How am I supposed to do this using WinRT UI?
No, you cannot use a DrawingBrush as the value of a background property in WinRT XAML. It's too bad, huh? Seems like a very powerful features to setup the fill of an object with vector layouts. In fact DrawingBrush is not even part of Windows 8 yet. It is what it is. For now, images are a fine solution. But we feel your pain.
I might as well toss in that VisualBrush is not part of WinRT-XAML either.
Each XAML fragment is really a UI element. I think the simplest approach would be to put the XAML into it's own user control and then add the user control to each page you wanted to display the "drawing" on. If you want the user control to display different shapes, you can expose a property on the control, data bind to that property, and inside the setter of the property read the value and toggle the visibility of the various XAML shapes to show or hide whatever parts of the composite image you want. It is a bit brute force, but will do what you want.
Windows8 way to have vector graphics in it is just to use ViewBox+Canvas and Path elements. It works well in my opinion, though I do miss VisualBrush.

Where is the RadialGradientBrush in WinRT XAML?

Building XAML WinRT application & noticed the RadialGradientBrush is nowhere to be found?
Where is the RadialGradientBrush in WinRT XAML?
The radial gradient brush, which is an essential part of xaml IMHO is not supported. I'm hoping this will change. I heard Microsoft felt the brush was not very metro but it is used in huge number if otherways like logos, games etc.
Unfortunately, in this initial version, RadialGrandientBrush is not supported.