<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[WPF Graphics Forum - All Forums]]></title>
		<link>http://forum.wpf-graphics.com/</link>
		<description><![CDATA[WPF Graphics Forum - http://forum.wpf-graphics.com]]></description>
		<pubDate>Sun, 05 Feb 2012 06:23:53 +0100</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Touch events]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=238</link>
			<pubDate>Sat, 04 Feb 2012 07:57:49 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=238</guid>
			<description><![CDATA[Does your library also supports touch events instead of mouseevents?]]></description>
			<content:encoded><![CDATA[Does your library also supports touch events instead of mouseevents?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[How to buy a house]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=235</link>
			<pubDate>Wed, 25 Jan 2012 19:14:29 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=235</guid>
			<description><![CDATA[look [url=http://sell-my-settlement.allall.us/&#93; Sell my settlement]]></description>
			<content:encoded><![CDATA[look [url=http://sell-my-settlement.allall.us/] Sell my settlement]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[How best to sell the house]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=234</link>
			<pubDate>Wed, 25 Jan 2012 14:41:26 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=234</guid>
			<description><![CDATA[look [url=http://sell-my-settlement.allall.us/&#93; Sell my settlement]]></description>
			<content:encoded><![CDATA[look [url=http://sell-my-settlement.allall.us/] Sell my settlement]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Muay Thai]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=232</link>
			<pubDate>Tue, 24 Jan 2012 18:44:36 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=232</guid>
			<description><![CDATA[<a href="http://www.MuayThaiHomeStudy.com" target="_blank"><img src="http://img23.imageporter.com/i/00830/k11601q0hjav_t.jpg" border="0" alt="[Image: k11601q0hjav_t.jpg&#93;" /></a>       <br />
       <br />
<a href="http://www.MuayThaiHomeStudy.com" target="_blank">Muay Thai</a> Training Will Give you a Thinner, A lot more Muscular Body with many Hard Knowledge to Back it Up!Inches       <br />
       <br />
On the whole, you may not locate a exercise that's since complete and successful because Kick boxing. These kind of exercises are entertaining and never uninteresting.       <br />
       <br />
Furthermore, This sort of Instruction WILL GET YOU IN SHAPE Rapidly!       <br />
       <br />
Man or woman : knowledgeable or newbie * regardless of. You will adore the outcomes. There may be simply something EMPOWERING about understanding you have the capacity to protect your self if your require arises.       <br />
       <br />
This is actually the simply complete Combat training Residence Examine Training course in the marketplace. There's really hardly anything else as it on the globe.       <br />
       <br />
Appear, I have come across a lot of education Dvd videos and start feeling confident throughout stating that right now there simply is very little else such as this study course. Here is the most thorough, total, as well as extensive Kick boxing Home Examine program in the world.       <br />
       <br />
It really is such as getting the own your personal Kick boxing health club "in a new box" dropped off on your front veranda!       <br />
       <br />
Just end along with think of every one of the cool rewards that you're walking from education using this type of training course...       <br />
       <br />
    Learn exceptional Self defense abilities       <br />
    Get throughout Amazing Aerobic SHAPE       <br />
    Become much more Versatile, Matched up, along with Self-displined       <br />
    You can be LEANER and grow in Muscular mass       <br />
    Become Much healthier and also achieve a Youthful APPEARENCE       <br />
    Gain MORE Assurance       <br />
    EARN The particular Regard of those around you who know about the Combat training expertise       <br />
    You will sense greater concerning your new, slimmer, more challenging and much more desirable do it yourself       <br />
    and much more!]]></description>
			<content:encoded><![CDATA[<a href="http://www.MuayThaiHomeStudy.com" target="_blank"><img src="http://img23.imageporter.com/i/00830/k11601q0hjav_t.jpg" border="0" alt="[Image: k11601q0hjav_t.jpg]" /></a>       <br />
       <br />
<a href="http://www.MuayThaiHomeStudy.com" target="_blank">Muay Thai</a> Training Will Give you a Thinner, A lot more Muscular Body with many Hard Knowledge to Back it Up!Inches       <br />
       <br />
On the whole, you may not locate a exercise that's since complete and successful because Kick boxing. These kind of exercises are entertaining and never uninteresting.       <br />
       <br />
Furthermore, This sort of Instruction WILL GET YOU IN SHAPE Rapidly!       <br />
       <br />
Man or woman : knowledgeable or newbie * regardless of. You will adore the outcomes. There may be simply something EMPOWERING about understanding you have the capacity to protect your self if your require arises.       <br />
       <br />
This is actually the simply complete Combat training Residence Examine Training course in the marketplace. There's really hardly anything else as it on the globe.       <br />
       <br />
Appear, I have come across a lot of education Dvd videos and start feeling confident throughout stating that right now there simply is very little else such as this study course. Here is the most thorough, total, as well as extensive Kick boxing Home Examine program in the world.       <br />
       <br />
It really is such as getting the own your personal Kick boxing health club "in a new box" dropped off on your front veranda!       <br />
       <br />
Just end along with think of every one of the cool rewards that you're walking from education using this type of training course...       <br />
       <br />
    Learn exceptional Self defense abilities       <br />
    Get throughout Amazing Aerobic SHAPE       <br />
    Become much more Versatile, Matched up, along with Self-displined       <br />
    You can be LEANER and grow in Muscular mass       <br />
    Become Much healthier and also achieve a Youthful APPEARENCE       <br />
    Gain MORE Assurance       <br />
    EARN The particular Regard of those around you who know about the Combat training expertise       <br />
    You will sense greater concerning your new, slimmer, more challenging and much more desirable do it yourself       <br />
    and much more!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[3ds File and uiElements?]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=231</link>
			<pubDate>Tue, 24 Jan 2012 16:36:05 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=231</guid>
			<description><![CDATA[Hi,<br />
<br />
I have a Viewport3D with a couple of ConeUIElement3D's in it, and I can drag the view around quite happily.<br />
<br />
I'd like to load a .3ds model into this Viewport to display alongside my elements and still be able to drag the view around - clicking on the cones or on the 3ds model - is this even possible?<br />
<br />
thanks in advance<br />
Brian]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
I have a Viewport3D with a couple of ConeUIElement3D's in it, and I can drag the view around quite happily.<br />
<br />
I'd like to load a .3ds model into this Viewport to display alongside my elements and still be able to drag the view around - clicking on the cones or on the 3ds model - is this even possible?<br />
<br />
thanks in advance<br />
Brian]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[ConeUIElement3D Point Set]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=230</link>
			<pubDate>Tue, 24 Jan 2012 16:32:21 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=230</guid>
			<description><![CDATA[Hi,<br />
<br />
Does anyone know if there is a set of Points I can have access to if I have a ConeUIElement3D with say, 10 Segments? I have the BottomCenterPosition and radius etc but wondered if there's a way to get, for instance, the corner points of each segment etc, a lower-level description of the cone?<br />
<br />
thanks in advance<br />
Brian]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
Does anyone know if there is a set of Points I can have access to if I have a ConeUIElement3D with say, 10 Segments? I have the BottomCenterPosition and radius etc but wondered if there's a way to get, for instance, the corner points of each segment etc, a lower-level description of the cone?<br />
<br />
thanks in advance<br />
Brian]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[us navy news]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=229</link>
			<pubDate>Tue, 24 Jan 2012 16:28:17 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=229</guid>
			<description><![CDATA[Thanks for discussing your ideas. I'd personally also like to state that video games have been ever before evolving. Today's technology and innovations have made it simpler to create realistic and interactive games. All these entertainment video games were not actually sensible when the actual concept was first being tried. Just like other areas of technological know-how, video games way too have had to advance by many many years. This itself is testimony towards fast continuing development of video games.       <br />
<a href="http://isp.pembinatrails.ca/member/11097" target="_blank">koma news seattle</a>    <br />
<a href="http://www.arturia.com/evolution/smf/index.php?action=profile;u=168034" target="_blank">news spain tourism travel</a>    <br />
<a href="http://wisconsinfarmland.org/member/15206" target="_blank">binghamton news</a> <br />
<a href="http://aincenter.ru/user/Mipsefusser/" target="_blank">mornng joe news</a>]]></description>
			<content:encoded><![CDATA[Thanks for discussing your ideas. I'd personally also like to state that video games have been ever before evolving. Today's technology and innovations have made it simpler to create realistic and interactive games. All these entertainment video games were not actually sensible when the actual concept was first being tried. Just like other areas of technological know-how, video games way too have had to advance by many many years. This itself is testimony towards fast continuing development of video games.       <br />
<a href="http://isp.pembinatrails.ca/member/11097" target="_blank">koma news seattle</a>    <br />
<a href="http://www.arturia.com/evolution/smf/index.php?action=profile;u=168034" target="_blank">news spain tourism travel</a>    <br />
<a href="http://wisconsinfarmland.org/member/15206" target="_blank">binghamton news</a> <br />
<a href="http://aincenter.ru/user/Mipsefusser/" target="_blank">mornng joe news</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Test, just a test]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=225</link>
			<pubDate>Fri, 06 Jan 2012 14:46:39 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=225</guid>
			<description><![CDATA[Hello.]]></description>
			<content:encoded><![CDATA[Hello.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Trial Version always says using "Unlicensed version" then quits.]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=224</link>
			<pubDate>Fri, 06 Jan 2012 08:19:09 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=224</guid>
			<description><![CDATA[I would really love to evaluate your product but none of the pre-compiled sample apps or apps that I compiled by myself in VS2010 will run.<br />
<br />
They display the unlicensed version message and then I get an exception:<br />
<blockquote><cite>Quote:</cite>System.Windows.Markup.XamlParseException was unhandled<br />
  Message=Cannot create instance of 'IntroductionPage' defined in assembly 'Reader3dsSamples, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation.  Error in markup file 'Reader3dsSamples;component/Other/IntroductionPage.xaml' Line 1 Position 7.<br />
  Source=PresentationFramework<br />
  LineNumber=1<br />
  LinePosition=7<br />
  StackTrace:<br />
       at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)<br />
       at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)<br />
       at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException)<br />
       at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail)<br />
       at System.Windows.Markup.BamlRecordReader.GetElementAndFlags(BamlElementStartRecord bamlElementStartRecord, Object&amp; element, ReaderFlags&amp; flags, Type&amp; delayCreatedType, Int16&amp; delayCreatedTypeId)<br />
       at System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord(BamlElementStartRecord bamlElementRecord)<br />
       at System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord)<br />
       at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)<br />
       at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)<br />
       at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()<br />
       at System.Windows.Markup.TreeBuilder.Parse()<br />
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)<br />
       at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)<br />
       at MS.Internal.AppModel.AppModelKnownContentFactory.BamlConverter(Stream stream, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader&amp; asyncObjectConverter)<br />
       at MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStream(Stream s, ContentType contentType, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader&amp; asyncObjectConverter)<br />
       at System.Windows.Navigation.NavigationService.GetObjectFromResponse(WebRequest request, WebResponse response, Uri destinationUri, Object navState)<br />
       at System.Windows.Navigation.NavigationService.DoNavigate(Uri source, NavigationMode f, Object navState)<br />
       at System.Windows.Navigation.NavigateQueueItem.Dispatch(Object obj)<br />
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)<br />
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)<br />
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)<br />
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()<br />
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)<br />
       at System.Threading.ExecutionContext.runTryCode(Object userData)<br />
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)<br />
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)<br />
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br />
       at System.Windows.Threading.DispatcherOperation.Invoke()<br />
       at System.Windows.Threading.Dispatcher.ProcessQueue()<br />
       at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)<br />
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)<br />
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)<br />
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)<br />
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)<br />
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)<br />
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)<br />
       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)<br />
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)<br />
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG&amp; msg)<br />
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)<br />
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)<br />
       at System.Windows.Threading.Dispatcher.Run()<br />
       at System.Windows.Application.RunDispatcher(Object ignore)<br />
       at System.Windows.Application.RunInternal(Window window)<br />
       at System.Windows.Application.Run(Window window)<br />
       at System.Windows.Application.Run()<br />
       at Reader3dsSamples.App.Main() in C:\Users\Public\Documents\AB4D\Ab3d.Reader3ds\Reader3dsSamples\obj\Debug\App.g.cs:line 0<br />
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[&#93; args)<br />
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[&#93; args)<br />
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()<br />
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br />
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br />
       at System.Threading.ThreadHelper.ThreadStart()<br />
  InnerException: System.Reflection.TargetInvocationException<br />
       Message=Exception has been thrown by the target of an invocation.<br />
       Source=mscorlib<br />
       StackTrace:<br />
            at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean&amp; canBeCached, RuntimeMethodHandle&amp; ctor, Boolean&amp; bNeedSecurityCheck)<br />
            at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)<br />
            at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)<br />
            at System.Activator.CreateInstance(Type type, Boolean nonPublic)<br />
            at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail)<br />
       InnerException: System.NullReferenceException<br />
            Message=Object reference not set to an instance of an object.<br />
            Source=Reader3dsSamples<br />
            StackTrace:<br />
                 at Reader3dsSamples.Other.IntroductionPage..ctor() in C:\Users\Public\Documents\AB4D\Ab3d.Reader3ds\Reader3dsSamples\Other\IntroductionPage.xaml.cs:line 18<br />
            InnerException: </blockquote>
