Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DYN-5437 Export image button shortcut #13550

Merged
merged 2 commits into from
Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.ObjectModel;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows.Controls;
using System.Windows.Media;
Expand Down Expand Up @@ -39,15 +39,15 @@ public ObservableCollection<ShortcutBarItem> ShortcutBarRightSideItems
/// Construct a ShortcutToolbar.
/// </summary>
/// <param name="updateManager"></param>
public ShortcutToolbar(IUpdateManager updateManager)
public ShortcutToolbar(DynamoViewModel dynamoViewModel)
{
shortcutBarItems = new ObservableCollection<ShortcutBarItem>();
shortcutBarRightSideItems = new ObservableCollection<ShortcutBarItem>();

InitializeComponent();
UpdateControl.DataContext = updateManager;
UpdateControl.DataContext = dynamoViewModel.Model.UpdateManager;

var shortcutToolbar = new ShortcutToolbarViewModel();
var shortcutToolbar = new ShortcutToolbarViewModel(dynamoViewModel);
DataContext = shortcutToolbar;
}

Expand Down
13 changes: 11 additions & 2 deletions src/DynamoCoreWpf/ViewModels/Core/ShortcutToolbarViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
using Dynamo.ViewModels;
using Dynamo.UI.Commands;
using Dynamo.ViewModels;
using System;
using System.Windows;

namespace Dynamo.Wpf.ViewModels.Core
{
internal class ShortcutToolbarViewModel : ViewModelBase
{
public ShortcutToolbarViewModel()
public ShortcutToolbarViewModel(DynamoViewModel dynamoViewModel)
{
NotificationsNumber = 0;
ShowSaveImageDialogAndSaveResultCommand = new DelegateCommand(dynamoViewModel.ShowSaveImageDialogAndSaveResult);
}

private int notificationsNumber;
Expand Down Expand Up @@ -36,5 +39,11 @@ public bool IsNotificationsCounterVisible
return true;
}
}


/// <summary>
/// Exports an image from the user's 3D background or workpace
/// </summary>
public DelegateCommand ShowSaveImageDialogAndSaveResultCommand { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ private void InitializeLogin()

private void InitializeShortcutBar()
{
shortcutBar = new ShortcutToolbar(this.dynamoViewModel.Model.UpdateManager) { Name = "ShortcutToolbar" };
shortcutBar = new ShortcutToolbar(this.dynamoViewModel) { Name = "ShortcutToolbar" };

var newScriptButton = new ShortcutBarItem
{
Expand Down