public void Change(List<CustomFileSystemCover> files, FilePanel activeFilePanel) { if (ChangeSelected != null) { ChangeSelected(files, activeFilePanel); } }
/// <summary> /// Панель клонируется /// </summary> private void CloneFilePanel() { Panel panel = (Panel)this.Parent; FilePanel fp = new FilePanel(); fp.FilePanelSettings = (FilePanelSettings)this.FilePanelSettings.Clone(); panel.Children.Add(fp); }
/// <summary> /// Добавляем новую файловую панель /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnNewFilePanel_Click(object sender, RoutedEventArgs e) { FilePanel filePanel = new FilePanel(); filePanel.Height = spMain.Height; spMain.Children.Add(filePanel); Binding binding = new Binding(); binding.Source = spMain; binding.Path = new PropertyPath("Height"); binding.Mode = BindingMode.OneWay; filePanel.SetBinding(FilePanel.HeightProperty, binding); //Binding binding = new Binding(); //binding.Source = filePanel; //binding.Path = new PropertyPath("Height"); //binding.Mode = BindingMode.OneWay; //this.SetBinding(UserControl.HeightProperty, binding); }
private void CloneLevel() { Panel panel = (Panel)this.Parent; Level level = new Level(); panel.Children.Add(level); foreach (var child in this.spMain.Children) { FilePanel fp = (FilePanel)child; FilePanel newFp = new FilePanel(); newFp.FilePanelSettings = fp.FilePanelSettings; //newFp.Width = fp.Width; //newFp.Path = fp.Path; level.spMain.Children.Add(newFp); } level.Height = this.Height; }
/// <summary> /// строем отображения уровней и панелей в окне на основе currentTemplate /// </summary> private void BuildTemplateView() { spMain.Children.Clear(); foreach (var levelTemplate in currentTemplate.Levels) { Level level = new Level(); level.Height = levelTemplate.Height; foreach (var filePanelTemplate in levelTemplate.FilePanels) { FilePanel filePanel = new FilePanel(); filePanel.filePanel.FilePanelSettings = filePanelTemplate.FilePanelSettings; //filePanel.Width = filePanelTemplate.Width; //filePanel.Path = filePanelTemplate.Path; level.spMain.Children.Add(filePanel); } spMain.Children.Add(level); } }