private void ShowDetailsCommand_Executed(object parameter) { BinaryPart part = parameter as BinaryPart; TemplatePartDetailsWindowEventArgs detailsWindowEventArgs = new TemplatePartDetailsWindowEventArgs() { Part = part }; TemplatePartDetailsWindowRequested?.Invoke(this, detailsWindowEventArgs); if (detailsWindowEventArgs.DialogResult) { part.Name = detailsWindowEventArgs.PartName; if (part is BinarySection section) { section.LoopSettings.Type = detailsWindowEventArgs.LoopSettings.Type; section.LoopSettings.LoopCountFixed = detailsWindowEventArgs.LoopSettings.LoopCountFixed; section.LoopSettings.LoopCountReference = detailsWindowEventArgs.LoopSettings.LoopCountReference; } else if (part is BinaryValue value) { value.ValueType = detailsWindowEventArgs.ValueType; } } }
private void OnTemplatePartDetailsWindowRequested(object sender, TemplatePartDetailsWindowEventArgs e) { TemplatePartDetailsWindowView templatePartDetailsWindow = new TemplatePartDetailsWindowView(e); templatePartDetailsWindow.Owner = MainWindowView.MainWindowInstance; templatePartDetailsWindow.ShowDialog(); }
public TemplatePartDetailsWindowView(TemplatePartDetailsWindowEventArgs e) { InitializeComponent(); ViewModel = new TemplatePartDetailsWindowViewModel(e); DataContext = ViewModel; ViewModel.CloseRequested += OnCloseRequested; Loaded += (sender, e) => MoveFocus(new TraversalRequest(FocusNavigationDirection.First)); }