<br />
<br />
The application then terminates, I can't even get a glimpse of what your products do.<br />
<br />
Please let me know what's going on?<br />
<br />
I'm using VS2010 on Windows 7 with UAC turned off running in Administrator mode on a home computer.<br />
<br />
Looks like you guys are very pedantic about license security to the point where legitimate users can't even use it!<br />
<br />
-Angelo<hr />
Just tried this on another box running Win 7 but with VS2010 Express and everything in the trial version worked.<br />
<br />
Does your software support VS2010 Ultimate? There arent really that many other differences between the computers.]]></description>
			<content:encoded><![CDATA[I would really love to evaluate your product but none of the pre-compiled sample apps or apps that I compiled by myself in VS2010 will run.<br />
<br />
They display the unlicensed version message and then I get an exception:<br />
<blockquote><cite>Quote:</cite>System.Windows.Markup.XamlParseException was unhandled<br />
  Message=Cannot create instance of 'IntroductionPage' defined in assembly 'Reader3dsSamples, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation.  Error in markup file 'Reader3dsSamples;component/Other/IntroductionPage.xaml' Line 1 Position 7.<br />
  Source=PresentationFramework<br />
  LineNumber=1<br />
  LinePosition=7<br />
  StackTrace:<br />
       at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)<br />
       at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)<br />
       at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException)<br />
       at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail)<br />
       at System.Windows.Markup.BamlRecordReader.GetElementAndFlags(BamlElementStartRecord bamlElementStartRecord, Object&amp; element, ReaderFlags&amp; flags, Type&amp; delayCreatedType, Int16&amp; delayCreatedTypeId)<br />
       at System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord(BamlElementStartRecord bamlElementRecord)<br />
       at System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord)<br />
       at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)<br />
       at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)<br />
       at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()<br />
       at System.Windows.Markup.TreeBuilder.Parse()<br />
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)<br />
       at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)<br />
       at MS.Internal.AppModel.AppModelKnownContentFactory.BamlConverter(Stream stream, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader&amp; asyncObjectConverter)<br />
       at MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStream(Stream s, ContentType contentType, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader&amp; asyncObjectConverter)<br />
       at System.Windows.Navigation.NavigationService.GetObjectFromResponse(WebRequest request, WebResponse response, Uri destinationUri, Object navState)<br />
       at System.Windows.Navigation.NavigationService.DoNavigate(Uri source, NavigationMode f, Object navState)<br />
       at System.Windows.Navigation.NavigateQueueItem.Dispatch(Object obj)<br />
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)<br />
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)<br />
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)<br />
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()<br />
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)<br />
       at System.Threading.ExecutionContext.runTryCode(Object userData)<br />
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)<br />
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)<br />
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br />
       at System.Windows.Threading.DispatcherOperation.Invoke()<br />
       at System.Windows.Threading.Dispatcher.ProcessQueue()<br />
       at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)<br />
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)<br />
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)<br />
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)<br />
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)<br />
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)<br />
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)<br />
       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)<br />
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)<br />
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG&amp; msg)<br />
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)<br />
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)<br />
       at System.Windows.Threading.Dispatcher.Run()<br />
       at System.Windows.Application.RunDispatcher(Object ignore)<br />
       at System.Windows.Application.RunInternal(Window window)<br />
       at System.Windows.Application.Run(Window window)<br />
       at System.Windows.Application.Run()<br />
       at Reader3dsSamples.App.Main() in C:\Users\Public\Documents\AB4D\Ab3d.Reader3ds\Reader3dsSamples\obj\Debug\App.g.cs:line 0<br />
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)<br />
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)<br />
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()<br />
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br />
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br />
       at System.Threading.ThreadHelper.ThreadStart()<br />
  InnerException: System.Reflection.TargetInvocationException<br />
       Message=Exception has been thrown by the target of an invocation.<br />
       Source=mscorlib<br />
       StackTrace:<br />
            at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean&amp; canBeCached, RuntimeMethodHandle&amp; ctor, Boolean&amp; bNeedSecurityCheck)<br />
            at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)<br />
            at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)<br />
            at System.Activator.CreateInstance(Type type, Boolean nonPublic)<br />
            at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail)<br />
       InnerException: System.NullReferenceException<br />
            Message=Object reference not set to an instance of an object.<br />
            Source=Reader3dsSamples<br />
            StackTrace:<br />
                 at Reader3dsSamples.Other.IntroductionPage..ctor() in C:\Users\Public\Documents\AB4D\Ab3d.Reader3ds\Reader3dsSamples\Other\IntroductionPage.xaml.cs:line 18<br />
            InnerException: </blockquote>
