<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ankit Jain &#187; Microsoft</title>
	<atom:link href="http://ankitjain.info/ankit/tag/microsoft/feed/" rel="self" type="application/rss+xml" />
	<link>http://ankitjain.info/ankit</link>
	<description>» It’s all about Ankit and Web! «</description>
	<lastBuildDate>Mon, 28 Jun 2010 06:28:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>3D Full Screen Window and Dynamic XAML Sample with WPF</title>
		<link>http://ankitjain.info/ankit/2006/12/01/wpf-xaml-viewport3d-window-full-screen/</link>
		<comments>http://ankitjain.info/ankit/2006/12/01/wpf-xaml-viewport3d-window-full-screen/#comments</comments>
		<pubDate>Fri, 01 Dec 2006 14:59:07 +0000</pubDate>
		<dc:creator>Ankit</dc:creator>
				<category><![CDATA[.net 3.0]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Programming/Code]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[wpf]]></category>

		<guid isPermaLink="false">http://ankitjain.info/ankit/2006/12/01/wpf-xaml-viewport3d-window-full-screen</guid>
		<description><![CDATA[One nice feature of WPF (Windows Presentation Foundation, .Net 3.0) is the integration of 3D library with the existing framework. Today I worked with Viewport3D class. This class handles it all for managing 3D views. The &#8220;Hello World&#8221; example I coded here basically demonstrates three features: Loading XAML dynamically at runtime Playing with 3D objects [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal">One nice feature of WPF (Windows Presentation Foundation, .Net 3.0) is the integration of 3D library with the existing framework. Today I worked with Viewport3D class. This class handles it all for managing 3D views. The &#8220;Hello World&#8221; example I coded here basically demonstrates three features:</p>
<ul type="circle" style="margin-top: 0in">
<li class="MsoNormal">Loading XAML dynamically at runtime</li>
<li class="MsoNormal">Playing with 3D objects using <span style="font-size: 10pt">Viewport3D</span> and make them rotate using mouse.</li>
<li class="MsoNormal">Creating transparent and full-screen windows</li>
</ul>
<p class="MsoNormal">Let&#8217;s drill down to the technical details of above three aspects:</p>
<p class="MsoNormal">Firstly, loading XAML runtime can be achieved using <span style="font-size: 10pt">System.Windows.Markup.</span><span style="color: teal">XamlReader</span> class. The Load function takes a stream object (containing XAML source) and return appropriate UI control. Actually, it returns the root control in the stream.</p>
<blockquote>
<p class="MsoNormal"><span style="font-size: 10pt">    </span><span style="color: teal">FileStream</span> fs = <span style="color: teal">File</span>.OpenRead(fileName);<br />
<span style="color: blue">this</span>.view3D = (<span style="color: teal">Viewport3D</span>) System.Windows.Markup.<span style="color: teal">XamlReader</span>.Load(fs);</p>
</blockquote>
<p class="MsoNormal">Secondly, the class <span style="font-size: 10pt">Viewport3D</span> does it all for you to handle 3D objects. Here we have just hooked mouse events that allows rotation of 3D object in all directions. Moreover you can zoom in/out using right mouse button. Thanks <a target="_blank" href="http://viewport3d.com/trackball.htm">Daniel</a> for writing TrackBall class.</p>
<p class="MsoNormal">Lastly, setting few parameters as below we can make a Window appear transparent and full-screened:</p>
<p class="MsoNormal"><span style="font-size: 10pt"><span style="color: blue" /></span></p>
<blockquote><p><span style="color: blue">this</span>.win = <span style="color: blue">new</span> <span style="color: teal">Window</span>();<br />
win.Content = view3D;<br />
win.ShowInTaskbar = <span style="color: blue">false</span> ;<br />
win.Background =  <span style="color: teal">Brushes</span>.Transparent ;<br />
win.AllowsTransparency = <span style="color: blue">true</span>;<br />
win.WindowStyle = <span style="color: teal">WindowStyle</span>.None ;<br />
win.WindowStartupLocation = <span style="color: teal">WindowStartupLocation</span>.CenterScreen ;<br />
win.WindowState = <span style="color: teal">WindowState</span>.Maximized;<br />
win.Show();</p></blockquote>
<p class="MsoNormal">Well, I guess that&#8217;s enough for the first WPF post.<br />
Download the source code for sample application: <a title=".Net 3.0 Framework required to run this sample" href="http://ankitjain.info/ankit/wp-content/Load-3D-XAML-Runtime.zip">Load-3D-XAML-Runtime.zip</a></p>
<p class="MsoNormal">Thanks for reading.<br />
~ Ankit</p>
]]></content:encoded>
			<wfw:commentRss>http://ankitjain.info/ankit/2006/12/01/wpf-xaml-viewport3d-window-full-screen/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
