Silverlight Tip of the Day #66 – How to copy XAML for Silverlight from Expression Designer
Microsoft Expression Design is a professional illustration and graphic design tool that lets you build compelling elements. This tool is especially great for creating vector based graphics for your elements.
If you do not have Expression Designer, check out: http://www.microsoft.com/expression/products/FAQ.aspx?key=design for more info.
Once you have created an element from this tool, you can copy the XAML of the objects you created directly into your Silverlight application through the Windows clipboard.
To do this, open your project and select the element you want to copy in Expression Designer. To select an element, mouse left click on the canvas and hold the mouse button down while moving the selection rectangle over your element. When it’s selected, it should be highlighted in red like this element:
Next, choose Edit->Options->Clipboard (XAML)…
This will bring up the Options dialog. From the “Clipboard format” option, drop down the combo box and choose “XAML Silverlight Canvas”. Click the OK button when done.
From the Edit menu choose Edit->Copy XAML.
Finally, open up your Silverlight Application project in Visual Studio. Open the XAML page you want to copy the element into. When ready, press Ctrl+v to paste your elements XAML into your XAML page.
Result:
Thank you,
--Mike Snow
Subscribe in a reader