WinUI3 C++WinRT Issue sharing class to all view models.

Ryan Gallagher 21 Reputation points

How do I share data bindings across pages? I have my MainWindow and am trying to use a frame to navigate to sub pages. These sub pages need access to the bindings of the mainWindow. I am using C++ and most examples have each view model self contained or don't go far enough to show how to share a view model. They simply show passing of information through their click handler. If there is an answer to this in C++WinRT please point me towards it. I was thinking of instantiating the view model on the app level and then referencing it across each View model.

Thank you.

Universal Windows Platform (UWP)
Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
694 questions
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,441 questions
{count} votes