Pages with loading animation [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
1
down vote

favorite












I have 4 pages that can show loading indicator. This is the template for all pages:



<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Pages.SomePage">
<ContentPage.Content>
<AbsoluteLayout>
<StackLayout AbsoluteLayout.LayoutBounds="0,0,1,1"
AbsoluteLayout.LayoutFlags="SizeProportional">

<!-- Page content here -->

</StackLayout>
<BoxView IsVisible="Binding ShowLoadingAnimation"
BackgroundColor="White"
AbsoluteLayout.LayoutBounds="0,0,1,1"
AbsoluteLayout.LayoutFlags="SizeProportional"/>
<StackLayout IsVisible="Binding ShowLoadingAnimation"
AbsoluteLayout.LayoutBounds=".5,.5,110,90"
AbsoluteLayout.LayoutFlags="PositionProportional">
<ActivityIndicator IsRunning="True" Opacity=".7" WidthRequest="50" HeightRequest="50"/>
<Label Text="Binding LoadingText" FontSize="Small" HorizontalTextAlignment="Center"/>
</StackLayout>
</AbsoluteLayout>
</ContentPage.Content>
</ContentPage>


In the PageModel I set ShowLoadingAnimation = true; to show the loading indicator. And set ShowLoadingAnimation = false; when done loading.



I think this breaks with DRY principle because repeating the same XAML. Looking for a better way to implement.



Using FreshMVVM.







share|improve this question













closed as off-topic by Ludisposed, Stephen Rauch, Malachi♦ May 15 at 17:21


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Ludisposed, Stephen Rauch, Malachi
If this question can be reworded to fit the rules in the help center, please edit the question.


















    up vote
    1
    down vote

    favorite












    I have 4 pages that can show loading indicator. This is the template for all pages:



    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    x:Class="Pages.SomePage">
    <ContentPage.Content>
    <AbsoluteLayout>
    <StackLayout AbsoluteLayout.LayoutBounds="0,0,1,1"
    AbsoluteLayout.LayoutFlags="SizeProportional">

    <!-- Page content here -->

    </StackLayout>
    <BoxView IsVisible="Binding ShowLoadingAnimation"
    BackgroundColor="White"
    AbsoluteLayout.LayoutBounds="0,0,1,1"
    AbsoluteLayout.LayoutFlags="SizeProportional"/>
    <StackLayout IsVisible="Binding ShowLoadingAnimation"
    AbsoluteLayout.LayoutBounds=".5,.5,110,90"
    AbsoluteLayout.LayoutFlags="PositionProportional">
    <ActivityIndicator IsRunning="True" Opacity=".7" WidthRequest="50" HeightRequest="50"/>
    <Label Text="Binding LoadingText" FontSize="Small" HorizontalTextAlignment="Center"/>
    </StackLayout>
    </AbsoluteLayout>
    </ContentPage.Content>
    </ContentPage>


    In the PageModel I set ShowLoadingAnimation = true; to show the loading indicator. And set ShowLoadingAnimation = false; when done loading.



    I think this breaks with DRY principle because repeating the same XAML. Looking for a better way to implement.



    Using FreshMVVM.







    share|improve this question













    closed as off-topic by Ludisposed, Stephen Rauch, Malachi♦ May 15 at 17:21


    This question appears to be off-topic. The users who voted to close gave this specific reason:


    • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Ludisposed, Stephen Rauch, Malachi
    If this question can be reworded to fit the rules in the help center, please edit the question.














      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I have 4 pages that can show loading indicator. This is the template for all pages:



      <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
      xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
      x:Class="Pages.SomePage">
      <ContentPage.Content>
      <AbsoluteLayout>
      <StackLayout AbsoluteLayout.LayoutBounds="0,0,1,1"
      AbsoluteLayout.LayoutFlags="SizeProportional">

      <!-- Page content here -->

      </StackLayout>
      <BoxView IsVisible="Binding ShowLoadingAnimation"
      BackgroundColor="White"
      AbsoluteLayout.LayoutBounds="0,0,1,1"
      AbsoluteLayout.LayoutFlags="SizeProportional"/>
      <StackLayout IsVisible="Binding ShowLoadingAnimation"
      AbsoluteLayout.LayoutBounds=".5,.5,110,90"
      AbsoluteLayout.LayoutFlags="PositionProportional">
      <ActivityIndicator IsRunning="True" Opacity=".7" WidthRequest="50" HeightRequest="50"/>
      <Label Text="Binding LoadingText" FontSize="Small" HorizontalTextAlignment="Center"/>
      </StackLayout>
      </AbsoluteLayout>
      </ContentPage.Content>
      </ContentPage>


      In the PageModel I set ShowLoadingAnimation = true; to show the loading indicator. And set ShowLoadingAnimation = false; when done loading.



      I think this breaks with DRY principle because repeating the same XAML. Looking for a better way to implement.



      Using FreshMVVM.







      share|improve this question













      I have 4 pages that can show loading indicator. This is the template for all pages:



      <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
      xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
      x:Class="Pages.SomePage">
      <ContentPage.Content>
      <AbsoluteLayout>
      <StackLayout AbsoluteLayout.LayoutBounds="0,0,1,1"
      AbsoluteLayout.LayoutFlags="SizeProportional">

      <!-- Page content here -->

      </StackLayout>
      <BoxView IsVisible="Binding ShowLoadingAnimation"
      BackgroundColor="White"
      AbsoluteLayout.LayoutBounds="0,0,1,1"
      AbsoluteLayout.LayoutFlags="SizeProportional"/>
      <StackLayout IsVisible="Binding ShowLoadingAnimation"
      AbsoluteLayout.LayoutBounds=".5,.5,110,90"
      AbsoluteLayout.LayoutFlags="PositionProportional">
      <ActivityIndicator IsRunning="True" Opacity=".7" WidthRequest="50" HeightRequest="50"/>
      <Label Text="Binding LoadingText" FontSize="Small" HorizontalTextAlignment="Center"/>
      </StackLayout>
      </AbsoluteLayout>
      </ContentPage.Content>
      </ContentPage>


      In the PageModel I set ShowLoadingAnimation = true; to show the loading indicator. And set ShowLoadingAnimation = false; when done loading.



      I think this breaks with DRY principle because repeating the same XAML. Looking for a better way to implement.



      Using FreshMVVM.









      share|improve this question












      share|improve this question




      share|improve this question








      edited May 15 at 9:03
























      asked May 15 at 7:11









      Jam

      1236




      1236




      closed as off-topic by Ludisposed, Stephen Rauch, Malachi♦ May 15 at 17:21


      This question appears to be off-topic. The users who voted to close gave this specific reason:


      • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Ludisposed, Stephen Rauch, Malachi
      If this question can be reworded to fit the rules in the help center, please edit the question.




      closed as off-topic by Ludisposed, Stephen Rauch, Malachi♦ May 15 at 17:21


      This question appears to be off-topic. The users who voted to close gave this specific reason:


      • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Ludisposed, Stephen Rauch, Malachi
      If this question can be reworded to fit the rules in the help center, please edit the question.

























          active

          oldest

          votes






















          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes