diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-09-13 05:27:50 +0000 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-09-13 05:27:50 +0000 |
| commit | f85e1c85eac4ea3271e53b6fea6c5bda94e6a8d6 (patch) | |
| tree | 814a75a0891199ff5612ae13092e75b61c76548c /Samples/common/src/SampleBase.cs | |
| parent | 08ed2eac3ae1bccc5d1fbdeb3b596cf122a24e2f (diff) | |
wip, save commit before trying to allow 'ItemTemplate' in style
Diffstat (limited to 'Samples/common/src/SampleBase.cs')
| -rw-r--r-- | Samples/common/src/SampleBase.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Samples/common/src/SampleBase.cs b/Samples/common/src/SampleBase.cs index 5b33444a..fa6d1cde 100644 --- a/Samples/common/src/SampleBase.cs +++ b/Samples/common/src/SampleBase.cs @@ -49,7 +49,7 @@ namespace Samples static void showMsgBox (object sender) { Widget w = sender as Widget; Command cmd = w.DataSource as Command; - MessageBox.ShowModal(w.IFace, MessageBox.Type.Information, $"{cmd.Caption} CLICKED"); + MessageBox.ShowModal(w.IFace, MessageBox.Type.Information, $"{cmd?.Caption} CLICKED"); } #region Test values for Binding @@ -62,13 +62,14 @@ namespace Samples new Command("Subedit command 1", (sender) => showMsgBox (sender)), new Command("Subedit command 2 a bit longer", (sender) => showMsgBox (sender), null, false), new Command("Subedit command three", (sender) => showMsgBox (sender)) - ) + ) ); public CommandGroup FileCommands = new CommandGroup("File Commands", - new Command("File command 1", (sender) => showMsgBox (sender)), + new Command("File command 1", (sender) => showMsgBox (sender), "#Icons.gavel.svg"), new Command("File command 2 a bit longer", (sender) => showMsgBox (sender)), new Command("File command three", (sender) => showMsgBox (sender)) ); + public Command SingleCommand => new Command("Single command 1", (sender) => showMsgBox (sender), "#Icons.gavel.svg"); void initCommands() { |