Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

XF ControlTemplate and dynamic contentview

$
0
0

Hi,
I'm using the ControlTemplate for my layout in my app which working fine so far. I have defined the parent template in App.xaml and bind the properties for actions in backend ContentPage commands. On each command I dynamically create the Contents (like Grid, StackLoyout etc) and change them to my page content property.
Now in one of my dynamic view I have a button which when clicked, I need to call a method or command from the CurrentPage so that I can change the Content with another page

I have tried the following but without success?
btScan.SetBinding(Button.CommandProperty, new Binding("ScanCommand" ));
btScan.SetBinding(Button.CommandProperty, new Binding("TemplateBinding ScanCommand" ));
btScan.SetBinding(Button.CommandProperty, new Binding("BindingContext.ScanCommand" ));
Any idea how can I bind the button so that it call the page command?

Thanks in advance


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>