Giter Club home page Giter Club logo

marduk.controls's Introduction

Marduk.Controls

Yet another controls library for Universal Windows Apps.

Nuget

Marduk.Controls

PM> Install-Package Marduk.Controls

Controls

PhotowallView

A stand alone photo wall layout control with virtualizing capability. photowall

WaterfallFlowView

A stand alone waterfall flow layout controls with virtualizing capability. ![waterfall] (https://cloud.githubusercontent.com/assets/9367842/17103352/8064d730-52b0-11e6-865d-bdd07396ed0c.gif)

Features

UI Virtualizing

Both of PhotowallView and WaterfallFlowView support UI virtualizing which enables the system to render only the visible items inside the viewport.

Incremental Loading

Just make your ItemSource inherits form Windows.UI.Xaml.Data.ISupportIncrementalLoading then the control would do the rest.

Item Tapped Event

Hooking up to the ItemTapped event with PhotowallView or WaterfallFlowView to get notified when an item was tapped.

Easy Styling/ Comprehensive Visual States/ Multiselection

Easily styling the appearence of PhotowallView and WaterfallFlowView with the preset visual states such as "IsSelected" and "NotSelected" etc.

High Performance for Random Insert, Remove and Change

Freely random insert, remove or change an item, even it's been virtualized.

High Performance for Resizing

You can use Marduk.Controls.OrientedVirtualizingPanel.Resizer to optimize resize behavior

Quick Start

01. Create a WaterfallFlowView or PhotowallView inside a ScrollViewer, set some properties.

<ScrollViewer>
    <controls:WaterfallFlowView xmlns:controls="using:Marduk.Controls" x:Name="Panel" 
    StackCount="3" DelayMeasure="True">
    </controls:WaterfallFlowView>
</ScrollViewer>

02. Binding your item source.

<ScrollViewer>
    <controls:WaterfallFlowView xmlns:controls="using:Marduk.Controls" x:Name="Panel" 
    ItemSource="{Binding VM.Items}" StackCount="3" DelayMeasure="True">
    </controls:WaterfallFlowView>
</ScrollViewer>

03. Create ItemDataTemplate and ItemContainerStyle.

<ScrollViewer>
    <controls:WaterfallFlowView xmlns:controls="using:Marduk.Controls" x:Name="Panel" 
    ItemSource="{Binding}" StackCount="3" DelayMeasure="True">
        <controls:WaterfallFlowView.ItemContainerStyle>
            <Style TargetType="ContentControl">
                <Setter Property="HorizontalAlignment" Value="Stretch"></Setter>
                <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
            </Style>
        </controls:WaterfallFlowView.ItemContainerStyle>
        <controls:WaterfallFlowView.ItemTemplate>
            <DataTemplate>
                <Border Height="{Binding Length}" Background="{Binding Brush}" HorizontalAlignment="Stretch">
                    <TextBlock FontSize="50" Text="{Binding Num}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                </Border>
            </DataTemplate>
        </controls:WaterfallFlowView.ItemTemplate>
    </controls:WaterfallFlowView>
</ScrollViewer>

04. Optimization for Resizing.

(1) Create a resizer class which implements Marduk.Controls.IItemResizer.

public class MyItemResizer : IItemResizer
{
    public Size Resize(object item, Size oldSize, Size availableSize)
    {
        return new Size(availableSize.Width, oldSize.Height);
    }
}

(2) Assign the resizer to the WaterfallFlowView.

<ScrollViewer>
    <controls:WaterfallFlowView xmlns:controls="using:Marduk.Controls" x:Name="Panel" ItemSource="{Binding}" StackCount="3" DelayMeasure="True">
        <controls:WaterfallFlowView.Resizer>
            <local:MyItemResizer/>
        </controls:WaterfallFlowView.Resizer>
        <controls:WaterfallFlowView.ItemContainerStyle>
            <Style TargetType="ContentControl">
                <Setter Property="HorizontalAlignment" Value="Stretch"></Setter>
                <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
            </Style>
        </controls:WaterfallFlowView.ItemContainerStyle>
        <controls:WaterfallFlowView.ItemTemplate>
            <DataTemplate>
                <Border Height="{Binding Length}" Background="{Binding Brush}" HorizontalAlignment="Stretch">
                    <TextBlock FontSize="50" Text="{Binding Num}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                </Border>
            </DataTemplate>
        </controls:WaterfallFlowView.ItemTemplate>
    </controls:WaterfallFlowView>
</ScrollViewer>

marduk.controls's People

Contributors

devkanro avatar tlaster avatar validvoid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

marduk.controls's Issues

PhotoWallView example

Any chance to post an example? i tried to base waterflowview but it behaves very different from the gif on the main page

@higankanshi

Groupping

Is it compatible with sourceGroupping like IsSourceGrouped attribute?

Windows Runtime metadata validation failed

Error Found: The general metadata correctness test detected the following errors:
Parameter __returnValue of method GetVisableItems of type Marduk.Controls.ILayout in file Marduk.Controls.winmd references the non-Windows Runtime type IntPtr. Windows Runtime types can reference only Windows Runtime types.
Parameter __returnValue of method get_VisableItems of type Marduk.Controls.__IOrientedVirtualizingPanelProtectedNonVirtuals in file Marduk.Controls.winmd references the non-Windows Runtime type IntPtr. Windows Runtime types can reference only Windows Runtime types.
Parameter __returnValue of method get_VisableItems of type Marduk.Controls.OrientedVirtualizingPanel in file Marduk.Controls.winmd references the non-Windows Runtime type IntPtr. Windows Runtime types can reference only Windows Runtime types.

CanDragItems implementation

Fantastic controls! Was looking for efficient and incremental loading with virtualization control with such layout for ages!

But it would also be nice to have other features from ListrViewBase like CanDratItem implementation.

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.