ObservableHelpers 2.0.10

.NET 6.0 .NET Standard 2.0
NuGet\Install-Package ObservableHelpers -Version 2.0.10
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
dotnet add package ObservableHelpers --version 2.0.10
<PackageReference Include="ObservableHelpers" Version="2.0.10" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ObservableHelpers --version 2.0.10
#r "nuget: ObservableHelpers, 2.0.10"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install ObservableHelpers as a Cake Addin
#addin nuget:?package=ObservableHelpers&version=2.0.10

// Install ObservableHelpers as a Cake Tool
#tool nuget:?package=ObservableHelpers&version=2.0.10

Observable Helpers

Observable helpers with source generators and UI-safe property implementations. Can be used for any MVVM software architectural applications.

NuGets

Name Info
ObservableHelpers NuGet

Installation

// Install release version
Install-Package ObservableHelpers

// Install pre-release version
Install-Package ObservableHelpers -pre

Supported frameworks

.NET Standard 2.0 and above - see https://github.com/dotnet/standard/blob/master/docs/versions.md for compatibility matrix

Get Started

All observable events are executed on thread that was used to create the object instance. To use in UI safe updates, create the object instances at the UI thread or manually configure the ISyncObject.SyncOperation to use UI thread.

Usage

ObservableObject Sample

using ObservableHelpers;

namespace YourNamespace
{
    [ObservableObject]
    public partial class Dinosaur
    {
        [ObservableProperty]
        string? name;
        
        [ObservableProperty(Access = Access.PublicWithPrivateSetter)]
        string? family;
        
        [ObservableProperty]
        int height;
    }
}

Will Generate

using ObservableHelpers;

namespace YourNamespace
{
    public partial class Dinosaur
    {
        public string? Name
        {
            get => name;
            set
            {
                if (!EqualityComparer<string?>.Default.Equals(name, value))
                {
                    OnNameChanging(value);
                    OnPropertyChanging(nameof(Name));
                    name = value;
                    OnNameChanged(value);
                    OnPropertyChanged(nameof(Name));
                }
            }
        }
        
        public string? Family
        {
            get => family;
            private set
            {
                if (!EqualityComparer<string?>.Default.Equals(family, value))
                {
                    OnFamilyChanging(value);
                    OnPropertyChanging(nameof(Family));
                    family = value;
                    OnFamilyChanged(value);
                    OnPropertyChanged(nameof(Family));
                }
            }
        }
        
        public int Height
        {
            get => height;
            set
            {
                if (!EqualityComparer<int>.Default.Equals(height, value))
                {
                    OnHeightChanging(value);
                    OnPropertyChanging(nameof(Height));
                    height = value;
                    OnHeightChanged(value);
                    OnPropertyChanged(nameof(Height));
                }
            }
        }
    }
}

UI safe

using ObservableHelpers;

namespace YourNamespace
{
    public class Program
    {
        private Dinosaur dinosaur;

        public void UIThread()
        {
            dinosaur = new Dinosaur(); // Must be created on UI thread to synchronize events

            dinosaur.SynchronizeChangedEvent = true;
        }

        public void BackgroundThread()
        {
            dinosaur.PropertyChanged += (s, e) =>
            {
                // Executes on UI thread if dinosaur.SynchronizeChangedEvent is true (default false)
            }
            dinosaur.SynchronizedPropertyChanged += (s, e) =>
            {
                // Executed on UI thread
            }
            dinosaur.UnsynchronizedPropertyChanged += (s, e) =>
            {
                // Executed on current thread
            }
            dinosaur.Name = "Megalosaurus";
        }
    }
}

Code & Inspiration from the following:

Want To Support This Project?

All I have ever asked is to be active by submitting bugs, features, and sending those pull requests down!.

paypal

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ObservableHelpers:

Package Downloads
RestfulFirebase

