I'm using Prism for MVVM. In my main window, I have a ribbon menu, and a tab control which shows all of my views. I want to be able to dynamically update my ribbon with contextual commands based on which view is currently selected. The binding is more complicated than just a simple list of commands (each command has an icon, subcommands, different sizes, grouping, etc.), so I think I need to somehow get a reference to my ribbon control within the main view model so I can programatically add/configure my ribbon commands. How do I get a reference to the view from within the view model?
How do I access my view from within my view model with Prism?
507 Views Asked by Ben Rubin At
1
There are 1 best solutions below
Related Questions in PRISM
- UTF-8 text pop up out of the parent frame
- Viewmodel as ILogEventSink in a Prism application
- How to get hardware back button working on Prism Maui
- How to get android Navbar back button working on Prism MAUI
- A native MAUI equivalent for Prism's INavigationParameters?
- Why is the DataContext on my View Null in a Custom RegionBehavior using Prism?
- Back button is not visible in maui, using Prism
- Unable to create project Prism.Maui Visual Studio 2022
- Prism WPF CompositeCommand issues
- What's new in Prism 8 and 9
- Prism navigation builder issue on existing .Net Maui 8 application
- Is this an appropriate way to ensure Xamarin Prism Subscriptions get unsubscribed?
- How can I test function with prism event aggregator subscripe inside?
- Serilog sub-logging to sinks defined in runtime
- Issues Encountered with Region Initialization in WPF Forms
Related Questions in PRISM-7
- WPF App using Prism 7: How to Registration and Navigation for a VM using a Interface with Multiple Concrete Classes
- No regions in regionmanager using Microsoft Dependency Injection in prism application (7.2)
- PRISM 7 log4net integration
- How can I update my ribbon with context items based on the selected view and view model?
- Retrieve unity container type registration from configuration file in PRISM 7
- Working with nested views using Prism with IsNavigationTarget which can return false
- Prism, accessing DryIoC container from AppDelegate
- How do I access my view from within my view model with Prism?
- Can I dynamically size dialogs that are opened with IDialogService in Prism?
- Prism 7.2 WPF - Probable issue with ViewModelLocationProvider
- How do I specify constructor parameters in my dependency injection container in Prism?
- Missing documentation for Prism 7 WPF
- Xamarin Prism7 - IUnityContainer doesn't have the types I registered
- modal dialog in prism 7.2
- How to navigate between View with Prism 7.2?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Use
i:Interaction.Behaviorsto attach theLoadedevent of your view to a command on your view model and pass the view as parameter.And then, get mad while writing the test suites for this. If I were you, I'd do everything else before I force view types into the view model...