Add "action" setting type to create buttons.
This commit is contained in:
parent
310287b0af
commit
212c8ec209
1 changed files with 15 additions and 0 deletions
|
|
@ -925,6 +925,21 @@ namespace Observatory.UI.Views
|
||||||
settingsGrid.AddControl(stackPanel, settingsGrid.RowDefinitions.Count - 1, 0, 2);
|
settingsGrid.AddControl(stackPanel, settingsGrid.RowDefinitions.Count - 1, 0, 2);
|
||||||
settingsGrid.AddControl(settingBrowse, settingsGrid.RowDefinitions.Count - 1, 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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue