or
private void dockManager_ElementLoaded(object sender, LayoutSerializationEventArgs e) { if (e.AffectedElement is RadPane) { RadPane paneView = e.AffectedElement as RadPane; ILayoutPane paneVM = viewModel.LayoutPanes .OfType<ILayoutPane>() .FirstOrDefault(vm => vm.Id == e.AffectedElementSerializationTag); if (paneVM == null) { paneView.IsHidden = true; } } }paneView.IsHidden = true is called, the pane is still visible after the LoadLayout.<RadDocking> <DocumentHost> <RadSplitContainer> <Items> <RadPaneGroup SelectedIndex="0"> <Items> <RadPane IsHidden="False" IsDockable="True" /> </Items> </RadPaneGroup> </Items> </RadSplitContainer> </DocumentHost> </RadDocking>
private void dockManager_ElementLoading(object sender, LayoutSerializationLoadingEventArgs e) { if (e.AffectedElementSerializationTag == null) e.Cancel = true; } raddocument doc = new raddocument();
XamlFormatProvider provider = new XamlFormatProvider(); doc = provider.Import(value.ToString()); foreach (Paragraph paragraph in doc.EnumerateChildrenOfType<Paragraph>()) { //paragraph.Inlines foreach(Inline line in paragraph.Inlines) { } }
In other words:
If i have my raddoucment asstring raddocstring = "<t:RadDocument xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"" xmlns:t=""clr-namespace:Telerik.Windows.Documents.Model;assembly=Telerik.Windows.Documents"" xmlns:s=""clr-namespace:Telerik.Windows.Documents.Model.Styles;assembly=Telerik.Windows.Documents"" version=""1.2"" LayoutMode=""Flow"" LineSpacing=""1.15"" LineSpacingType=""Auto"" ParagraphDefaultSpacingAfter=""12"" ParagraphDefaultSpacingBefore=""0"" SectionDefaultPageSize=""816,1056""> <t:Section> <t:Paragraph> <t:Span ForeColor=""Red"" Text=""testing"" /> <t:Span ForeColor=""Blue"" Text=""testing"" /> <t:Span ForeColor=""Green"" Text=""testing"" /> </t:Paragraph> </t:Section> </t:RadDocument>";how to get testing string from above raddocument paragraphs.... please advise...its very imp and urgent
...and the view model:<PRE>
publicclassFormInfoModel{publicIDictionary<string,object> Elements{get{return_elements; }}privateIDictionary<string,object> _elements;publicFormInfoModel(){_elements =newDictionary<string,object>();_elements.Add("Order_Date",DateTime.Today);_elements.Add("Qty_1", 0);_elements.Add("Unit_Price_1", 0);}}
</PRE>
<PRE>public class FormInfoViewModel
{
public ExpandoObject Info
{
get { return _info; }
}
private ExpandoObject _info;
public void SetInfo(FormInfoModel model)
{
dynamic dobj = new ExpandoObject(); foreach (var key in model.Elements.Keys)
{
(dobj as IDictionary<string, object>).Add(key, model.Elements[key]);
}
_info = dobj;
}
}</PRE>Then in the MainWindow constructor I set the binding programmatically:
_viewModel = this.Resources["FormInfoViewModel"] as FormInfoViewModel;
ExpressionEditor.Item = _viewModel.Info;
