private void prototypes_ViewPrototypeCode(Prototype p) { RadCodeDocumentPane doc = new RadCodeDocumentPane(); documentPaneGroup.AddItem(doc, Telerik.Windows.Controls.Docking.DockPosition.Center); doc.Editor.Text = p.GetLuaCode(); Binding myBinding = new Binding(); myBinding.Source = p; myBinding.Path = new PropertyPath("name"); myBinding.Mode = BindingMode.TwoWay; myBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged; BindingOperations.SetBinding(doc, RadDocumentPane.TitleProperty, myBinding); }
private void modStructure_OpenFile(FileInfo file) { prototypes.ParseCodeFile(file); foreach (RadCodeDocumentPane d in documentPaneGroup.Items) { if (d.codeFile == file) { d.IsSelected = true; return; } } RadCodeDocumentPane doc = new RadCodeDocumentPane(); documentPaneGroup.AddItem(doc, Telerik.Windows.Controls.Docking.DockPosition.Center); doc.OpenFile(file); }