How can i save my XAML content into a File? - silverlight

I have a problem. I want to save a XAML state into a file, or something like this. I developed a Silverlight version of PowerPoint, and now i want to save my presentation, but i don't know how...i'm using Silverlight 3 beta(if helps)...
I would like to allow users to upload their photos, music and video file somewhere.....where and how can i do this?
Thanks,
Andrei.

Well, that's a toughy. WPF has the Xaml Writer which can send that state out. Silverlight doesn't :(
What you're doing sounds a lot like Mike Harsh's Silverlight 3 sample. His source is available; Maybe that will provide a suitable approach.

I solved the problem by saving data in XML files. When i want to recreate the state of the app i set all the parameters from my XML file.

Related

Can we use CSS in a Silverlight project

I have a problem. I want to make a web application using silver light. I just want to know that can I use a css in this, because I read the the designing of silver light is in the xaml or we use css with html tag.
Is anybody clear my confusion?
Thanks
Silverlight XAML ≠ HTML+CSS
These are all different technologies. You probably better know Adobe Flash. Well Silverlight is very similar. It (may) run in the context of a browser, but it has nothing to do with HTML and/or CSS. It uses XAML files (as you pronounce them zammel). So if you decide to write a Silverlight application you will have to use XAML files and use Expression Blend to design your UI. Doing so would be faster than hand editing XAML files.
xaml is like html + css but its not the same , they have some things in common but nothing much important .
Better find yourself good video tutorials or a book and learn it from there :)
No you can't really use CSS in a silverlight project.
If it's worth the effort, what you could do is manually load the required CSS files with the WebClient class and parse them to style your controls accordingly.
Someone did something similar with the Sharepoint theme files, which are yet another format. Using SharePoint thmx files to style Silverlight describes how to do it. Maybe you can find some inspiration from that.

Is there any way of getting a XAML Editor, either build or download?

In my current project (presentation, slide software) I need to be able to make some simple XAML, text images, movies and stuff like that.
If it were HTML I would go with fckeditor or another free editor, but what to do in XAML?
Anyone know if its possible to make one yourself (like executecommand to a IE)? or download one from anywhre on the net?
Cheers
Take a look at this question: Designing WPF Windows for Free?
The leading answer recommends Kaxaml, XAMLpad and several more options.

silverlight wrappanel

_http://www.mscui.net/PatientJourneyDemonstrator/PrimaryCare.htm
I want to create/design the similar to above site/url using silverlight.
For this I have created separate user controls(Xaml files). Please advice me the steps/way to proceed in silveright. I am using silverlight versin 2.
I am thinking to use Wrappanel to adjust all the xmal files in Home page/default page. so that I can navigate to any page.
You can grab the XAP from your internet cache, open it with any zip tool and then use something like reflector to look in the DLLs to get the XAML out, should you desire to see how they did it themselves.
There's actually a project on codeplex which demonstrates how to do this dashpart effect with full source code called blacklight, so the above is probably not necessary.

Convert a silverlight application to video format

I'm planning to make an animation with Silverlight, i want to export the animation to a video format, to be able to share it on video sharing website.
How can i do this ?
You could use a tool like Camtasia to record your screen or part of your screen. It then can be exported to a bunch of different video formats.
A pure code approach is to write a sequence of images, and then combine those images together as a video file. Eric Gunnerson has code to capture images from an animation , its WPF but would probably work in Silverlight? Codeproject has an example of converting a stream of images to an AVI video file in C#. It creates an AVI output. It would be great to go straight to mpg, but as it's compressed the input needs to be a video stream. If you do need mpg as the final output look for an off the shelf avi->mpg converter.
BTW - Let me know how you get on, I'm interested in the performance/functionality of this solution.
MrTelly: That approach would not work because Silverlight does not expose the RenderTargetBitmap class. (Well, this is not completely true, the class is there, but its constructor and methods are all marked SecurityCritical and as such are not normally accessible.)
The Camtasia solution proposed by Jakers is likely the simplest solution.
It's nuts that there isn't a simple way to do this in Silverlight, it's easy as pie in flash.

Displaying PDFs in Silverlight

I want to make a PDF document reader, and the only thing I've found to help me is "Amyuni PDF Suite" that will turn the PDF into XAML and stream that. Are there any other controls for displaying PDFs in Silverlight? Or could I add an IFrame into Silverlight and let the client render it?
Cheers
Nik
Or could I add an IFrame into Silverlight and let the client render it?
Silverlight doesn't really have that capability. You can make your Silverlight control transparent, and have an HTML div block that sits above your Silverlight control, which you could then load a PDF in, but as for displaying a PDF within Silverlight, I think you're out of luck.
Edit:
This question has some info on how to accomplish transparent Silverlight controls, I hope it helps!
If you're ok with buying the pdf converter you can do something like this:
CanvasObject.Children.Add(XamlReader.Load("xaml string from pdf converter"));
And the pdf should be rendered inside your CanvasObject.
I really think you'll get the best result with some type of conversion to XAML. I imagine it can't be that hard to write the converter yourself, I might be wrong though.
Looks like First Floor Software has a solution but it's still in preview.
http://firstfloorsoftware.com/blog/pdf-for-silverlight-preview/
What we are actually trying to do is convert the PDF to SVG, then use something like: http://www.codeplex.com/XamlTune to then go to Xaml
you can use server side conversion of PDF say into set of bitmaps or as mentioned above SVG and return by WCF service to Silverlight client.

Resources