AmmyUI icon indicating copy to clipboard operation
AmmyUI copied to clipboard

Useful aliases and mixins

Open nesterenko-kv opened this issue 6 years ago • 4 comments

Here few useful aliases and mixins:

alias SolidColorBrush(key, color) 
{
  SolidColorBrush Key=$key
  {
    Color: $color
  }
}

alias Thickness(key, left, top, right, bottom) 
{
  Thickness Key=$key
  {
    Left: $left
    Top: $top
    Right: $right
    Bottom: $bottom
  }
}

mixin Size(width=none, height=none) for FrameworkElement
{
  Width: $width
  Height: $height
}

nesterenko-kv avatar Oct 05 '17 23:10 nesterenko-kv

Good stuff 👍

ionoy avatar Oct 06 '17 04:10 ionoy

@ionoy I'm also curious. How can this could be translated in Ammy? l:Static is System.Windows.Markup.StaticExtension the implementation of it is here Gu.Localization.

nesterenko-kv avatar Oct 06 '17 04:10 nesterenko-kv

Yeah i was also wondering about StaticExtensions, more specifically this (the OpeningEffectsOffset thing). Is it possible to achieve with AmmyUI currently without having to write XAML syntax?

Tyrrrz avatar Oct 06 '17 09:10 Tyrrrz

Just import materialDesign with typeless property:

"xmlns:materialDesign": "clr-namespace: ..."

OpeningEffectsOffset: "{materialDesign:IndexedItemOffsetMultiplier 0:0:0.05}"

or you can do something like this:

<TransitioningContent.OpeningEffectsOffset>
  0:0:0.05
</TransitioningContent.OpeningEffectsOffset>

ionoy avatar Oct 06 '17 09:10 ionoy