Virtual device variables

Hi
Excuse me, but my knowledge in xaml (and English) is next to nothing!!!
I created a page in THR to control my samsung tv where each button on this page triggers a scene created in the Tuya application.
For example: to go to channel 5, I defined in the DataAction of the button the scene called “samsungTv5.Scene” and it works fine.
I would like to use this same page to control other tvs. My idea was to create a variable called “tvname”, for example: when I click on the “LG tv” button, it sets the variable tvname=“Lgtv”. I’ve done it with no problems.
So, on the tv page the “binding” field of the DataAction I would set to " {Binding tvname5.Scene} or something like that, where tvname5 would be replaced by Lgtv, which would call the scene “Lgtv5.scene”.
Is it possible to call the contents of a variable in this field? can anybody help me?

Use templating. You don’t need a virtual device variable to do this. In the page you design, don’t use a specific device instance, use @Device. Then when you open the page call App.OpenDeviceDetails & pass in the name of the device you wish to open as a parameter.

For more details on templates you can watch John’s video. He goes over them in detail.

See my page browser tutorial…https://youtu.be/xpurL6kSplE

Ah yes, even better.

1 Like

I had already seen John’s video, and it didn’t work for me.
It’s just that I created a “content page” and not a “browser page”.
In browser page I can set “device” property :grimacing:
Solved!
Live and learn…
Thank you Bill and John

2 Likes