|
@@ -3172,23 +3172,18 @@ public partial class MainWindow : IPanelHostControl
|
|
var button = new Fluent.Button
|
|
var button = new Fluent.Button
|
|
{
|
|
{
|
|
Header = action.Caption,
|
|
Header = action.Caption,
|
|
- LargeIcon = action.Image.AsBitmapImage(),
|
|
|
|
|
|
+ LargeIcon = action.Image?.AsBitmapImage(),
|
|
MinWidth = 60
|
|
MinWidth = 60
|
|
};
|
|
};
|
|
button.Bind<PanelAction, String>(Fluent.Button.HeaderProperty, x=>x.Caption, null);
|
|
button.Bind<PanelAction, String>(Fluent.Button.HeaderProperty, x=>x.Caption, null);
|
|
button.Bind<PanelAction, Bitmap>(Fluent.Button.LargeIconProperty, x => x.Image, new BitmapToBitmapImageConverter());
|
|
button.Bind<PanelAction, Bitmap>(Fluent.Button.LargeIconProperty, x => x.Image, new BitmapToBitmapImageConverter());
|
|
button.Bind<PanelAction, ContextMenu?>(Fluent.Button.ContextMenuProperty, x=>x.Menu);
|
|
button.Bind<PanelAction, ContextMenu?>(Fluent.Button.ContextMenuProperty, x=>x.Menu);
|
|
|
|
+ button.Bind<PanelAction, bool>(Fluent.Button.IsEnabledProperty, x => x.IsEnabled);
|
|
|
|
+ button.Bind<PanelAction, Visibility>(Fluent.Button.VisibilityProperty, x => x.Visibility);
|
|
button.DataContext = action;
|
|
button.DataContext = action;
|
|
- // if (action.Menu is not null)
|
|
|
|
- // {
|
|
|
|
- // button.ContextMenu = action.Menu;
|
|
|
|
- // }
|
|
|
|
- button.Click += (o, e) =>
|
|
|
|
- {
|
|
|
|
- action.Execute();
|
|
|
|
- };
|
|
|
|
- CurrentModules.Add(button);
|
|
|
|
|
|
+ button.Click += (o, e) => action.Execute();
|
|
Actions.Items.Add(button);
|
|
Actions.Items.Add(button);
|
|
|
|
+ CurrentModules.Add(button);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|