or
<
Grid
>
<
Grid.Resources
>
<
HierarchicalDataTemplate
x:Key
=
"NavigationItemTemplate"
>
<
ContentControl
cal:View.Model
=
"{Binding }"
/>
</
HierarchicalDataTemplate
>
<
HierarchicalDataTemplate
x:Key
=
"rootLevelTemplate"
ItemTemplate
=
"{StaticResource NavigationItemTemplate}"
ItemsSource
=
"{Binding }"
>
<
TextBlock
Text
=
"{Binding Name}"
/>
</
HierarchicalDataTemplate
>
</
Grid.Resources
>
<
telerik:RadPanelBar
x:Name
=
"pBar"
ItemTemplate
=
"{StaticResource rootLevelTemplate}"
ItemsSource
=
"{Binding NavigationItems}"
/>
</
Grid
>
public
BindableCollection<INavigationItem> NavigationItems {
get
;
set
; }
public
interface
INavigationItem
{
string
Name {
get
; }
}
[Export(
typeof
(INavigationItem)),
ExportMetadata(
"Name"
,
"Example1"
)]
public
class
Example1ViewModel : INavigationItem
{
public
string
Name
{
get
{
return
"Example1"
; }
}
}
Telerik.Windows.Documents.Model.Paragraph NextPara;
try
{
Telerik.Windows.Documents.Model.Span spanbox = editor.Document.CaretPosition.GetCurrentSpanBox().AssociatedSpan;
if
(spanbox.FontWeight==FontWeights.Bold && spanbox.ForeColor==Colors.Aqua)
{
Telerik.Windows.Documents.Model.Section currsect = editor.Document.CaretPosition.GetCurrentSectionBox().AssociatedSection;
Telerik.Windows.Documents.Model.Span currspan = editor.Document.CaretPosition.GetCurrentSpanBox().AssociatedSpan;
bool
check = editor.Document.CaretPosition.MoveToNextInline();
bool
c=editor.Document.CaretPosition.MoveToNextInline();
bool
c1=editor.Document.CaretPosition.MoveToNextInline();
var documentelement = editor.Document.CaretPosition.GetCurrentParagraphBox();
if
(documentelement !=
null
&& documentelement.GetType() ==
typeof
(Telerik.Windows.Documents.Layout.ParagraphLayoutBox))
{
Telerik.Windows.Documents.Model.Paragraph para = documentelement.AssociatedParagraph;
spanbox.Tag = Guid.NewGuid().ToString();
string
spantext = (para.Inlines.FirstOrDefault()
as
Telerik.Windows.Documents.Model.Span).Text;
if
(!
string
.IsNullOrEmpty(spantext) && spantext ==
"[@["
)
{
NextPara = para.NextSibling
as
Telerik.Windows.Documents.Model.Paragraph;
//var DocEle = new DocumentElementCollection(para);
//foreach (var item in para.Children)
//{
// DocEle.Add(item);
//}
currsect.Children.Remove(para);
//DocumentEleCollection.Add(DocEle);
while
(NextPara !=
null
)
{
if
(NextPara !=
null
&& (NextPara.Inlines.FirstOrDefault()
as
Telerik.Windows.Documents.Model.Span).Text ==
"]@]"
)
{
//var DocEle2 = new DocumentElementCollection(NextPara);
//foreach (var item in NextPara.Children)
//{
// DocEle2.Add(item);
//}
currsect.Children.Remove(NextPara);
//DocumentEleCollection.Add(DocEle2);
break
;
}
//var DocEle1 = new DocumentElementCollection(NextPara);
//foreach (var item in NextPara.Children)
//{
// DocEle1.Add(item);
//}
currsect.Children.Remove(NextPara);
//DocumentEleCollection.Add(DocEle1);
NextPara = NextPara.NextSibling
as
Telerik.Windows.Documents.Model.Paragraph;
}
}
}
}
}
catch
(Exception ex)
{ }
how should I do this, using the DragDropManager ? (I have also looked at the other handlers, but the only one I can find something about the visual is the DragInitialize handler, and it is not fired, since the dragged object does not come from inside the itemsControl)
thanks