2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-04-05 17:39:39 -04:00

Add "action" setting type to create buttons.

This commit is contained in:
Xjph 2021-10-24 12:34:30 -02:30
parent 310287b0af
commit 212c8ec209

View File

@ -925,6 +925,21 @@ namespace Observatory.UI.Views
settingsGrid.AddControl(stackPanel, settingsGrid.RowDefinitions.Count - 1, 0, 2);
settingsGrid.AddControl(settingBrowse, settingsGrid.RowDefinitions.Count - 1, 2);
break;
case Action action:
Button actionButton = new()
{
Content = label.Text,
HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Left
};
actionButton.Click += (object sender, RoutedEventArgs e) =>
{
action.Invoke();
};
settingsGrid.AddControl(actionButton, settingsGrid.RowDefinitions.Count - 1, 0);
break;
}
}