Giter Site home page Giter Site logo

uiplaceholder's Introduction

UIPlaceholder

Creating a placeholder in your app to show users that data is loading

Here is the XAML code to create a simple UI Placeholder

Sample building a simple UI

  <!--  PLACEHOLDER NO REPEAT  -->
       <Grid
           HorizontalAlignment="Center"
           VerticalAlignment="Top"
           ui:PlaceholderEx.CurrentPlaceholderState="{Binding CurrentState}">
           <ui:PlaceholderEx.PlaceholderStateItems>
               <ui:PlaceholderStateItem StateItemKey="Loading">
                   <StackPanel Orientation="Horizontal">
                       <ui:PlaceholderSkeletonView
                           Width="120"
                           Height="120"
                           Margin="20"
                           Background="#ebebeb" />
                       <StackPanel Margin="20" Orientation="Vertical">
                           <ui:PlaceholderSkeletonView
                               Width="190"
                               Height="20"
                               Margin="10"
                               Background="#ebebeb" />
                           <ui:PlaceholderSkeletonView
                               Width="150"
                               Height="20"
                               Margin="10"
                               Background="#ebebeb" />
                           <ui:PlaceholderSkeletonView
                               Width="120"
                               Height="20"
                               Margin="10"
                               Background="#ebebeb" />
                       </StackPanel>
                   </StackPanel>
               </ui:PlaceholderStateItem>
           </ui:PlaceholderEx.PlaceholderStateItems>

           <StackPanel Margin="50" Orientation="Horizontal">
               <Rectangle
                   Width="20"
                   Height="40"
                   Fill="Blue" />

               <Rectangle
                   Width="20"
                   Height="40"
                   Fill="White" />

               <Rectangle
                   Width="20"
                   Height="40"
                   Fill="Red" />
           </StackPanel>
       </Grid>

alt text

Using the datatemplate

 <!--  TEMPLATE WITH REPEAT  DATATEMPLATE  -->
  <Grid
            HorizontalAlignment="Center"
            VerticalAlignment="Top"
            ui:PlaceholderEx.CurrentPlaceholderState="{Binding CurrentState}">
            <ui:PlaceholderEx.PlaceholderStateItems>
                <ui:PlaceholderStateItem RepeatItem="3" StateItemKey="Loading">
                    <ui:PlaceholderStateItem.PlaceholderTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <ui:PlaceholderSkeletonView
                                    Width="120"
                                    Height="120"
                                    Margin="20"
                                    Background="#ebebeb" />
                                <StackPanel Margin="20" Orientation="Vertical">
                                    <ui:PlaceholderSkeletonView
                                        Width="190"
                                        Height="20"
                                        Margin="10"
                                        Background="#ebebeb" />
                                    <ui:PlaceholderSkeletonView
                                        Width="150"
                                        Height="20"
                                        Margin="10"
                                        Background="#ebebeb" />
                                    <ui:PlaceholderSkeletonView
                                        Width="120"
                                        Height="20"
                                        Margin="10"
                                        Background="#ebebeb" />
                                </StackPanel>
                            </StackPanel>
                        </DataTemplate>
                    </ui:PlaceholderStateItem.PlaceholderTemplate>

                </ui:PlaceholderStateItem>
            </ui:PlaceholderEx.PlaceholderStateItems>


            <StackPanel Margin="50" Orientation="Horizontal">
                <Rectangle
                    Width="20"
                    Height="40"
                    Fill="Blue" />

                <Rectangle
                    Width="20"
                    Height="40"
                    Fill="White" />

                <Rectangle
                    Width="20"
                    Height="40"
                    Fill="Red" />
            </StackPanel>
        </Grid>

alt text

uiplaceholder's People

Contributors

delaire avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.