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 5404 disable menu items #13786

Merged
merged 7 commits into from
Mar 3, 2023
Merged

Dyn 5404 disable menu items #13786

merged 7 commits into from
Mar 3, 2023

Conversation

jesusalvino
Copy link
Contributor

Purpose

Implement the improvement https://jira.autodesk.com/browse/DYN-5404

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated

Reviewers

@QilongTang

FYIs

@RobertGlobant20 @filipeotero

@jesusalvino
Copy link
Contributor Author

shortcutbar_enable_5

{
int buttonIndex = ShortcutBarItems.ToList().FindIndex(item => item.ShortcutToolTip.ToUpper().Contains(buttonKey));
var _container = ShortcutItemsControl.ItemContainerGenerator.ContainerFromIndex(buttonIndex);
var _children = AllChildren(_container);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to retrieve the button in this complex way? Can we grab it by name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually We don't have access to the new, open and save buttons by name since they are dynamically created

Copy link
Contributor

@QilongTang QilongTang Mar 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Their class ShortcutBarItem is our own class, we can modify the class to add properties for searching.. When we create them, we just need to add name as well..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess my point is that lets not rely on the tooltip to search for controls

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

private void ShortcutToolbar_Loaded(object sender, RoutedEventArgs e)
{
IsSaveButtonEnabled = false;
IsExportMenuEnabled = false;
Copy link
Contributor

@QilongTang QilongTang Mar 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the initial state of these controls is already disabled from xaml, why disable these again on view loaded?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you are referring to the MenuItems, yes they are disabled in the xaml side, the above code is for the Toolbar buttons

Copy link
Contributor

@QilongTang QilongTang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@QilongTang QilongTang merged commit 16caf9b into DynamoDS:master Mar 3, 2023
sm6srw pushed a commit to sm6srw/Dynamo that referenced this pull request Mar 29, 2023
* Enabling ShortcutBar items

* Renaming property

* Using Event instead of set property

* Increasing scope and refactoring

* Update properties scope

* New and Open in the Start Page

* Adding Name property to the ShortcutItem Class
sm6srw pushed a commit that referenced this pull request Apr 5, 2023
* Enabling ShortcutBar items

* Renaming property

* Using Event instead of set property

* Increasing scope and refactoring

* Update properties scope

* New and Open in the Start Page

* Adding Name property to the ShortcutItem Class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants