Bread.Mvc.Avalonia 1.4.1.1

dotnet add package Bread.Mvc.Avalonia --version 1.4.1.1
NuGet\Install-Package Bread.Mvc.Avalonia -Version 1.4.1.1
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.
<PackageReference Include="Bread.Mvc.Avalonia" Version="1.4.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Bread.Mvc.Avalonia --version 1.4.1.1
#r "nuget: Bread.Mvc.Avalonia, 1.4.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Bread.Mvc.Avalonia as a Cake Addin
#addin nuget:?package=Bread.Mvc.Avalonia&version=1.4.1.1

// Install Bread.Mvc.Avalonia as a Cake Tool
#tool nuget:?package=Bread.Mvc.Avalonia&version=1.4.1.1

Bread.Mvc.Avalonia

NuGet Status

Bread.Mvc.Avalonia 包含一些非常有用的扩展。

IUIDispatcher 接口 :UI线程注入

Bread.Mvc.Avalonia.MainThreadDispatcher 实现了 IUIDispatcher 接口。 因为当属性被外部线程修改时,Watch 机制需要使用这个接口检测当前线程是否在主线程中,并将变更 Invoke 给UI线程,所以您必须在Avalonia应用中注册这个服务。

 builder.AddSingleton<IUIDispatcher, Bread.Mvc.Avalonia.MainThreadDispatcher>();

Reactive

为了简化 Watch 操作,我们为常见的控件准备了更易用的绑定方法。


public interface IEnumDescriptioner<T> where T : Enum
{
    string GetDescription(T value);
}

public partial class SettingsPanel : UserControl
{
    SpotModel _spot = null!;

    public EngineSettingsPanel()
    {
        InitializeComponent();

        if (Design.IsDesignMode) return;

        _spot = IoC.Get<SpotModel>();

        // combox initted by enum which LanguageHelper implements IEnumDescriptioner
        uiComboxLanguage.InitBy(new LanguageHelper(), Language.Chinese, 
            Language.English, Language.Japanese, Language.Japanese); 

        uiComboxLanguage.BindTo(_spot, m => m.Language); // ComboBox
       
        uiNUDAutoSave.BindTo(_app, x => x.AutoSave); // NumericUpDown
        uiTbRegCode.BindTo(_app, x => x.RegCode); // TextBox
        uiTbFilePath.BindTo(_app, x => x.FilePath); // TextBlock

        uiSlider.BindTo(_app, x => x.Progress); // Slider

        uiSwitchAutoSpot.BindTo(_spot, m => m.IsAutoSpot); // SwitchButton
        uiTbtnChannel.BindTo(_app, x => x.IsLeftChannel); // ToggleButton

        uiCheckSexual.BindTo(_app, x => x.IsMale); // CheckBox
    }
}

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.4.1.1 78 4/9/2024
1.4.1 85 2/20/2024
1.4.0 104 1/23/2024
1.3.9 182 11/20/2023
1.3.8 116 10/26/2023
1.3.7 113 10/10/2023
1.3.6 106 8/31/2023
1.3.5 115 8/17/2023
1.3.4.1 116 8/12/2023
1.3.4 136 8/7/2023
1.3.3 137 7/16/2023
1.3.2 136 7/5/2023
1.3.1 82 6/27/2023
1.3.0 85 6/3/2023
1.2.0 121 4/30/2023
1.1.0 156 4/17/2023
1.0.6 148 4/13/2023
1.0.5 136 4/11/2023