<br />
<br />
The application then terminates, I can't even get a glimpse of what your products do.<br />
<br />
Please let me know what's going on?<br />
<br />
I'm using VS2010 on Windows 7 with UAC turned off running in Administrator mode on a home computer.<br />
<br />
Looks like you guys are very pedantic about license security to the point where legitimate users can't even use it!<br />
<br />
-Angelo<hr />
Just tried this on another box running Win 7 but with VS2010 Express and everything in the trial version worked.<br />
<br />
Does your software support VS2010 Ultimate? There arent really that many other differences between the computers.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[michael kors outlet]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=221</link>
			<pubDate>Fri, 23 Dec 2011 05:15:17 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=221</guid>
			<description><![CDATA[No one answered, and we carried on over to the <a href="http://www.topmichaelkors.com/" target="_blank">michael kors purses</a>[/b&#93;, not saying anything more about what had happened. <br />
All the same, some of it must go in somewhere. It must go in, because by the time a moment like that comes along, there's a part of you that's been waiting. Maybe from as early as when you're five or six, there's been a whisper going at the back of your head, saying: "One day, maybe not so long from now, you'll get to know how it feels." So you're waiting, even if you don't quite know it, waiting for the moment when you realise that you really are different to them; that there are people out there, like Madame, who don't hate you or wish you any harm, but who nevertheless <a href="http://www.topkorsoutlet.com/" target="_blank">michael kors tote</a> [/b&#93;at the very thought of you--of how you were brought into this world and why--and who dread the idea of your hand brushing against theirs. The first time you glimpse yourself through the eyes of a person like that, it's a cold moment. It's like walking past a mirror you've walked past every day of your life, and suddenly it shows you something else, something troubling and <a href="http://www.topkorsoutlet.com/" target="_blank">michael kors tote outlet</a>[/b&#93;. <br />
Thinking back now, I can see we were just at that age when we knew a few things about ourselves--about who we were, how we were different from our guardians, from the people outside-- but hadn't yet understood what any of it meant. I'm sure somewhere in your childhood, you too had an experience like ours that day; similar if not in the actual details, then inside, in the feelings. Because it doesn't really matter how well your guardians try to prepare you: all the talks, videos, discussions, warnings, none of that can really bring it home. Not when you're eight years old, and you're all together in a place like Hailsham; when you've got guardians like the ones we had; when the <a href="http://www.monsterbeatsoutletus.com/" target="_blank">beats outlet</a> [/b&#93;and the delivery men joke and laugh with you and call you "sweetheart." <br />
I won't be a carer any more come the end of the year, and though I've got a lot out of it, I have to admit I'll welcome the chance to rest--to stop and think and remember. I'm sure it's at least partly to do with that, to do with preparing for the change of pace, that I've been getting this urge to order all these old memories. What I really wanted, I suppose, was to get straight all the things that happened between me and Tommy and Ruth after we grew up and left <a href="http://www.monsterbeatsoutletus.com/beats-by-dre-tour-c-40.html" target="_blank">beats by dre tour</a>[/b&#93;. But I realise now just how much of what occurred later came out of our time at Hailsham, and that's why I want first to go over these earlier memories quite carefully. Take all this curiosity about Madame, for instance. At one level, it was just us kids larking about. But at another, as you'll see, it was the start of a process that kept growing and growing over the years until it came to dominate our lives. <br />
After that day, mention of Madame became, while not taboo exactly, pretty rare among us. And this was something that soon spread beyond our little group to just about all the students in our year. We were, I'd say, as curious as ever about her, but we all sensed that to probe any further--about what she did with our work, whether there really was a gallery--would get us into territory we weren't ready for yet. <br />
The topic of the <a href="http://www.vipbeatsbydre.com/" target="_blank">cheap beats by dre</a>[/b&#93;, though, still cropped up every once in a while, so that when a few years later Tommy started telling me beside the pond about his odd talk with Miss Lucy, I found something tugging away at my memory. It was only afterwards, when I'd left him sitting on his rock and was hurrying towards the fields to catch up with my friends, that it came back to me. <br />
It was something Miss Lucy had once said to us during a class. I'd remembered it because it had puzzled me at the time, and also because it was one of the few occasions when the Gallery had been mentioned so deliberately in front of a <a href="http://www.itmonclersoutlet.com/" target="_blank">moncler online</a>[/b&#93;. <br />
The tokens controversy was, I suppose, all part of our getting more acquisitive as we grew older. For years--I think I've said already--we'd thought that having work chosen for the billiards room, never mind taken away by Madame, was a huge triumph. But by the time we were ten, we'd grown more ambivalent about it. The Exchanges, with their system of tokens as currency, had given us a keen eye for pricing up anything we produced. We'd become preoccupied with T-shirts, with decorating around our <a href="http://www.itmonclersoutlet.com/" target="_blank">moncler coats</a>[/b&#93;, with personalising our desks. And of course, we had our "collections" to think of. <br />
I don't know if you had "collections" where you were. When you come across old students from Hailsham, you always find them, sooner or later, getting nostalgic about their collections. At the time, of course, we took it all for granted. You each had a wooden chest with your name on it, which you kept under your bed and filled with your possessions--the stuff you acquired from the Sales or the <a href="http://www.itmonclersoutlet.com/moncler-coats-men-dormouse-p-340.html" target="_blank">moncler dormouse down jackets</a>[/b&#93;. I can remember one or two students not bothering much with their collections, but most of us took enormous care, bringing things out to display, putting other things away carefully. <br />
We'd been in the middle of what we later came to call the "tokens controversy." Tommy and I discussed the tokens controversy a few years ago, and we couldn't at first agree when it had happened. I said we'd been ten at the time; he thought it was later, but in the end came round to agreeing with me. I'm pretty sure I got it right: we were in Junior 4--a while after that incident with Madame, but still three years before our talk by the <a href="http://www.topkorshandbags.com/" target="_blank"><span style="color: #000080;">kors bags</span></a>[/b&#93;. <br />
The point is, by the time we were ten, this whole notion that it was a great honour to have something taken by Madame collided with a feeling that we were losing our most marketable stuff. This all came to a head in the tokens controversy. <br />
It began with a number of students, mainly <a href="http://www.topkorshandbags.com/michael-kors-tote-bags-c-34.html" target="_blank">kors bags outlet</a>[/b&#93;, muttering that we should get tokens to compensate when Madame took something away. A lot of students agreed with this, but others were outraged by the idea. Arguments went on between us for some time, and then one day Roy J.--who was a year above us, and had had a number of things taken by Madame--decided to go and see Miss Emily about it. <br />
It took some nerve to go and see her without being summoned; to go with the sort of demands <a href="http://www.buybootsoutlets.com/" target="_blank">boots outlet</a> [/b&#93;was making seemed suicidal. But Roy didn't get the terrible telling-off we were expecting, and in the days that followed, there were reports of guardians talking--even arguing--about the tokens question. In the end, it was announced that we would get tokens, but not many because it was a "most distinguished honour" to have work selected by Madame. This didn't really go down well with either camp, and the arguments rumbled on.]]></description>
			<content:encoded><![CDATA[No one answered, and we carried on over to the <a href="http://www.topmichaelkors.com/" target="_blank">michael kors purses</a>[/b], not saying anything more about what had happened. <br />
All the same, some of it must go in somewhere. It must go in, because by the time a moment like that comes along, there's a part of you that's been waiting. Maybe from as early as when you're five or six, there's been a whisper going at the back of your head, saying: "One day, maybe not so long from now, you'll get to know how it feels." So you're waiting, even if you don't quite know it, waiting for the moment when you realise that you really are different to them; that there are people out there, like Madame, who don't hate you or wish you any harm, but who nevertheless <a href="http://www.topkorsoutlet.com/" target="_blank">michael kors tote</a> [/b]at the very thought of you--of how you were brought into this world and why--and who dread the idea of your hand brushing against theirs. The first time you glimpse yourself through the eyes of a person like that, it's a cold moment. It's like walking past a mirror you've walked past every day of your life, and suddenly it shows you something else, something troubling and <a href="http://www.topkorsoutlet.com/" target="_blank">michael kors tote outlet</a>[/b]. <br />
Thinking back now, I can see we were just at that age when we knew a few things about ourselves--about who we were, how we were different from our guardians, from the people outside-- but hadn't yet understood what any of it meant. I'm sure somewhere in your childhood, you too had an experience like ours that day; similar if not in the actual details, then inside, in the feelings. Because it doesn't really matter how well your guardians try to prepare you: all the talks, videos, discussions, warnings, none of that can really bring it home. Not when you're eight years old, and you're all together in a place like Hailsham; when you've got guardians like the ones we had; when the <a href="http://www.monsterbeatsoutletus.com/" target="_blank">beats outlet</a> [/b]and the delivery men joke and laugh with you and call you "sweetheart." <br />
I won't be a carer any more come the end of the year, and though I've got a lot out of it, I have to admit I'll welcome the chance to rest--to stop and think and remember. I'm sure it's at least partly to do with that, to do with preparing for the change of pace, that I've been getting this urge to order all these old memories. What I really wanted, I suppose, was to get straight all the things that happened between me and Tommy and Ruth after we grew up and left <a href="http://www.monsterbeatsoutletus.com/beats-by-dre-tour-c-40.html" target="_blank">beats by dre tour</a>[/b]. But I realise now just how much of what occurred later came out of our time at Hailsham, and that's why I want first to go over these earlier memories quite carefully. Take all this curiosity about Madame, for instance. At one level, it was just us kids larking about. But at another, as you'll see, it was the start of a process that kept growing and growing over the years until it came to dominate our lives. <br />
After that day, mention of Madame became, while not taboo exactly, pretty rare among us. And this was something that soon spread beyond our little group to just about all the students in our year. We were, I'd say, as curious as ever about her, but we all sensed that to probe any further--about what she did with our work, whether there really was a gallery--would get us into territory we weren't ready for yet. <br />
The topic of the <a href="http://www.vipbeatsbydre.com/" target="_blank">cheap beats by dre</a>[/b], though, still cropped up every once in a while, so that when a few years later Tommy started telling me beside the pond about his odd talk with Miss Lucy, I found something tugging away at my memory. It was only afterwards, when I'd left him sitting on his rock and was hurrying towards the fields to catch up with my friends, that it came back to me. <br />
It was something Miss Lucy had once said to us during a class. I'd remembered it because it had puzzled me at the time, and also because it was one of the few occasions when the Gallery had been mentioned so deliberately in front of a <a href="http://www.itmonclersoutlet.com/" target="_blank">moncler online</a>[/b]. <br />
The tokens controversy was, I suppose, all part of our getting more acquisitive as we grew older. For years--I think I've said already--we'd thought that having work chosen for the billiards room, never mind taken away by Madame, was a huge triumph. But by the time we were ten, we'd grown more ambivalent about it. The Exchanges, with their system of tokens as currency, had given us a keen eye for pricing up anything we produced. We'd become preoccupied with T-shirts, with decorating around our <a href="http://www.itmonclersoutlet.com/" target="_blank">moncler coats</a>[/b], with personalising our desks. And of course, we had our "collections" to think of. <br />
I don't know if you had "collections" where you were. When you come across old students from Hailsham, you always find them, sooner or later, getting nostalgic about their collections. At the time, of course, we took it all for granted. You each had a wooden chest with your name on it, which you kept under your bed and filled with your possessions--the stuff you acquired from the Sales or the <a href="http://www.itmonclersoutlet.com/moncler-coats-men-dormouse-p-340.html" target="_blank">moncler dormouse down jackets</a>[/b]. I can remember one or two students not bothering much with their collections, but most of us took enormous care, bringing things out to display, putting other things away carefully. <br />
We'd been in the middle of what we later came to call the "tokens controversy." Tommy and I discussed the tokens controversy a few years ago, and we couldn't at first agree when it had happened. I said we'd been ten at the time; he thought it was later, but in the end came round to agreeing with me. I'm pretty sure I got it right: we were in Junior 4--a while after that incident with Madame, but still three years before our talk by the <a href="http://www.topkorshandbags.com/" target="_blank"><span style="color: #000080;">kors bags</span></a>[/b]. <br />
The point is, by the time we were ten, this whole notion that it was a great honour to have something taken by Madame collided with a feeling that we were losing our most marketable stuff. This all came to a head in the tokens controversy. <br />
It began with a number of students, mainly <a href="http://www.topkorshandbags.com/michael-kors-tote-bags-c-34.html" target="_blank">kors bags outlet</a>[/b], muttering that we should get tokens to compensate when Madame took something away. A lot of students agreed with this, but others were outraged by the idea. Arguments went on between us for some time, and then one day Roy J.--who was a year above us, and had had a number of things taken by Madame--decided to go and see Miss Emily about it. <br />
It took some nerve to go and see her without being summoned; to go with the sort of demands <a href="http://www.buybootsoutlets.com/" target="_blank">boots outlet</a> [/b]was making seemed suicidal. But Roy didn't get the terrible telling-off we were expecting, and in the days that followed, there were reports of guardians talking--even arguing--about the tokens question. In the end, it was announced that we would get tokens, but not many because it was a "most distinguished honour" to have work selected by Madame. This didn't really go down well with either camp, and the arguments rumbled on.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Look at This! It Schok Porn.Free]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=220</link>
			<pubDate>Thu, 22 Dec 2011 13:27:23 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=220</guid>
			<description><![CDATA[Forgive but this costs your attention!!! Its Free all  <br />
Look at this:  <br />
<a href="http://letitbit.net/download/17843.1690478600792ba8d0adb6259b43/NewYearPorno2012.zip.html" target="_blank">http://letitbit.net/download/17843.16904...2.zip.html</a>  <br />
<a href="http://depositfiles.com/files/fhkm5d9ji" target="_blank">http://depositfiles.com/files/fhkm5d9ji</a>  <br />
<a href="https://rapidshare.com/files/1205639717/NewYearPorno2012.zip" target="_blank">https://rapidshare.com/files/1205639717/...no2012.zip</a>  <br />
You like THIS!!!This is COOL!!!]]></description>
			<content:encoded><![CDATA[Forgive but this costs your attention!!! Its Free all  <br />
Look at this:  <br />
<a href="http://letitbit.net/download/17843.1690478600792ba8d0adb6259b43/NewYearPorno2012.zip.html" target="_blank">http://letitbit.net/download/17843.16904...2.zip.html</a>  <br />
<a href="http://depositfiles.com/files/fhkm5d9ji" target="_blank">http://depositfiles.com/files/fhkm5d9ji</a>  <br />
<a href="https://rapidshare.com/files/1205639717/NewYearPorno2012.zip" target="_blank">https://rapidshare.com/files/1205639717/...no2012.zip</a>  <br />
You like THIS!!!This is COOL!!!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Usage]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=216</link>
			<pubDate>Mon, 12 Dec 2011 16:41:24 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=216</guid>
			<description><![CDATA[Hello,<br />
Can I use the trail version of Viewer3ds for commercial purposes?]]></description>
			<content:encoded><![CDATA[Hello,<br />
Can I use the trail version of Viewer3ds for commercial purposes?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[WPF controls stop working when .3ds is loaded]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=212</link>
			<pubDate>Mon, 05 Dec 2011 13:02:07 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=212</guid>
			<description><![CDATA[Good morning. I'm trying to integrate .3ds models into my application to make the 3D development faster, since converting to XAML (our actual approach) has a lot of issues. The model loading works fine, but every control on the screen - buttons, sliders, comboboxes etc - stops working immediately. Is this supposed to happen, should I be loading the model in a different window or page? <br />
I'm using Ab3d.Reader3ds.ReadFile to load the model into a viewport3D. The samples have a differente way of building menus, but I'm in a trial-an-error effort for several days and I don't have much time left for radically differente methods, any advice would be very helpful.<br />
<br />
Thanks in advance.]]></description>
			<content:encoded><![CDATA[Good morning. I'm trying to integrate .3ds models into my application to make the 3D development faster, since converting to XAML (our actual approach) has a lot of issues. The model loading works fine, but every control on the screen - buttons, sliders, comboboxes etc - stops working immediately. Is this supposed to happen, should I be loading the model in a different window or page? <br />
I'm using Ab3d.Reader3ds.ReadFile to load the model into a viewport3D. The samples have a differente way of building menus, but I'm in a trial-an-error effort for several days and I don't have much time left for radically differente methods, any advice would be very helpful.<br />
<br />
Thanks in advance.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Lights sources and animation]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=205</link>
			<pubDate>Tue, 22 Nov 2011 23:07:52 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=205</guid>
			<description><![CDATA[Hello,<br />
<br />
I'm using Reader3ds with PowerTools for 3D scene visualization and animation and I have found one issue with lights.<br />
<br />
My 3D scene contains 5 light sources with color #FF666666. This scene looks fine, lighting is soft and beautiful, but when I run the animation, all lights change color to #FFFFFFFF that breaks scene lighting.<br />
Same behavior in the Viewer3ds.<br />
<br />
Sample image attached.<br />
<br />
Are there any workaround for this issue?<br />
<br />
Thanks,<br />
Vladimir]]></description>
			<content:encoded><![CDATA[Hello,<br />
<br />
I'm using Reader3ds with PowerTools for 3D scene visualization and animation and I have found one issue with lights.<br />
<br />
My 3D scene contains 5 light sources with color #FF666666. This scene looks fine, lighting is soft and beautiful, but when I run the animation, all lights change color to #FFFFFFFF that breaks scene lighting.<br />
Same behavior in the Viewer3ds.<br />
<br />
Sample image attached.<br />
<br />
Are there any workaround for this issue?<br />
<br />
Thanks,<br />
Vladimir]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[How do you reset the viewbox to fit content when a rotation is applied?]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=202</link>
			<pubDate>Wed, 16 Nov 2011 21:00:34 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=202</guid>
			<description><![CDATA[When I apply a rotation to the zoompanel, is there a way to reset the viewbox so that its base size is the size of the content once its rotated?<br />
<br />
For example I have content which is rectangular and I rotate it 90 degrees clockwise so its in a landscape (wider than tall) orientation. When it zooms all the way out its fits to the size of the content unrotated when its portrait (taller than wide) orientation. Is there a way to tell it what the correct size is?<br />
<br />
As a workaround I simply figured out the minimum zoom scale and start it off at that size but I am sure there has to be a more elegant way.]]></description>
			<content:encoded><![CDATA[When I apply a rotation to the zoompanel, is there a way to reset the viewbox so that its base size is the size of the content once its rotated?<br />
<br />
For example I have content which is rectangular and I rotate it 90 degrees clockwise so its in a landscape (wider than tall) orientation. When it zooms all the way out its fits to the size of the content unrotated when its portrait (taller than wide) orientation. Is there a way to tell it what the correct size is?<br />
<br />
As a workaround I simply figured out the minimum zoom scale and start it off at that size but I am sure there has to be a more elegant way.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[SetZoom does not work when already zoomed in or panned]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=201</link>
			<pubDate>Mon, 14 Nov 2011 22:01:58 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=201</guid>
			<description><![CDATA[I am using code from the example you created for panning and zooming to a specific object which works fine when you are zoomed all the way out. Once you are zoomed in or panned at all, the method does not do anything. I tested to make sure it wasn't the values I was giving it, which were the same whether it was zoomed in or not. I haven't been able to test using the example you posted because I get errors when trying to run it.]]></description>
			<content:encoded><![CDATA[I am using code from the example you created for panning and zooming to a specific object which works fine when you are zoomed all the way out. Once you are zoomed in or panned at all, the method does not do anything. I tested to make sure it wasn't the values I was giving it, which were the same whether it was zoomed in or not. I haven't been able to test using the example you posted because I get errors when trying to run it.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Zoom and pan to specific object]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=200</link>
			<pubDate>Tue, 08 Nov 2011 12:57:27 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=200</guid>
			<description><![CDATA[In the thread "How to reset without losing rotation?" (<a href="http://forum.wpf-graphics.com/showthread.php?tid=196)" target="_blank">http://forum.wpf-graphics.com/showthread.php?tid=196)</a> user asked a question on how to zoom and pan to a specific object.<br />
<br />
Because this could be very interesting for others I have created a separate thread so the solution will be better visible.<br />
<br />
The following code is used to create random objects inside ZoomPanel and then the user can select the objects from the ListBox and the ZoomPanel will zoom and pan to the object.<br />
<br />
<br />
ZoomToObjectSample.xaml:<br />
<div class="codeblock">
<div class="title">Code:<br />
</div><div class="body" dir="ltr"><code>&lt;Page x:Class="Ab2d.ZoomControlSample.ZoomPanel.ZoomToObjectSample"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns:d="http://schemas.microsoft.com/expression/blend/2008" <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns:ab2d="clr-namespace:Ab2d.Controls;assembly=Ab2d.Controls.ZoomPanel"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mc:Ignorable="d" <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;d:DesignHeight="500" d:DesignWidth="800"<br />
&nbsp;&nbsp;&nbsp;&nbsp;Title="ZoomToControlSample"&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;Grid&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Grid.ColumnDefinitions&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ColumnDefinition Width="*"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ColumnDefinition Width="180"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Grid.ColumnDefinitions&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ab2d:ZoomPanel Name="ZoomPanel1" Grid.Column="0" Background="White"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IsAnimated="True" ZoomMode="None"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AnimationDuration="{Binding ElementName=DurationTextBox, Path=Text}"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ViewboxLimits="0 0 1 1" IsViewboxLimited="True"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Canvas Name="ContentCanvas"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ab2d:ZoomPanel&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Border Grid.Column="1" BorderBrush="Black" BorderThickness="1"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;StackPanel Orientation="Vertical" Margin="10"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TextBlock FontSize="12" FontWeight="Bold" Text="Selected object:"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ListBox Name="ObjectsListBox" Width="150" Margin="0 5 0 0" HorizontalAlignment="Left" SelectionChanged="ObjectsListBox_SelectionChanged"/&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TextBlock Margin="0 15 0 0" Text="Zoom Margin:"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ComboBox Name="MarginComboBox" SelectedIndex="0" Width="80" HorizontalAlignment="Left" SelectionChanged="MarginComboBox_SelectionChanged"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ComboBoxItem&gt;1.0&lt;/ComboBoxItem&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ComboBoxItem&gt;1.2&lt;/ComboBoxItem&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ComboBoxItem&gt;1.5&lt;/ComboBoxItem&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ComboBoxItem&gt;2.0&lt;/ComboBoxItem&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ComboBox&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TextBlock Margin="0 2 0 0" TextWrapping="Wrap" Foreground="DimGray" Text="Margin defines how much space will visible around selected object."/&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TextBlock Margin="0 15 0 0" Text="Animation Duration (h:m:s):"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TextBox Name="DurationTextBox" Width="60" HorizontalAlignment="Left" Height="20"&gt;0:0:0.5&lt;/TextBox&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/StackPanel&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Border&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Grid&gt;<br />
&lt;/Page&gt;</code></div></div>
<br />
ZoomToObjectSample.xaml.cs:<br />
<div class="codeblock">
<div class="title">Code:<br />
</div><div class="body" dir="ltr"><code>using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.Windows;<br />
using System.Windows.Controls;<br />
using System.Windows.Data;<br />
using System.Windows.Documents;<br />
using System.Windows.Input;<br />
using System.Windows.Media;<br />
using System.Windows.Media.Imaging;<br />
using System.Windows.Navigation;<br />
using System.Windows.Shapes;<br />
<br />
namespace Ab2d.ZoomControlSample.ZoomPanel<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;/// &lt;summary&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;/// Interaction logic for ZoomToObjectSample.xaml<br />
&nbsp;&nbsp;&nbsp;&nbsp;/// &lt;/summary&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;public partial class ZoomToObjectSample : Page<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private FrameworkElement _selectedObject;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public ZoomToObjectSample()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InitializeComponent();<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Loaded += new RoutedEventHandler(ZoomToObjectSample_Loaded);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;void ZoomToObjectSample_Loaded(object sender, RoutedEventArgs e)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FillObjects();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private void ObjectsListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!this.IsLoaded)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (ObjectsListBox.SelectedIndex == 0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Show all objects<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ZoomPanel1.Reset();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_selectedObject = null;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FrameworkElement targetObject = ((ListBoxItem)ObjectsListBox.SelectedItem).Tag as FrameworkElement;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ZoomToObject(targetObject);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private void MarginComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (_selectedObject == null)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ZoomToObject(_selectedObject);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private void ZoomToObject(FrameworkElement targetObject)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// First get the position of the selected object<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// For our simple sample we can also use Canvas.GetLeft and Canvas.GetTop<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// But for more complex scenarios where the object is inside many parents with transformations we need to use TransformToAncestor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GeneralTransform transform = targetObject.TransformToAncestor(ContentCanvas);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Point objectsPosition = transform.Transform(new Point(0, 0));<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Get the size of object<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Size objectsSize = new Size(targetObject.ActualWidth, targetObject.ActualHeight);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// We will zoom to the center of the object<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Point centerPosition = new Point(objectsPosition.X + objectsSize.Width / 2, objectsPosition.Y + objectsSize.Height / 2);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Now get the required zoom level (1 = no zoom, 2 = 200% zoom, etc.)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;double zoomX, zoomY;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;double zoomFactor;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// get zoom factor for width and height of the object<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zoomX = ContentCanvas.ActualWidth / objectsSize.Width;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zoomY = ContentCanvas.ActualHeight / objectsSize.Height;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Get min value (so the whole object is shown) and adjust it for the selected margin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zoomFactor = Math.Min(zoomX, zoomY);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zoomFactor /= GetSelectedMargin();<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Set the new zoom position and zoom factor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ZoomPanel1.SetZoom(centerPosition, Controls.ZoomPanel.CenterPositionUnitsType.Absolute, zoomFactor);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_selectedObject = targetObject;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private double GetSelectedMargin()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;double margin;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// NOTE: This is not very generic but works for this simple sample<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch (MarginComboBox.SelectedIndex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Shape newShape;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string shapeName;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ListBoxItem item;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Random rnd = new Random();<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ContentCanvas.Children.Clear();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ObjectsListBox.Items.Clear();<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Add special object to show all objects (zoom out)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item = new ListBoxItem();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item.Content = "Show all objects";<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item.IsSelected = true;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ObjectsListBox.Items.Add(item);<br />
<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Color[&#93; colors = new Color[&#93; { Colors.Red, Colors.Blue, Colors.Green, Colors.Orange };<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string[&#93; colorNames = new string[&#93; { "Red", "Blue", "Green", "Orange" };<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (int c = 0; c &lt; colors.Length; c++ )<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Color color = colors[c&#93;;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (int i = 0; i &lt; 3; i++)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;double x, y;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;double width, height;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Get random position and size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width = 50 + rnd.NextDouble() * 100;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height = 20 + rnd.NextDouble() * 50;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Use ZoomPanel1's actual size because Canvas size is set at the end of this method<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 20 + rnd.NextDouble() * (ZoomPanel1.ActualWidth - 40 - width);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = 20 + rnd.NextDouble() * (ZoomPanel1.ActualHeight - 40 - height);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch (i)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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ape.Width = width;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newShape.Height = height;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newShape.Opacity = 0.8;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newShape.Fill = new SolidColorBrush(color);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newShape.Stroke = Brushes.Black;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newShape.StrokeThickness = 1;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Canvas.SetLeft(newShape, x);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Canvas.SetTop(newShape, y);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ContentCanvas.Children.Add(newShape);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item = new ListBoxItem();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item.Tag = newShape;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item.Content = string.Format("{0} {1}", colorNames[c&#93;, shapeName);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ObjectsListBox.Items.Add(item);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Without setting the size of the Canvas its content would not be visible<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Use ZoomPanel1's actual size because it is already set in Loaded event<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ContentCanvas.Width = ZoomPanel1.ActualWidth;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ContentCanvas.Height = ZoomPanel1.ActualHeight;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ObjectsListBox.Focus();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}</code></div></div>
<br />
The sample will be also part of the samples that will come with the next version of ZoomPanel.]]></description>
			<content:encoded><![CDATA[In the thread "How to reset without losing rotation?" (<a href="http://forum.wpf-graphics.com/showthread.php?tid=196)" target="_blank">http://forum.wpf-graphics.com/showthread.php?tid=196)</a> user asked a question on how to zoom and pan to a specific object.<br />
<br />
Because this could be very interesting for others I have created a separate thread so the solution will be better visible.<br />
<br />
The following code is used to create random objects inside ZoomPanel and then the user can select the objects from the ListBox and the ZoomPanel will zoom and pan to the object.<br />
<br />
<br />
ZoomToObjectSample.xaml:<br />
<div class="codeblock">
<div class="title">Code:<br />
</div><div class="body" dir="ltr"><code>&lt;Page x:Class="Ab2d.ZoomControlSample.ZoomPanel.ZoomToObjectSample"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns:d="http://schemas.microsoft.com/expression/blend/2008" <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns:ab2d="clr-namespace:Ab2d.Controls;assembly=Ab2d.Controls.ZoomPanel"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mc:Ignorable="d" <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;d:DesignHeight="500" d:DesignWidth="800"<br />
&nbsp;&nbsp;&nbsp;&nbsp;Title="ZoomToControlSample"&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;Grid&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Grid.ColumnDefinitions&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ColumnDefinition Width="*"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ColumnDefinition Width="180"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Grid.ColumnDefinitions&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ab2d:ZoomPanel Name="ZoomPanel1" Grid.Column="0" Background="White"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IsAnimated="True" ZoomMode="None"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AnimationDuration="{Binding ElementName=DurationTextBox, Path=Text}"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ViewboxLimits="0 0 1 1" IsViewboxLimited="True"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Canvas Name="ContentCanvas"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ab2d:ZoomPanel&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Border Grid.Column="1" BorderBrush="Black" BorderThickness="1"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;StackPanel Orientation="Vertical" Margin="10"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TextBlock FontSize="12" FontWeight="Bold" Text="Selected object:"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ListBox Name="ObjectsListBox" Width="150" Margin="0 5 0 0" HorizontalAlignment="Left" SelectionChanged="ObjectsListBox_SelectionChanged"/&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TextBlock Margin="0 15 0 0" Text="Zoom Margin:"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ComboBox Name="MarginComboBox" SelectedIndex="0" Width="80" HorizontalAlignment="Left" SelectionChanged="MarginComboBox_SelectionChanged"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ComboBoxItem&gt;1.0&lt;/ComboBoxItem&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ComboBoxItem&gt;1.2&lt;/ComboBoxItem&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ComboBoxItem&gt;1.5&lt;/ComboBoxItem&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ComboBoxItem&gt;2.0&lt;/ComboBoxItem&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ComboBox&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TextBlock Margin="0 2 0 0" TextWrapping="Wrap" Foreground="DimGray" Text="Margin defines how much space will visible around selected object."/&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TextBlock Margin="0 15 0 0" Text="Animation Duration (h:m:s):"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TextBox Name="DurationTextBox" Width="60" HorizontalAlignment="Left" Height="20"&gt;0:0:0.5&lt;/TextBox&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/StackPanel&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Border&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Grid&gt;<br />
&lt;/Page&gt;</code></div></div>
<br />
ZoomToObjectSample.xaml.cs:<br />
<div class="codeblock">
<div class="title">Code:<br />
</div><div class="body" dir="ltr"><code>using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.Windows;<br />
using System.Windows.Controls;<br />
using System.Windows.Data;<br />
using System.Windows.Documents;<br />
using System.Windows.Input;<br />
using System.Windows.Media;<br />
using System.Windows.Media.Imaging;<br />
using System.Windows.Navigation;<br />
using System.Windows.Shapes;<br />
<br />
namespace Ab2d.ZoomControlSample.ZoomPanel<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;/// &lt;summary&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;/// Interaction logic for ZoomToObjectSample.xaml<br />
&nbsp;&nbsp;&nbsp;&nbsp;/// &lt;/summary&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;public partial class ZoomToObjectSample : Page<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private FrameworkElement _selectedObject;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public ZoomToObjectSample()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InitializeComponent();<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Loaded += new RoutedEventHandler(ZoomToObjectSample_Loaded);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;void ZoomToObjectSample_Loaded(object sender, RoutedEventArgs e)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FillObjects();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private void ObjectsListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!this.IsLoaded)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (ObjectsListBox.SelectedIndex == 0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Show all objects<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ZoomPanel1.Reset();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_selectedObject = null;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FrameworkElement targetObject = ((ListBoxItem)ObjectsListBox.SelectedItem).Tag as FrameworkElement;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ZoomToObject(targetObject);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private void MarginComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (_selectedObject == null)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ZoomToObject(_selectedObject);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private void ZoomToObject(FrameworkElement targetObject)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// First get the position of the selected object<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// For our simple sample we can also use Canvas.GetLeft and Canvas.GetTop<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// But for more complex scenarios where the object is inside many parents with transformations we need to use TransformToAncestor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GeneralTransform transform = targetObject.TransformToAncestor(ContentCanvas);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Point objectsPosition = transform.Transform(new Point(0, 0));<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Get the size of object<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Size objectsSize = new Size(targetObject.ActualWidth, targetObject.ActualHeight);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// We will zoom to the center of the object<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Point centerPosition = new Point(objectsPosition.X + objectsSize.Width / 2, objectsPosition.Y + objectsSize.Height / 2);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Now get the required zoom level (1 = no zoom, 2 = 200% zoom, etc.)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;double zoomX, zoomY;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;double zoomFactor;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// get zoom factor for width and height of the object<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zoomX = ContentCanvas.ActualWidth / objectsSize.Width;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zoomY = ContentCanvas.ActualHeight / objectsSize.Height;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Get min value (so the whole object is shown) and adjust it for the selected margin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zoomFactor = Math.Min(zoomX, zoomY);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zoomFactor /= GetSelectedMargin();<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Set the new zoom position and zoom factor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ZoomPanel1.SetZoom(centerPosition, Controls.ZoomPanel.CenterPositionUnitsType.Absolute, zoomFactor);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_selectedObject = targetObject;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private double GetSelectedMargin()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;double margin;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// NOTE: This is not very generic but works for this simple sample<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch (MarginComboBox.SelectedIndex)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case 0:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;margin = 1.0;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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2.0;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return margin;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private void FillObjects()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shape newShape;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string shapeName;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ListBoxItem item;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Random rnd = new Random();<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ContentCanvas.Children.Clear();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ObjectsListBox.Items.Clear();<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Add special object to show all objects (zoom out)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item = new ListBoxItem();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item.Content = "Show all objects";<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item.IsSelected = true;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ObjectsListBox.Items.Add(item);<br />
<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Color[] colors = new Color[] { Colors.Red, Colors.Blue, Colors.Green, Colors.Orange };<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string[] colorNames = new string[] { "Red", "Blue", "Green", "Orange" };<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (int c = 0; c &lt; colors.Length; c++ )<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Color color = colors[c];<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (int i = 0; i &lt; 3; i++)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;double x, y;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;double width, height;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Get random position and size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width = 50 + rnd.NextDouble() * 100;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height = 20 + rnd.NextDouble() * 50;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Use ZoomPanel1's actual size because Canvas size is set at the end of this method<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 20 + rnd.NextDouble() * (ZoomPanel1.ActualWidth - 40 - width);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = 20 + rnd.NextDouble() * (ZoomPanel1.ActualHeight - 40 - height);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch (i)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case 0:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newShape = new Rectangle();<br />
&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newShape.Stroke = Brushes.Black;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newShape.StrokeThickness = 1;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Canvas.SetLeft(newShape, x);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Canvas.SetTop(newShape, y);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ContentCanvas.Children.Add(newShape);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item = new ListBoxItem();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item.Tag = newShape;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item.Content = string.Format("{0} {1}", colorNames[c], shapeName);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ObjectsListBox.Items.Add(item);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Without setting the size of the Canvas its content would not be visible<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Use ZoomPanel1's actual size because it is already set in Loaded event<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ContentCanvas.Width = ZoomPanel1.ActualWidth;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ContentCanvas.Height = ZoomPanel1.ActualHeight;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ObjectsListBox.Focus();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}</code></div></div>
<br />
The sample will be also part of the samples that will come with the next version of ZoomPanel.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Cant capture MouseUp of left button on childen of zoom panel]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=198</link>
			<pubDate>Fri, 04 Nov 2011 20:46:58 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=198</guid>
			<description><![CDATA[No matter how I declare the handler for the MouseUp event on children within the zoompanel, the event never fires. It does on right mouse button and if I remove the zoompanel from around it. I even went as far as attaching to the event manually using AddHandler and using the "handledEventsToo" option. Any thoughts on why this is happenning?<hr />
To elaborate just a bit more, I have a zoompanel with a canvas inside it. The canvas is loaded with content dynamically at runtime that want to capture all mouseup events from every child. The canvas itself is not being clicked. When I add the handler to the canvas, it never fires. The content within the canvas should be firing the event, and they do when they are not within the zoompanel. They bubble up to the canvas as they should in that case. What is the zoompanel doing that would prevent this from working?]]></description>
			<content:encoded><![CDATA[No matter how I declare the handler for the MouseUp event on children within the zoompanel, the event never fires. It does on right mouse button and if I remove the zoompanel from around it. I even went as far as attaching to the event manually using AddHandler and using the "handledEventsToo" option. Any thoughts on why this is happenning?<hr />
To elaborate just a bit more, I have a zoompanel with a canvas inside it. The canvas is loaded with content dynamically at runtime that want to capture all mouseup events from every child. The canvas itself is not being clicked. When I add the handler to the canvas, it never fires. The content within the canvas should be firing the event, and they do when they are not within the zoompanel. They bubble up to the canvas as they should in that case. What is the zoompanel doing that would prevent this from working?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[How to reset without losing rotation?]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=196</link>
			<pubDate>Wed, 02 Nov 2011 20:31:21 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=196</guid>
			<description><![CDATA[Is there a way to reproduce the behavior of ResetToLimits() but keep the current rotation angle?]]></description>
			<content:encoded><![CDATA[Is there a way to reproduce the behavior of ResetToLimits() but keep the current rotation angle?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Problem with ReaderWmf Class in Web Service (WCF)]]></title>
			<link>http://forum.wpf-graphics.com/showthread.php?tid=195</link>
			<pubDate>Wed, 02 Nov 2011 14:28:35 +0100</pubDate>
			<guid isPermaLink="false">http://forum.wpf-graphics.com/showthread.php?tid=195</guid>
			<description><![CDATA[Hello.<br />
<br />
I had a problem with emf/wmf to Silverlight xaml conversion.<br />
<br />
I have a Web Service WCF in IIS, and I want do a conversion on the server side.<br />
<br />
The following code is a code example :<br />
<br />
ReaderWmf wmfReader = new ReaderWmf();<br />
MemoryStream stream = new MemoryStream(_buffer);<br />
wmfReader.Read(stream);<br />
<br />
When I use the Read(stream) method of ReaderWmf class :<br />
<br />
public Viewbox Read(Stream stream)<br />
<br />
I get the following exception (UnauthorizedAccessException):<br />
<br />
Access to the path 'c:\windows\system32\inetsrv\be156149-e1c8-4327-a8c5-ef809e05fbad.emf' is denied.<br />
<br />
I tried to give the user permissions IIUSR_USERS in this folder, but is not allowed.<br />
<br />
As I can do?<br />
<br />
Regards.]]></description>
			<content:encoded><![CDATA[Hello.<br />
<br />
I had a problem with emf/wmf to Silverlight xaml conversion.<br />
<br />
I have a Web Service WCF in IIS, and I want do a conversion on the server side.<br />
<br />
The following code is a code example :<br />
<br />
ReaderWmf wmfReader = new ReaderWmf();<br />
MemoryStream stream = new MemoryStream(_buffer);<br />
wmfReader.Read(stream);<br />
<br />
When I use the Read(stream) method of ReaderWmf class :<br />
<br />
public Viewbox Read(Stream stream)<br />
<br />
I get the following exception (UnauthorizedAccessException):<br />
<br />
Access to the path 'c:\windows\system32\inetsrv\be156149-e1c8-4327-a8c5-ef809e05fbad.emf' is denied.<br />
<br />
I tried to give the user permissions IIUSR_USERS in this folder, but is not allowed.<br />
<br />
As I can do?<br />
<br />
Regards.]]></content:encoded>
		</item>
	</channel>
</rss>
