Smart Selection
This commit is contained in:
@@ -260,11 +260,20 @@ namespace BeWo.View.Detail
|
||||
}
|
||||
private void TemplatesTreeView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
var selection = TreeListControlTemplates.SelectedItem as PlatzhalterVM;
|
||||
var platzhalter = TreeListControlTemplates.SelectedItem as PlatzhalterVM;
|
||||
|
||||
if (selection.Platzhalter != null)
|
||||
if (platzhalter.Platzhalter != null)
|
||||
{
|
||||
EditorControl.Document.InsertText(EditorControl.Document.CaretPosition, "[" + selection.Platzhalter + "]");
|
||||
var doc = EditorControl.Document;
|
||||
var selection = doc.Selection;
|
||||
|
||||
if(selection.Length > 0)
|
||||
{
|
||||
doc.Delete(selection);
|
||||
}
|
||||
|
||||
var range = EditorControl.Document.InsertText(EditorControl.Document.CaretPosition, "[" + platzhalter.Platzhalter + "]");
|
||||
EditorControl.Document.Selection = range;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user