Git Product home page Git Product logo

candyshop's Introduction

candyshop

Themes/skins for Windows Presentation Foundation (WPF)

Screenshot

something

Integration with your project

  1. Reference Candido in your project.
  2. In App.xaml under <Application.Resources> you need to add following code:
<ResourceDictionary>
  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="/Candido;component/Hybrid.xaml" />
  </ResourceDictionary.MergedDictionaries>
  
  <!-- Workaround for ResourceDictionary bug/optimization. Don't remove line below. -->
  <Style TargetType="{x:Type Rectangle}" />
</ResourceDictionary>

Note about windows

Styles will be applied to all controls except Windows. You need to apply Window style manually:

<Window Style="{StaticResource Hybrid.WindowTheme}">

Spacing property

Have you ever thought how to optimize following code?

<StackPanel>
  <Button Margin="0,0,0,10">Button 1</Button>
  <Button Margin="0,0,0,10">Button 2</Button>
  <Button Margin="0,0,0,10">Button 3</Button>
  <Button Margin="0">Button 4</Button>
</StackPanel>

You can do it as easy as:

<StackPanel xmlns:candido="clr-namespace:Candido;assembly=Candido" candido:Spacing.Vertical="10">
  <Button>Button 1</Button>
  <Button>Button 2</Button>
  <Button>Button 3</Button>
  <Button>Button 4</Button>
</StackPanel>

In this example it will automatically add bottom margin for all controls except last one. So the margin will be applied between controls. You can do the same with:

<StackPanel
  xmlns:candido="clr-namespace:Candido;assembly=Candido"
  candido:Spacing.Horizontal="10"
  Orientation="Horizontal">

In this case it will space items horizontally (set right margin except last control).

To keep it short, you can move xmlns declaration to parent element, for example:

<Window xmlns:candido="clr-namespace:Candido;assembly=Candido">
  <StackPanel candido:Spacing.Vertical="10">
    <Button>Button 1</Button>
    <Button>Button 2</Button>
    <Button>Button 3</Button>
    <Button>Button 4</Button>
  </StackPanel>
  <StackPanel candido:Spacing.Horizontal="10" Orientation="Horizontal">
    <Button>Button 1</Button>
    <Button>Button 2</Button>
  </StackPanel>
<Window>

candyshop's People

Contributors

stil avatar

Watchers

James Cloos avatar Musa.Zulu 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.