Hello,
The database I've created with my LightSwitch App is a collection of rows that I want to process. The table (StudyNote) consists of four fields...
- ID: surrogate primary identity key
- BCV: (B)ook (C)hapter (V)erse. e.g. "Gen 1:1",
- CommentsRTF: My old e-Sword comments that have been persisted in Rich Text Format
- CommentsNew: What I want to use to hold my comments that I will eventually add to My Hebrew Bible website. The format (I presume) best fitted for this would be HTML.
Here's my Development Environtment: Visual Studio 2012 Update 2, SilverLight 5 & Telerik RadControls for Silverlight Q1 2013.
I mention this because the samples that I have found on the internet were based on prior versions of LS and things have changed. For example, a Silver Light Custom control can not be inside the LS project. Therefore I had to to create a seperate project which I called RadRichSilverLightClassLibrary. With in that project I created two Silverlight User Controls that utilized the Telerik RadRichTextBox controls.
Here are the steps I took to create this new project.
- Deleted the autogenerated Class1.cs file
- Added the necessary references
- Added a Silverlight User Control called ReadOnlyRtfDocumentViewer
- Dragged the RadRichTextBox control onto it and filled out the Wizard
- Added a Silverlight User Control called RichTextBoxHtmlDataProvider
- Dragged the RadRichTextBox control onto it and filled out the Wizard
For my esword LightSwitch Project, I did the following
- Created a Data Source based on the StudyNotes Resource table. This table I created and populated earlier using Sql Server Express 2012.
- Created a StudyNotesListDetail screen based on StudyNotes
- Changed the ContentRTF control to a custom control
- Selected the ReadOnlyRtfDocumentViewer User Control from the RadRichSilverLightClassLibrary Project
- Added the same Telerik references that I did to my library project. I'm not sure why this is necessary if the it already has these references. If I didn't add them, then the InitializeComponent method of the user controld would throw a Xaml Parse Exception ... the HtmlDataProvider was not found
QUESTIONS
- The way my LightSwitch application stands right now, is that I have not done anything special with the code behind. I didn't do anything else like go into the code behind and wire things up, because I don't know if I'm supposed to or not, or does this all get done declaritively with the Xaml? This is obviously a XAML newbee question. See the attached image.
- Right now my study note edit screen has a control for the RTF and empty control for the HTML. I want to also create an copy/paste button that will convert the RTF into HTML and paste into the new control. What I was wondering is if I can just do a batch and convert all the data to HTML and then decide which part of the HTML (if any) I want to keep. This would eliminate the user having to click a copy/paste button. Is this doable?
- One of the options is to save RTF data as XAML. It makes sense to have my study notes saved in HTML as that's what I website uses, but what are the advantages of saving data as XAML instead of as HTML?
Thanks,
John