Skip to content

Latest commit

 

History

History
142 lines (100 loc) · 3.68 KB

README.md

File metadata and controls

142 lines (100 loc) · 3.68 KB

🧰 AK.Toolkit

The AK.Toolkit will be a collection of controls, helpers, etc... stuff that I need but couldn't find somewhere else.

🔵 WinUI 3

⏺️ ButtonExtensions

🎬 YouTube

Provides additional features for the Button control:

  • PointerOverBackgroundLightnessFactor
  • PressedBackgroundLightnessFactor
<Button
    toolkit:ButtonExtensions.PointerOverBackgroundLightnessFactor="1.2"
    toolkit:ButtonExtensions.PressedBackgroundLightnessFactor="0.8"
    Background="Blue"
    Click="Button_Click"
    Content="Click" />

📜 RichTextBlockExtensions

Extensions that make it easier to highlight RichTextBlock.

<Button>
    <RichTextBlock
        toolkit:RichTextBlockExtensions.HighlightingText="{x:Bind HighlightingText, Mode=OneWay}"
        toolkit:RichTextBlockExtensions.Text="Button"
        IsHitTestVisible="False" />

ScrollBar Extensions Annotations Screenshot

💻 AutoCompleteTextBox

🎬 YouTube

A TextBox control that shows a suggestion based on input. AutoCompleteTextBox shows a suggestion inside the TextBox control.

<toolkit:AutoCompleteTextBox
    IsSuggestionCaseSensitive="false"
    SuggestionForeground="HotPink"
    SuggestionPrefix="..."
    SuggestionSuffix=" ? [Press Right]"
    SuggestionsSource="{x:Bind Suggestions, Mode=OneWay}" />

AutoCompleteTextBox Screenshot

🔢 NumberBoxEx

🎬 YouTube

In addition to the built-in NumberBox:

  • NumberHorizontalAlignment DependencyProperty
  • IsDeleteButtonVisible DependencyProperty

Coming soon:

  • Thousand separators
    • Comma
    • Space

⚒️ ScrollBarExtensions.KeepExpanded

🎬 YouTube

An attached property that keeps ScrollBars expanded.

<!--  ScrollBar  -->
<ScrollBar toolkit:ScrollBarExtensions.KeepVerticalExpanded="True" />
<!-- ScrollViewer  -->
<ScrollViewer
    toolkit:ScrollBarExtensions.KeepHorizontalExpanded="True"
    toolkit:ScrollBarExtensions.KeepVerticalExpanded="True">
    <ItemsRepeater />
</ScrollViewer>
<!--  ListView  -->
<ListView toolkit:ScrollBarExtensions.KeepVerticalExpanded="True" />
<!--  GridView  -->
<GridView toolkit:ScrollBarExtensions.KeepVerticalExpanded="True" />
<!-- NavigationView  -->
<NavigationView toolkit:ScrollBarExtensions.KeepVerticalExpanded="True" />

⚒️ ScrollBarExtensions.Annotations

🎬 YouTube

An attached property that adds annotations to vertical ScrollBars.

First, you need to create a collection of your annotations that implements IAnnotation or just use the built-in BasicAnnotation.

public interface IAnnotation
{
    double Value { get; }

    ValueType ValueType { get; }

    Shape Shape { get; }

    double LeftOffset { get; }
}

public record BasicAnnotation : IAnnotation
{
    public double Value { get; }

    public ValueType ValueType { get; set; }

    public Shape Shape { get; private set; }

    public double LeftOffset { get; set; }

    public BasicAnnotation(double value, Shape shape)
    {
        Value = value;
        Shape = shape;
    }
}

Then bind your annotations using ScrollBarExtensions.VerticalAnnotations attached property.

<controls:DataGrid
    toolkit:ScrollBarExtensions.KeepVerticalExpanded="True"
    toolkit:ScrollBarExtensions.VerticalAnnotations="{x:Bind Annotations, Mode=OneWay}"
    ItemsSource="{x:Bind Users}">

ScrollBar Extensions Annotations Screenshot