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

i cant get the control id in code behind

$
0
0

xamarin forms.4.0.0.49 standard
VS v-16.1.4

hello all,
i cant get the control id in code behind, any suggestions?

--------- XAML

<Switch x:Name="swStart_definiteTime"
                    Toggled="Sw_Toggled"                    
                    VerticalOptions="Center"
                    HorizontalOptions="End"

                    IsEnabled="True"  
                    IsToggled="True"


                    ></Switch>

--------------------- codeB

 private void Sw_Toggled(object sender, ToggledEventArgs e)
        {
            var sw = ((Switch)sender);
            var sID = sw.Id.ToString();
            var isOn = sw.IsToggled;


Viewing all articles
Browse latest Browse all 89864

Trending Articles



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