iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
I am hoping someone can help point me in the right direction for this.
I have a page with a GlassLabelon it. Also on this page is a UXFrame. When I load a page into the UXFrame I need to change the content of the GlassLabel. Can anyone tell me how to get the GlassLabel when I am in the page loaded into the UXFrame?
Regards,
Mark
I created a simple sample based on your scenario. In the sample, UXFrame; GlassLabel; and UXButton are added into UXPage1.xaml. The UXButton is used to load Home.xaml into the UXFrame. The Content property of GlassLabel is bind to a ViewModel property named GlassLabelTitle. By default, the GlassLabel’s content displays “Original Content”. After Home.xaml is loaded, the GlassLabel’s content displays “Content after modified”.
Please kindly check the attached simple sample and let us know whether it helps or not.
I have worked this out. I can use the following:
Dim frame As UXFrame = UXFrame.GetPrimaryNavigator(Me.GetRootVisual) Dim glTitle = frame.FindNameDeep("SampleControl2")glTitle.Content = "A new title"
Hi Mark,
Although the above approach may work, it's not a recommended design pattern because you're tightly coupled to a specific UI.
The best way to handle the communication is through the ViewModel. You can have the GlassLabel bound to a property in the ViewModel, let's say "{Binding Title}".
Later, in your child page (loaded inside the UXFrame), you can access the ViewModel through the DataContext and change the Title as necessary in the ViewModel.
For example, setting viewModel.Title = "New Title" in the ViewModel would automatically update the View elements bound to it.
Hope this helps,Jimmy
Ok, so at the risk of straying into general silverlight concepts, do you have an example of being able to have glasslabel bound to a property in a ViewModel and then updating this from a silverlight page embedded in a UXFrame?
Hi Yudi,
Thank you so much for taking the time to create that sample. It is perfect, exactly what I needed to see.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname