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

It is more performatic to declare a content view inside of page or calling it via reference xmlns?

$
0
0

With Reference

<ContentPage
                xmlns="http://xamarin.com/schemas/2014/forms"
                xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                x:Class="MyProject.Views.TestPage"
                xmlns:view="clr-namespace:MyProject.Views.Templates"
             >
            <AbsoluteLayout>

             <!--MAIN FORM-->
             <StackLayout AbsoluteLayout.LayoutBounds="1,1,1,1"
                          AbsoluteLayout.LayoutFlags="All">
               <Label Text="Test"/>
             </StackLayout>

             <!--PopUpView-->
             <view:MyContentView     AbsoluteLayout.LayoutBounds="0,0,1,1"
                                     AbsoluteLayout.LayoutFlags="All"/>

            </AbsoluteLayout>

</ContentPage>

Without Reference

<ContentPage
            xmlns="http://xamarin.com/schemas/2014/forms"
            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
            x:Class="MyProject.Views.TestPage">
        <AbsoluteLayout>

         <!--MAIN FORM-->
         <StackLayout            AbsoluteLayout.LayoutBounds="1,1,1,1"
                                 AbsoluteLayout.LayoutFlags="All">
           <Label Text="Test"/>
         </StackLayout>

         <!--PopUpView-->
         <ContentView            AbsoluteLayout.LayoutBounds="0,0,1,1"
                                 AbsoluteLayout.LayoutFlags="All">
           <StackLayout>
            <Label Text="My List"/>
            <ListView>
            </ListView>
           </StackLayout>
         </ContentView>

        </AbsoluteLayout>
  </ContentPage>

Viewing all articles
Browse latest Browse all 77050

Trending Articles



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