XamlBehaviorsWpf

Home for WPF XAML Behaviors on GitHub.

MIT License

Stars
840
Committers
20

Bot releases are hidden (Show)

XamlBehaviorsWpf - Behaviors 1.1.135

Published by jstedfast about 1 month ago

What's Changed

This release fixes an issue with Keytriggers not firing when the ALT modifier is used:

Full Changelog: https://github.com/microsoft/XamlBehaviorsWpf/compare/v1.1.122...v1.1.135

XamlBehaviorsWpf - Behaviors 1.1.122 Latest Release

Published by jstedfast 5 months ago

What's Changed

This release fixes an issue in the XAMLBehaviorsSample.InvokeCommandControl Binding:

Full Changelog: https://github.com/microsoft/XamlBehaviorsWpf/compare/v1.1.77...v1.1.122

XamlBehaviorsWpf - Behaviors 1.1.77

Published by mgoertz-msft 12 months ago

What's Changed

This release avoids a reference to Microsoft.Xaml.Behaviors.DesignTools getting added in legacy-style .NET Framework projects:

Full Changelog: https://github.com/microsoft/XamlBehaviorsWpf/compare/v1.1.75...v1.1.77

XamlBehaviorsWpf - Behaviors 1.1.75

Published by mgoertz-msft 12 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/microsoft/XamlBehaviorsWpf/compare/v1.1.39...v1.1.75

XamlBehaviorsWpf - Behaviors 1.1.39

Published by mgoertz-msft over 2 years ago

What's Changed

  • Updated symbols to be non-portable pdbs to enable symbol resolution with symchk.

Full Changelog: https://github.com/microsoft/XamlBehaviorsWpf/compare/v1.1.37...v1.1.39

XamlBehaviorsWpf - Behaviors 1.1.37

Published by mgoertz-msft over 2 years ago

What's Changed

  • Package includes correctly Authenticode signed assemblies.

Full Changelog: https://github.com/microsoft/XamlBehaviorsWpf/compare/v1.1.31...v1.1.37

XamlBehaviorsWpf - Behaviors 1.1.31

Published by mgoertz-msft over 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/microsoft/XamlBehaviorsWpf/compare/v1.1.19...v1.1.31

XamlBehaviorsWpf - Behaviors 1.1.19

Published by DVaughan almost 5 years ago

Change Log

  • #11 DataTrigger - Evaluate the binding's initial value like WPF

Additional Info

  • .Design assemblies are de-referenced during NuGet package installation.
  • This release aligns with the 1.1.19 NuGet release
XamlBehaviorsWpf - Behaviors 1.1.3

Published by brianlagunas almost 5 years ago

Change Log

  • #8: LaunchUriOrFileAction fails in .NET Core 3
  • #12: InvokeCommandAction - add additional properties for more MVVM scenarios
  • #13: .NET Core 3 Support
  • #29: Suggest to change XmlnsPrefix casing to lowercase. (Change XamlPrefix to "b")

Additional Info

InvokeCommandAction - add additional properties for more MVVM scenarios

Properties Added:

  • EventArgsConverter: Instance of IValueConverter that converts the EventArgs into a more MVVM friendly value
  • EventArgsConverterParameter: the parameter that will be sent as the parameter argument to IValueConverter.Convert method
  • EventArgsParameterPath: parameter path to extract a property from the EventArgs that will be passed to ICommand
  • PassEventArgsToCommand: forces the EventArgs to be passed to the ICommand if the other properties are null

EventArgsConverter

Using the EventArgsConverter to retrieve the ItemTappedEventArgs.Item property.

public class ItemTappedEventArgsConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var itemTappedEventArgs = value as ItemTappedEventArgs;
            if (itemTappedEventArgs == null)
            {
                throw new ArgumentException("Expected value to be of type ItemTappedEventArgs", nameof(value));
            }
            return itemTappedEventArgs.Item;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

In XAML, add a reference to the converter and the converter resource need to be defined

<b:InvokeCommandAction Command="{Binding ItemTappedCommand}"
                        EventArgsConverter="{StaticResource itemTappedEventArgsConverter}" />

EventArgsParameterPath

Sample EventArgs

public class ItemTappedEventArgs : EventArgs
{
    public object Item { get; }
    public object Group { get; }
}

Setting EventArgsParameterPath to Item will extract the property value and pass it to the ICommand

<b:InvokeCommandAction Command="{Binding ItemTappedCommand}"
                                         EventArgsParameterPath="Item" />

Nested properties are also supported:

<b:InvokeCommandAction Command="{Binding ItemTappedCommand}"
                                         EventArgsParameterPath="Item.SubItem.SubProperty" />
XamlBehaviorsWpf - Behaviors 1.0.1

Published by brianlagunas almost 6 years ago

Initial release of the WPF Behaviors