src/TF2HUD.Editor/MainWindow.xaml.cs
/// <summary>
///     Update the page view to the selected HUD.
/// </summary>
Update the page view to the selected HUD.
Update the page view to the selected HUD .
private void SetPageView(HUD selection)
        {
            try
            {
                EditorContainer.Children.Clear();
                if (selection is null) return;
                Logger.Info($"Changing page view to: {selection.Name}.");
                EditorContainer.Children.Add(selection.GetControls());
                selection.PresetChanged += (_, _) =>
                {
                    EditorContainer.Children.Clear();
                    EditorContainer.Children.Add(selection.GetControls());
                };
            }
            catch (Exception e)
            {
                _notifier.ShowMessageBox(MessageBoxImage.Error, e.Message);
            }
        }
private void SetPageView ( HUD selection ) { try { EditorContainer . Children . Clear ( ) ; if ( selection is null ) return ; Logger . Info ( $" Changing page view to:  { selection . Name } . " ) ; EditorContainer . Children . Add ( selection . GetControls ( ) ) ; selection . PresetChanged += ( _ , _ ) => { EditorContainer . Children . Clear ( ) ; EditorContainer . Children . Add ( selection . GetControls ( ) ) ; } ; } catch ( Exception e ) { _notifier . ShowMessageBox ( MessageBoxImage . Error , e . Message ) ; } }
Update the page view to the selected HUD.
Update the page view to the selected HUD .
// If there's a HUD selection, generate the controls for that HUD's page.
selection
HUD