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

How does it work ? OnIdiom

$
0
0

Hello,

I am wondering why this is working, and what is really going on at execution.

I have a layout with something like :

**XAML : **

<OnIdiom x:TypeArguments="View">
                <OnIdiom.Phone>
                    <ListView x:Name="listPhone"/>
         </OnIdiom.Phone>
        <OnIdiom.Tablet>
                    <ListView x:Name="listTablet"/>
         </OnIdiom.Tablet>
</OnIdiom>

**XAML.CS : **

 listPhone.ItemsSource = mylist;
 listTablet.ItemsSource = mylist;

When I run on Phone, listTablet is not supposed to be undeclared ?
Does it uses ressources, or it just do nothing ?
Should I check on what device I am, and set the itemSource only for the current device ?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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