Rh.PushpinButton.Control 1.0.1

Pushpin button control for WPF

Install-Package Rh.PushpinButton.Control -Version 1.0.1
dotnet add package Rh.PushpinButton.Control --version 1.0.1
<PackageReference Include="Rh.PushpinButton.Control" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rh.PushpinButton.Control --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

PushpinButtonControl

A pushpin button control for WPF. Has built-in overridable "pinned vs. unpinned" images.
Background and border properties can be set separately for each button state.
Based on ToggleButton.

How To Install

Install the nuget package or build Rh.PushpinButton.Control and add reference to it
from your application project. Add the namespace mapping xmlns:rh=&quot;http://schemas.rollinghours.com/wpf&quot;
to the Window element in your XAML file, then use the button like in an example below.

Sample Use

Default:

          <rh:PushpinButton />

No border, custom colors:

          <rh:PushpinButton MouseOverBackground="LightGoldenrodYellow"
                            BorderThickness="0" 
                            PressedBackground="PaleGoldenrod"
                            CheckedBackground="{Binding Background, RelativeSource={RelativeSource Self}}"/>

Custom glyph pics:

          <rh:PushpinButton EnabledPinnedImageSource="pack://application:,,,/MyApp;component/customPinned.png"
                            EnabledUnpinnedImageSource="pack://application:,,,/MyApp;component/customUnpinned.png" />

Unpinned glyph is hidden until mouse hover:

          <rh:PushpinButton Width="Auto" 
                            IsHiddenUnpinnedGlyph="True"
                            CheckedBackground="{Binding Background, RelativeSource={RelativeSource Self}}">
              <TextBlock Text="Hover over"/>
          </rh:PushpinButton>

Transparent:

          <rh:PushpinButton Cursor="Hand" 
                            Background="Transparent" BorderBrush="Transparent"
                            MouseOverBackground="Transparent" 
                            MouseOverBorder="Transparent"
                            PressedBackground="Transparent" 
                            PressedBorder="Transparent"
                            CheckedBackground="Transparent" 
                            CheckedBorder="Transparent" />

A custom styled glyph pic:

          <rh:PushpinButton EnabledPinnedImageSource="{Binding EnabledUnpinnedImageSource, RelativeSource={RelativeSource Self}}"
                            DisabledPinnedImageSource="{Binding DisabledUnpinnedImageSource, RelativeSource={RelativeSource Self}}"
                            DisabledUnpinnedImageSource="{Binding DisabledUnpinnedImageSource, RelativeSource={RelativeSource Self}}">
              <rh:PushpinButton.ImageStyle>
                  <Style TargetType="Image">
                      <Setter Property="RenderTransformOrigin" Value=".5,.5" />
                      <Setter Property="RenderTransform" >
                          <Setter.Value>
                              <RotateTransform Angle="-45" />
                          </Setter.Value>
                      </Setter>
                  </Style>
              </rh:PushpinButton.ImageStyle>
          </rh:PushpinButton>

PushpinButtonControl

A pushpin button control for WPF. Has built-in overridable "pinned vs. unpinned" images.
Background and border properties can be set separately for each button state.
Based on ToggleButton.

How To Install

Install the nuget package or build Rh.PushpinButton.Control and add reference to it
from your application project. Add the namespace mapping xmlns:rh=&quot;http://schemas.rollinghours.com/wpf&quot;
to the Window element in your XAML file, then use the button like in an example below.

Sample Use

Default:

          <rh:PushpinButton />

No border, custom colors:

          <rh:PushpinButton MouseOverBackground="LightGoldenrodYellow"
                            BorderThickness="0" 
                            PressedBackground="PaleGoldenrod"
                            CheckedBackground="{Binding Background, RelativeSource={RelativeSource Self}}"/>

Custom glyph pics:

          <rh:PushpinButton EnabledPinnedImageSource="pack://application:,,,/MyApp;component/customPinned.png"
                            EnabledUnpinnedImageSource="pack://application:,,,/MyApp;component/customUnpinned.png" />

Unpinned glyph is hidden until mouse hover:

          <rh:PushpinButton Width="Auto" 
                            IsHiddenUnpinnedGlyph="True"
                            CheckedBackground="{Binding Background, RelativeSource={RelativeSource Self}}">
              <TextBlock Text="Hover over"/>
          </rh:PushpinButton>

Transparent:

          <rh:PushpinButton Cursor="Hand" 
                            Background="Transparent" BorderBrush="Transparent"
                            MouseOverBackground="Transparent" 
                            MouseOverBorder="Transparent"
                            PressedBackground="Transparent" 
                            PressedBorder="Transparent"
                            CheckedBackground="Transparent" 
                            CheckedBorder="Transparent" />

A custom styled glyph pic:

          <rh:PushpinButton EnabledPinnedImageSource="{Binding EnabledUnpinnedImageSource, RelativeSource={RelativeSource Self}}"
                            DisabledPinnedImageSource="{Binding DisabledUnpinnedImageSource, RelativeSource={RelativeSource Self}}"
                            DisabledUnpinnedImageSource="{Binding DisabledUnpinnedImageSource, RelativeSource={RelativeSource Self}}">
              <rh:PushpinButton.ImageStyle>
                  <Style TargetType="Image">
                      <Setter Property="RenderTransformOrigin" Value=".5,.5" />
                      <Setter Property="RenderTransform" >
                          <Setter.Value>
                              <RotateTransform Angle="-45" />
                          </Setter.Value>
                      </Setter>
                  </Style>
              </rh:PushpinButton.ImageStyle>
          </rh:PushpinButton>

Release Notes

Updated copyright notice

Dependencies

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 161 3/22/2020
1.0.0 492 3/10/2017