Firebase REST API wrapper wired with MVVM observables.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.10 60 9/9/2022
2.0.9 134 9/8/2022
2.0.8 65 9/8/2022
2.0.7 77 9/8/2022
2.0.6 63 9/5/2022
2.0.6-prerelease.14 39 9/5/2022
2.0.6-prerelease.13 38 9/5/2022
2.0.6-prerelease.11 38 9/5/2022
2.0.6-prerelease.10 41 9/5/2022
2.0.6-prerelease.8 37 9/5/2022
2.0.6-prerelease.7 39 9/5/2022
2.0.6-prerelease.6 38 9/5/2022
2.0.6-prerelease.4 39 9/5/2022
2.0.6-prerelease 37 9/5/2022
2.0.5 54 9/4/2022
2.0.3 50 9/4/2022
2.0.1 51 9/4/2022
1.6.2 117 4/23/2022
1.6.1 100 4/22/2022
1.6.0 96 4/22/2022
1.5.5 212 3/7/2022
1.5.4 84 3/7/2022
1.5.3 76 3/7/2022
1.5.2 92 3/5/2022
1.5.1 97 2/23/2022
1.5.0 143 2/22/2022
1.4.8 103 2/21/2022
1.4.7 82 2/19/2022
1.4.6 92 2/19/2022
1.4.5 147 1/9/2022
1.4.4 130 1/9/2022
1.4.3 244 1/4/2022
1.4.2 146 1/2/2022
1.4.1 123 1/1/2022
1.4.0 117 1/1/2022
1.3.6 138 1/1/2022
1.3.5 160 12/25/2021
1.3.4 254 12/13/2021
1.3.3 136 12/6/2021
1.3.2 200 11/16/2021
1.3.1 193 11/16/2021
1.3.0 148 11/14/2021
1.2.7 158 11/10/2021
1.2.6 219 11/8/2021
1.2.5 148 11/3/2021
1.2.4 183 11/2/2021
1.2.3 181 10/26/2021
1.2.2 208 10/25/2021
1.2.1 156 10/21/2021
1.2.0 134 10/21/2021
1.1.12 509 9/1/2021
1.1.11 145 9/1/2021
1.1.10 153 9/1/2021
1.1.9 169 9/1/2021
1.1.8 382 8/26/2021
1.1.7 165 8/26/2021
1.1.6 167 8/26/2021
1.1.5 156 8/26/2021
1.1.4 160 8/26/2021
1.1.3 198 8/25/2021
1.1.2 148 8/25/2021
1.1.1 159 8/25/2021
1.1.0 144 8/25/2021
1.0.92 350 8/18/2021
1.0.91 344 8/9/2021
1.0.90 261 8/4/2021
1.0.89 193 7/19/2021
1.0.88 167 7/19/2021
1.0.87 482 7/3/2021
1.0.86 199 7/2/2021
1.0.85 214 7/1/2021
1.0.84 232 6/30/2021
1.0.83 194 6/28/2021
1.0.82 163 6/28/2021
1.0.81 320 6/27/2021
1.0.80 287 6/27/2021
1.0.79 279 6/27/2021
1.0.78 203 6/16/2021
1.0.77 464 6/16/2021
1.0.76 267 6/15/2021
1.0.75 318 6/15/2021
1.0.74 211 6/15/2021
1.0.73 223 6/15/2021
1.0.72 229 6/15/2021
1.0.71 233 6/15/2021
1.0.70 254 6/15/2021
1.0.69 174 6/15/2021
1.0.68 249 6/15/2021
1.0.67 225 6/14/2021
1.0.66 232 6/14/2021
1.0.65 306 6/14/2021
1.0.64 228 6/13/2021
1.0.63 187 6/13/2021
1.0.62 204 6/13/2021
1.0.61 234 6/13/2021
1.0.60 219 6/13/2021
1.0.59 209 6/13/2021
1.0.58 348 6/13/2021
1.0.57 260 6/12/2021
1.0.56 329 6/12/2021
1.0.55 247 6/12/2021
1.0.54 507 6/10/2021
1.0.53 241 6/10/2021
1.0.52 267 6/10/2021
1.0.51 230 6/10/2021
1.0.49 222 6/10/2021
1.0.48 204 6/9/2021
1.0.47 171 6/9/2021
1.0.46 163 6/9/2021
1.0.45 166 6/9/2021
1.0.44 163 6/9/2021
1.0.43 551 6/8/2021
1.0.42 608 6/6/2021
1.0.41 290 6/6/2021
1.0.40 295 6/6/2021
1.0.39 199 6/6/2021
1.0.38 169 6/6/2021
1.0.37 219 6/6/2021
1.0.36 184 6/6/2021
1.0.35 177 6/6/2021
1.0.34 220 6/6/2021
1.0.33 184 6/6/2021
1.0.32 272 6/5/2021
1.0.31 346 6/5/2021
1.0.30 293 6/5/2021
1.0.29 241 6/5/2021
1.0.28 255 6/4/2021
1.0.27 234 6/4/2021
1.0.26 169 6/4/2021
1.0.25 174 6/4/2021
1.0.24 185 6/4/2021
1.0.23 245 6/3/2021
1.0.22 312 6/3/2021
1.0.21 178 6/3/2021
1.0.20 305 6/2/2021
1.0.19 257 6/2/2021
1.0.18 164 6/2/2021
1.0.17 171 6/2/2021
1.0.16 712 5/20/2021
1.0.15 160 5/19/2021
1.0.14 160 5/18/2021
1.0.13 161 5/18/2021
1.0.12 184 5/18/2021
1.0.11 174 5/17/2021
1.0.10 272 5/13/2021
1.0.9 213 5/13/2021
1.0.8 168 5/13/2021
1.0.7 253 5/11/2021
1.0.6 150 5/11/2021
1.0.5 164 5/11/2021
1.0.4 162 5/11/2021
1.0.3 220 5/8/2021
1.0.2 194 5/8/2021
1.0.1 182 5/8/2021
1.0.0 212 5/8/2021

* Fixed ArgumentNullException wrong parameter names