windows runtime - How to do binding to Datacontext in different page -
i have textblock in mainpage.xaml. have page has textblock value bound observable collection , value changes depending on user events on page. how can bind textblock value in other page textblock value in mainpage.xaml?
can please guide me resources or examples may explain how or workaround?
well, can't directly bind properties of 2 controls on different pages since aren't displayed @ same time. you'll need store state elsewhere , retrieve values there.
basically you'll need store application state somewhere, either inside app
class or singleton/static properties. alternativelly persist state between pages (to file or setting) , retrieve again when loading page.
in case should bind controls in both pages view model retrieve values application state or stored there. way values set 1 page reflect on other one.
depending on how navigate between pages might able take advantage of parameters (frame.navigate(typeof(otherpage), parameter)
) you're limited tranferring basic types way, you'll able transfer ids not complete objects.
Comments
Post a Comment