All Projects → notanaverageman → Bindables

notanaverageman / Bindables

Licence: mit
Bindables converts your auto properties into Wpf dependency or attached properties.

Labels

Projects that are alternatives of or similar to Bindables

Csgo Demos Manager
Stars: ✭ 782 (+2269.7%)
Mutual labels:  wpf
Wpfnewprojectsystemsample
Sample WPF application using the new csproj format (.NET Core project system https://github.com/dotnet/project-system/ ). Targering .NET Framework 4.6.2 or higher.
Stars: ✭ 25 (-24.24%)
Mutual labels:  wpf
Adonis Ui
Lightweight UI toolkit for WPF applications offering classic but enhanced windows visuals
Stars: ✭ 878 (+2560.61%)
Mutual labels:  wpf
Flaui
UI automation library for .Net
Stars: ✭ 892 (+2603.03%)
Mutual labels:  wpf
Tumblthree
A Tumblr Blog Backup Application
Stars: ✭ 923 (+2696.97%)
Mutual labels:  wpf
Csla
A home for your business logic in any .NET application.
Stars: ✭ 865 (+2521.21%)
Mutual labels:  wpf
Bililiverecorder
B站录播姬 | BiliBili Stream Recorder
Stars: ✭ 746 (+2160.61%)
Mutual labels:  wpf
Wbooru
色图事人类科技发展的关键动力(WPF + MEF)
Stars: ✭ 28 (-15.15%)
Mutual labels:  wpf
Builderhmi.lite
.NET Core WPF UI design as quick and intuitive as WinForms! Did you hear that MICROSOFT??
Stars: ✭ 25 (-24.24%)
Mutual labels:  wpf
Formswpflive
Live XAML development for Xamarin Forms Apps using WPF Backend.
Stars: ✭ 14 (-57.58%)
Mutual labels:  wpf
Data Collection Dotnet
Data collection application built using the .NET Runtime SDK.
Stars: ✭ 17 (-48.48%)
Mutual labels:  wpf
Visualstudiorevittemplate
Visual Studio project template for Revit add-in development. (using WPF and MVVM)
Stars: ✭ 22 (-33.33%)
Mutual labels:  wpf
Imposter.fiddler
Fiddler Extension Version of Imposter
Stars: ✭ 11 (-66.67%)
Mutual labels:  wpf
Twittervideouploader
Upload Short vido to Twitter
Stars: ✭ 5 (-84.85%)
Mutual labels:  wpf
Teds Terminal
A modern terminal emulator with high DPI support, mouse wheel scaling, 32-bit colour and tty compatible.
Stars: ✭ 20 (-39.39%)
Mutual labels:  wpf
Reactiveui
An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming. ReactiveUI allows you to abstract mutable state away from your user interfaces, express the idea around a feature in one readable place and improve the testability of your application.
Stars: ✭ 6,709 (+20230.3%)
Mutual labels:  wpf
Prism Samples Wpf
Samples that demonstrate how to use various Prism features with WPF
Stars: ✭ 937 (+2739.39%)
Mutual labels:  wpf
Adaptivecards
A new way for developers to exchange card content in a common and consistent way.
Stars: ✭ 950 (+2778.79%)
Mutual labels:  wpf
Fluentwpf
Fluent Design System for WPF.
Stars: ✭ 912 (+2663.64%)
Mutual labels:  wpf
Clientserverproject
一个C-S模版,该模版由三部分的程序组成,一个服务端运行的程序,一个客户端运行的程序,还有一个公共的组件,实现了基础的账户管理功能,版本控制,软件升级,公告管理,消息群发,共享文件上传下载,批量文件传送功能。具体的操作方法见演示就行。本项目的一个目标是:提供一个基础的中小型系统的C-S框架,客户端有三种模式,无缝集成访问,winform版本,wpf版本,asp.net mvc版本,方便企业进行中小型系统的二次开发和个人学习。同时网络组件方便的支持读写三菱和西门子PLC的数据,详细见Readme
Stars: ✭ 873 (+2545.45%)
Mutual labels:  wpf

An add-in for Fody to convert regular properties into Dependency or Attached properties.

Bindables Icon

Bindables converts your auto properties into Wpf dependency or attached properties.
Additionally it allows you to set following options:

  • Specify a default value.
  • Specify FrameworkPropertyMetadataOptions.
  • Specify a PropertyChangedCallback method.
  • Register the property as readonly.

AppVeyor NuGet

How To Use

Dependency Property

You can convert regular properties to dependency properties by applying DependencyPropertyAttribute to individual properties or a whole class.

When you apply the attribute on a class, all the available properties will be converted to dependency properties. The properties that will not be converted are:

  • Non-auto properties. (Properties with custom getters and setters.)
  • Readonly properties. (Properties with no setter.)
  • Explicitly excluded properties. (Properties with [ExcludeDependencyProperty] attribute.)

When you apply the attribute on a class, you can further apply it to a property to specify options for that property.

Examples:

[DependencyProperty]
public class YourClass : DependencyObject
{
    public int RegularDependencyProperty { get; set; }

    // Dependency property with FrameworkPropertyMetadataOptions.
    [DependencyProperty(Options = FrameworkPropertyMetadataOptions.BindsTwoWayByDefault)]
    public int WithOptions { get; set; }

    // Dependency property with a default value.
    public string Name { get; set; } = "Default";
    
    // Dependency property with PropertyChangedCallback.
    // This setting expects that a method with signature like below exists in the class.
    // static void NameOfTheMethod(DependencyObject, DependencyPropertyChangedEventArgs)
    [DependencyProperty(OnPropertyChanged = nameof(OnPropertyChanged))]
    public int WithPropertyChangedCallback { get; set; }
    
    private static void OnPropertyChanged(
        DependencyObject dependencyObject,
        DependencyPropertyChangedEventArgs eventArgs)
    {
    }
    
    // Dependency property with CoerceValueCallback.
    // This setting expects that a method with signature like below exists in the class.
    // static object NameOfTheMethod(DependencyObject, object)
    // You have to provide OnPropertyChanged along with OnCoerceValue. Otherwise a compiler error will be generated.
    [DependencyProperty(OnPropertyChanged = nameof(OnPropertyChanged), OnCoerceValue = nameof(OnCoerceValue))]
    public int WithCoerceValueCallback { get; set; }
    
    private static void OnCoerceValue(
        DependencyObject dependencyObject,
        object value)
    {
        return value;
    }
    
    // Readonly dependency property. The visibility modifier of the setter can be anything.
    [DependencyProperty(IsReadOnly = true)]
    public string ReadOnly { get; private set; }
}

Attached Property

The same principles with the dependency properties also apply to the attached property conversions. However, there are a few differences:

  • Use [AttachedProperty] instead of [DependencyProperty] and [ExcludeAttachedProperty] instead of [ExcludeDependencyProperty]
  • Properties must be static in order to be converted to attached properties.
  • The class containing the attached properties does not have to inherit from DependencyObject.
  • There should be a getter or setter method stub to make the xaml compiler happy. These methods can also be used explicitly when the attached value for an object has to be gotten or set in the code.
public class YourClass
{
    [AttachedProperty]
    public static string Name { get; set; }

    public static string GetName(DependencyObject obj)
    {
        // This method has to have the only line below.
        throw new WillBeImplementedByBindablesException();
    }

    public static void SetName(DependencyObject obj, string value)
    {
        // This method has to be empty.
    }
}

Icon

Link designed by Dmitry Mirolyubov from The Noun Project.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].