Welcome to WindowsClient.net | Sign in | Join

Rob Relyea - XAMLified

WPF, Silverlight and XAML

Syndication

Sponsors





  • advertise here
XamlPadSample Step 1g-Silverlight support

I coded this last step a bit over a month ago, and I’ve just not had time to share it out. Yesterday, I reviewed the deltas from the Jan. 30th version I posted. They are summarized below.

The major work I added was the ability to show Silverlight 4 projects in XamlPad, in addition to WPF 4.

Several open issues as well, but I can clean up more next time, right?

http://robrelyea.com/demos/xamlPadSample links to source code download and the other XamlPadSample posts.

 

Changes in 2010-04-19 Version

Pad Project

MainWindow.xaml

  • Set Window.AllowDrop to true

MainWindow.xaml.cs

  • Added DragDrop event support to open files via DragDrop

XamlPadHelpers Project

AssemblyData.cs

  • Don't attempt Assembly.LoadFile() if the file doesn't exist. This would happen if you used a XAML file from a project that hasn't been built.

ProjectData.cs

  • Added an AssemblyResolve event handler, to better load assemblies. Look in loaded assemblies, if match, use that one.
  • GetFileInfoFromRelativePath - support absolute paths in relativePath parameter
  • Add empty else clause in case hintPath is ever null or empty.

View.cs

  • Change property Type of type Type to be TypeFullName of type String.

XamlDocument.cs

  • TODO - Why is xamlPadConfig ever null in FindOrCreateProject

XamlEngine.cs

  • Added TransformXamlDocumentToRuntimeReadyString() - Does XAML to XAML filtering (removes events, x:Class, etc..)
  • Changed LoadXamlDocument to create its own XamlObjectWriter to pass into XamlEngine.Transform
  • Changed LoadXamlDocumentWithAppResources to create its own XamlObjectWriter to pass into XamlEngine.Transform
  • Renamed LoadObjectsForDesign to Transform()
  • stopped creating XamlObjectWriter, instead rely on call to create XamlObjectWriter or XamlXmlWriter and pass it in.
  • xml:Base - if Silverlight project, only let one through
  • Return null, require caller to harvest result out of XamlObjectWriter, etc…
  • Changed WriteResourceProxyPreamble, WriteMemberValue, and WriteResourceProxyPostamble to use XamlWriter, instead of only XamlObjectWriter.

XamlPad.xaml

  • Using non-attached *ScrollbarVisibility instead of attached versions (no effective change in behavior)

XamlPad.xaml.cs

  • OnPropertyChanged() - In the silverlight project case, use SilverlightView to display content
  • Note - which silverlight DLLs can be loaded is a bit of a hack now.
  • TODO: use the SilverlightSchemaContext from XamlToolKit
  • Loading themes\generic.xaml for default datatemplate for an object per referenced blog post

SilverlightView Project

  • Silverlight 4 project which gets requests to load XamlString from host.
Published Monday, April 19, 2010 8:27 AM by Rob_Relyea
Filed under:

Comments

# Dew Drop – April 20, 2010 | Alvin Ashcraft's Morning Dew@ Tuesday, April 20, 2010 8:38 AM

Pingback from  Dew Drop – April 20, 2010 | Alvin Ashcraft's Morning Dew

# Windows Client Developer Roundup for 4/26/2010@ Monday, April 26, 2010 2:12 AM

This is Windows Client Developer roundup #21. The Windows Client Developer Roundup aggregates information

# Windows Client Developer Roundup for 4/26/2010@ Monday, April 26, 2010 2:14 AM

This is Windows Client Developer roundup #21. The Windows Client Developer Roundup aggregates information

# re: XamlPadSample Step 1g-Silverlight support@ Tuesday, June 01, 2010 6:47 AM

got the following error when I tried to start up the 1q (robrelyea.com/.../xamlPadSample)

C:\WIP\dl\xamlpad\Pad-2010-04-19\SilverlightXamlLoadEnhancements\SilverlightXamlLoadEnhancements\SilverlightXamlLoadEnhancements.csproj : error  : Unable to read the project file 'SilverlightXamlLoadEnhancements.csproj'.

C:\WIP\dl\xamlpad\Pad-2010-04-19\SilverlightXamlLoadEnhancements\SilverlightXamlLoadEnhancements\SilverlightXamlLoadEnhancements.csproj: The project file could not be loaded. Could not find a part of the path 'C:\WIP\dl\xamlpad\Pad-2010-04-19\SilverlightXamlLoadEnhancements\SilverlightXamlLoadEnhancements\SilverlightXamlLoadEnhancements.csproj'.

by AndyKS

# re: XamlPadSample Step 1g-Silverlight support@ Sunday, July 11, 2010 11:06 PM

I see the same problem. It looks like the package is missing the "SilverlightXamlLoadEnhancements" project. Is this supposed to be in a separate download package? Otherwise, this really looks good.

John K.

Leave a Comment

(required) 
(required) 
(optional)
(required) 
Page view counter