Giter Site home page Giter Site logo

reactiveui / reactiveui.samples Goto Github PK

View Code? Open in Web Editor NEW
258.0 258.0 142.0 6.2 MB

This repository contains ReactiveUI samples.

Home Page: https://github.com/reactiveui/ReactiveUI

License: MIT License

C# 91.77% F# 1.21% HTML 4.51% CSS 2.47% JavaScript 0.04%
dotnet hacktoberfest reactiveui reactiveui-samples reactivex

reactiveui.samples's Introduction

Build Code Coverage #yourfirstpr



What is ReactiveUI?

ReactiveUI is a composable, cross-platform model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming, which is a paradigm that allows you to abstract mutable state away from your user interfaces and express the idea around a feature in one readable place and improve the testability of your application.

🔨 Get Started 🛍 Install Packages 🎞 Watch Videos 🎓 View Samples 🎤 Discuss ReactiveUI

Book

There has been an excellent book written by our Alumni maintainer Kent Boogart.

NuGet Packages

Install the following packages to start building your own ReactiveUI app. Note: some of the platform-specific packages are required. This means your app won't perform as expected until you install the packages properly. See the Installation docs page for more info.

Platform ReactiveUI Package NuGet
.NET Standard ReactiveUI CoreBadge
ReactiveUI.Fody FodyBadge
Unit Testing ReactiveUI.Testing TestBadge
WPF ReactiveUI.WPF WpfBadge
UWP ReactiveUI.Uwp UwpBadge
WinUI ReactiveUI.WinUI WinUiBadge
MAUI ReactiveUI.Maui MauiBadge
Windows Forms ReactiveUI.WinForms WinBadge
Xamarin.Forms ReactiveUI.XamForms XamBadge
Xamarin.Essentials ReactiveUI CoreBadge
AndroidX (Xamarin) ReactiveUI.AndroidX DroXBadge
Xamarin.Android ReactiveUI.AndroidSupport DroBadge
Xamarin.iOS ReactiveUI CoreBadge
Xamarin.Mac ReactiveUI CoreBadge
Tizen ReactiveUI CoreBadge
Blazor ReactiveUI.Blazor BlazBadge
Platform Uno ReactiveUI.Uno UnoBadge
Platform Uno ReactiveUI.Uno.WinUI UnoWinUiBadge
Avalonia Avalonia.ReactiveUI AvaBadge
Any ReactiveUI.Validation ValBadge

Sponsorship

The core team members, ReactiveUI contributors and contributors in the ecosystem do this open-source work in their free time. If you use ReactiveUI, a serious task, and you'd like us to invest more time on it, please donate. This project increases your income/productivity too. It makes development and applications faster and it reduces the required bandwidth.

Become a sponsor.

This is how we use the donations:

  • Allow the core team to work on ReactiveUI
  • Thank contributors if they invested a large amount of time in contributing
  • Support projects in the ecosystem

Support

If you have a question, please see if any discussions in our GitHub issues or Stack Overflow have already answered it.

If you want to discuss something or just need help, here is our Slack room, where there are always individuals looking to help out!

Please do not open GitHub issues for support requests.

Contribute

ReactiveUI is developed under an OSI-approved open source license, making it freely usable and distributable, even for commercial use.

If you want to submit pull requests please first open a GitHub issue to discuss. We are first time PR contributors friendly.

See Contribution Guidelines for further information how to contribute changes.

Core Team


Glenn Watson

Melbourne, Australia


Rodney Littles II

Texas, USA


Artyom Gorchakov

Moscow, Russia


Colt Bauman

South Korea


Chris Pulman

United Kingdom

Alumni Core Team

The following have been core team members in the past.


Geoffrey Huntley

Sydney, Australia


Kent Boogaart

Brisbane, Australia


Olly Levett

London, United Kingdom


Anaïs Betts

San Francisco, USA


Brendan Forster

Melbourne, Australia


Claire Novotny

New York, USA

.NET Foundation

ReactiveUI is part of the .NET Foundation. Other projects that are associated with the foundation include the Microsoft .NET Compiler Platform ("Roslyn") as well as the Microsoft ASP.NET family of projects, Microsoft .NET Core & Xamarin Forms.

reactiveui.samples's People

Contributors

anaisbetts avatar arielbh avatar behroozbc avatar cabauman avatar chrispulman avatar danielkocean avatar denisivan0v avatar dependabot-preview[bot] avatar dependabot[bot] avatar dr1rrb avatar genejo avatar ghuntley avatar glennawatson avatar gordonwatts avatar jeromelaban avatar johnduhart avatar mishfit avatar mrxx99 avatar parthchopra avatar phenomx2 avatar rallets avatar richbryant avatar rlittlesii avatar suvjunmd avatar tamirdresher avatar teadrivendev avatar worldbeater avatar zerhacken avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reactiveui.samples's Issues

Make sure all samples are compiling against latest RxUI

You can in PackageReference's use the * notation in the Version.

Eg

<ProjectReference Include="ReactiveUI" Version="*" />

If you use this notation for any RxUI based dependencies it'll make sure we are on latest.

That way we can trigger sample compiles after any new release of ReactiveUI to make sure the samples still at least compile and pass any unit tests they have.

WinForms - new demo project

I just submitted a PR with the a new WinForms demo project. Let me know if I need to improve something!
PR #518
Ps. the build failed, but because of the Blazor project, I don't think it's related to my PR.

The demo implements:

  • Dependency injection with Splat, views, and services.
  • How to use a main entry-point with Routing and UserControls.
  • How to open a new Form (outside the main routing).
  • Routing between screens/views.
  • Binding data and execute commands between View and ViewModel.
  • Bind to reactive properties (as calculated fields).
  • How to bind data to a ListBox via DataSource.
  • How to deal with UI events (via ReactiveMarbles.ObservableEvents.SourceGenerator).
  • How to use Interactions to show Modal form with or without DialogResult.
  • How to subscribe to UI changes like TextBox and ComboBox with sort info, and refresh the data in the UI.
  • How to use Dynamic Data and deal with Collections. See the note below.
  • Unit testing with custom scheduler and time-based scenarios.
  • etc.

[BUG] Update Xamarin Forms Samples to work with latest Xamarin

Update Xamarin Forms Samples to work with latest Xamarin

Build Errors

Project "/Users/pchopra/Projects/ReactiveUI.Samples/xamarin-forms/MasterDetail/MasterDetail/MasterDetail.csproj" (Build target(s)):

Target WinUICheckTargetPlatformVersion:
    /Users/pchopra/.nuget/packages/xamarin.forms/4.3.0.991250/build/Xamarin.Forms.targets(189,5): warning : Xamarin.Forms recommends TargetPlatformMinVersion >= 10.0.14393.0 (current project is -1)
    /Users/pchopra/.nuget/packages/xamarin.forms/4.3.0.991250/build/Xamarin.Forms.targets(195,5): warning : Xamarin.Forms recommends TargetPlatformVersion >= 10.0.17763.0 (current project is -1)
Done building target "WinUICheckTargetPlatformVersion" in project "MasterDetail.csproj".
Target ResolvePackageAssets:
    /Users/pchopra/Projects/ReactiveUI.Samples/xamarin-forms/MasterDetail/MasterDetail/MasterDetail.csproj : error NU1605: Detected package downgrade: Xamarin.Forms from 4.7.0.1351 to 4.3.0.991250. Reference the package directly from the project to select a different version. 
    /Users/pchopra/Projects/ReactiveUI.Samples/xamarin-forms/MasterDetail/MasterDetail/MasterDetail.csproj : error NU1605:  MasterDetail -> ReactiveUI.XamForms 12.1.5 -> Xamarin.Forms (>= 4.7.0.1351) 
    /Users/pchopra/Projects/ReactiveUI.Samples/xamarin-forms/MasterDetail/MasterDetail/MasterDetail.csproj : error NU1605:  MasterDetail -> Xamarin.Forms (>= 4.3.0)
Done building target "ResolvePackageAssets" in project "MasterDetail.csproj" -- FAILED.

Done building project "MasterDetail.csproj" -- FAILED.

Build FAILED.

/Users/pchopra/.nuget/packages/xamarin.forms/4.3.0.991250/build/Xamarin.Forms.targets(189,5): warning : Xamarin.Forms recommends TargetPlatformMinVersion >= 10.0.14393.0 (current project is -1)
/Users/pchopra/.nuget/packages/xamarin.forms/4.3.0.991250/build/Xamarin.Forms.targets(195,5): warning : Xamarin.Forms recommends TargetPlatformVersion >= 10.0.17763.0 (current project is -1)
/Users/pchopra/Projects/ReactiveUI.Samples/xamarin-forms/MasterDetail/MasterDetail/MasterDetail.csproj : error NU1605: Detected package downgrade: Xamarin.Forms from 4.7.0.1351 to 4.3.0.991250. Reference the package directly from the project to select a different version. 
/Users/pchopra/Projects/ReactiveUI.Samples/xamarin-forms/MasterDetail/MasterDetail/MasterDetail.csproj : error NU1605:  MasterDetail -> ReactiveUI.XamForms 12.1.5 -> Xamarin.Forms (>= 4.7.0.1351) 
/Users/pchopra/Projects/ReactiveUI.Samples/xamarin-forms/MasterDetail/MasterDetail/MasterDetail.csproj : error NU1605:  MasterDetail -> Xamarin.Forms (>= 4.3.0)
    2 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.09

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Cloned the repo and tried to build main branch but fails with the below errors

image

Environment
VS Mac version: 8.8.5 (build 18)
Mono 6.12.0.113
Xamarin.iOS Version: 14.8.0.3
Xamarin.Android Version: 11.1.0.26

Does ReactiveUI have any sample documentation for F# projects?

Is your feature request related to a problem? Please describe.

I was taking a look and maybe I searched too quickly but haven’t found samples with F#. Being an FRP library, I thought F# would go in pair with this, no?

Describe the solution you'd like

Maybe have a dedicated folder for F# sample projects in the repo?

Describe alternatives you've considered

Describe suggestions on how to achieve the feature

Let’s create small and medium size projects for both desktop and mobile showcasing ReactiveUI with F#

Additional context

Add better blazor samples

Having both server side/client side samples is a must for us in the future. If we can add some samples about basic Blazor interactions that would be great.

How Can One React to ViewModel set on View?

The routing sample has an extension baked directly into the view here that determines when it is safe to start subscribing to the command's execution:

public WelcomeView()
{
    InitializeComponent();
    this.WhenNavigatedTo(ViewModel, () => {
    //...
    DataContext = ViewModel;

    return ViewModel.HelloWorld.Subscribe(param =>
        MessageBox.Show("It worked!"));
    });
}

It looks like this "WhenNavigatedTo" extension was indeed merged into ReactiveUI but for IRoutableViewModel instances instead (which I guess makes sense...the view doesn't need to know about navigation per se).

However, the only way I can figure out how to essentially do the same thing as the sample is to use Observable.FromEventPattern on the DataContextChanged event:

public WelcomeView()
{
    InitializeComponent();

    this.WhenAnyValue(x => x.ViewModel).BindTo(this, x => x.DataContext);

    Observable.FromEventPattern<DependencyPropertyChangedEventHandler, DependencyPropertyChangedEventArgs>(
        x => DataContextChanged += x,
        x => DataContextChanged -= x)
        .Subscribe((e) => {
            IWelcomeViewModel vm = e.EventArgs.NewValue as IWelcomeViewModel;

            if (vm != null)
                vm.HelloWorld.Subscribe(param => MessageBox.Show("It worked!!!"));
        });
}

Is there meant to be a more concise way? There's a bit of a disconnect with the sample and the latest version of RxUI. My feable attempts at understanding are here

Testing Samples

What would you think about adding two testing samples that demonstrate how to test view models? One that doesn't use time travel and one that does? Or similar. I ask because it took me a few hours of fumbling around to learn it, and having something I could copy would have been helped me out.

If this isn't the right place to ask this sort of question, let me know where.

feature: More advanced Blazor examples

Not related to any specific problem, just looking for optimal ways to do some stuff.

Describe the solution you'd like

  1. Example that shows how to use https://www.reactiveui.net/docs/handbook/collections/ with @foreach. Maybe a list of text fields, with something done when all data is entered into all of them.
  2. Example that shows how to add child components dynamically and interact with them. Maybe couple of cards as child elements that can be added dynamically with button press and each of them contains a checkbox.
  3. Example that shows how to access url parameters in ViewModels.

Describe alternatives you've considered
N/A

Describe suggestions on how to achieve the feature
Add more examples.

Additional context
N/A

MessageBox.Show from ViewModel?

Hi,
Trying to get my head around using RxUI. In
ReactiveUI.Samples / ReactiveUI.Samples.Commands / RxUI / MainVIewModel.cs
There's a call to MessageBox.Show(...). That seems wrong. Shouldn't that be in the view?

[BUG] Uno Samples Don't Load In Visual Studio

Describe the bug
I can't load the Uno samples in Visual Studio 2019.

Steps To Reproduce

Open the sample solution in Visual Studio 2019 and you will see that the Uno sample projects don't load.

Expected behavior

Projects load

Screenshots

image

Environment

Microsoft Visual Studio Professional 2019
Version 16.6.2
VisualStudio.16.Release/16.6.2+30204.135
Microsoft .NET Framework
Version 4.8.03752

Installed Version: Professional

Visual C++ 2019 00435-20310-92022-AA828
Microsoft Visual C++ 2019

ASP.NET and Web Tools 2019 16.6.948.25768
ASP.NET and Web Tools 2019

ASP.NET Core Razor Language Services 16.1.0.2020603+b3ac44798c16fff5b95dbcfe62dea84aa9a1bd72
Provides languages services for ASP.NET Core Razor.

ASP.NET Web Frameworks and Tools 2019 16.6.948.25768
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.6.948.25768
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 16.6.948.25768
Azure Functions and Web Jobs Tools

C# Tools 3.6.0-4.20251.5+910223b64f108fcf039012e0849befb46ace6e66
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus 1.2.0 ([email protected])
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

IntelliCode Extension 1.0
IntelliCode Visual Studio Extension Detailed Info

JetBrains ReSharper Ultimate 2020.1.3 Build 201.0.20200515.122017
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2020 JetBrains, Inc.

Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.30212.1

Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 2.1.50+g25aae5a24a.R
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers 1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio 16.6.17 (9692114)
Support for debugging Mono processes with Visual Studio.

Node.js Tools 1.5.20317.1 Commit Hash:3e70368beb9630c811076c051f4c9a59b45d7c10
Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager 5.6.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

SQL Server Data Tools 16.0.62006.03190
Microsoft SQL Server Data Tools

Test Adapter for Boost.Test 1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test 1.0
Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools 16.0.20417.2002
TypeScript Tools for Microsoft Visual Studio

UnoPlatformPackage Extension 1.0
UnoPlatformPackage Visual Studio Extension Detailed Info

Visual Basic Tools 3.6.0-4.20251.5+910223b64f108fcf039012e0849befb46ace6e66
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual C++ for Cross Platform Mobile Development (Android) 16.0.30014.67
Visual C++ for Cross Platform Mobile Development (Android)

Visual F# Tools 10.9.1.0 for F# 4.7 16.6.0-beta.20217.4+1c969cac25e2d38d71872efe6c8226029e42bb59
Microsoft Visual F# Tools 10.9.1.0 for F# 4.7

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions (Preview) 1.0
View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for CMake 1.0
Visual Studio Tools for CMake

Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers

VisualStudio.DeviceLog 1.0
Information about my package

VisualStudio.Foo 1.0
Information about my package

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

Xamarin 16.6.000.1061 ([email protected])
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.6.0.318 (remotes/origin/[email protected])
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.6.40 (1f1466f)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 10.3.1.4 (d16-6/3a10de9)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: 165f4b0
Java.Interop: xamarin/[email protected]2cab35c
ProGuard: xamarin/[email protected]905836d
SQLite: xamarin/[email protected]49232bc
Xamarin.Android Tools: xamarin/[email protected]bfb66f3

Xamarin.iOS and Xamarin.Mac SDK 13.18.2.1 (29c4ea7)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

[BUG] ReactiveUI.Samples.Routing101 does not compile

Describe the bug

The project ReactiveUI.Samples.Routing101 can't be compiled because there is an error:

CS0200 Property or indexer 'ILogger.Level' cannot be assigned to -- it is read only ReactiveUI.Samples.Routing101 ..\ReactiveUI.Samples.Routing\ViewModels\AppBootstrapper.cs Line 44

Steps To Reproduce

  1. try to build ReactiveUI.Samples.Routing101

Expected behavior
The project should be able to be build.

Environment

  • OS: Windows
  • Version 10

Additional context
A easy workaround is to delete the affected line.

[BUG] ReactiveUI.Samples.Commands example not showing how to bind command CanExecute property

Describe the bug
When a button is bound to a Command, the enabled/disabled should also be bound to CanExecute.
The example: https://github.com/reactiveui/ReactiveUI.Samples/tree/main/wpf/ReactiveUI.Samples.Commands
Shows a UI like this:
image

Interestingly, MVVM Light and Carliburn.Micro samples both button disabled when textbox is empty.
But ReactiveUI's button is always enabled.

Maybe the original author forgot it?

Steps To Reproduce
Just clone the repo and run ReactiveUI.Samples.Commands sample. Check each's button's enablility.

Expected behavior
When text is empty, disable button.

Screenshots
image

Environment

  • OS: Win10

Request for Generic Host (.NET Core 3) + Prism + WPF sample - Can contribute

Turns out I cannot read and posted the issue here instead in the Prism samples repo. Im sorry for that. Nothing to see here, move along.

Original post

Is your feature request related to a problem? Please describe.

I am missing a sample or some documentation explaining the correct way to handle this. I want to set up a .NET Core WPF application which uses Prism and whose Lifetime / DI / Configuration is controlled (or supported) by a Generic Host.
In my case I am utilizing DryIoC as my ioc container of choice.

Right now WPF does not do a great job of using newer framework features, there are some open issues on GH like dotnet/wpf:499. So even if the WPF integration will not be perfect, some aspects can already be put to good use: IoC, Configuration and Hosted Services for background tasks.

Describe the solution you'd like
Clear guidelines for bootstrapping an application using a Generic Host, sample included.

I am having trouble finding definitive information on instantiating the IoC container myself. There is a hook that seems to be doing that - CreateContainerExtension(). Is this the correct way to go about it? If yes, is its intended use documented and if not - can we improve the documentation?

Describe alternatives you've considered

I managed to get things going with a couple of extra lines, but I'm sure that there are better ways to go about that (eg utilizing the aforementioned CreateContainerExtension method).

Additional dependencies:

  • Microsoft.Extensions.Hosting - this dependency is for the generic host feature.
  • DryIoc.Microsoft.DependencyInjection - package with extension methods for the dryioc adapter, usually used in the context of ASPNET Core.

The App.xaml.cs actually looks alright, services can be registered as usual and resolved via base.Container and via _host.Services since im basically just adding more registrations to the instantiated container.

// App.xaml.cs

protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
    containerRegistry.Register<ServiceA>();
}

protected override Window CreateShell()
{
    _host = new HostBuilder()
        .ConfigureServices(x =>
        {
            x.AddTransient<ServiceB>();
        })
        .UseServiceProviderFactory(new DryIocServiceProviderFactory(Container))
        .Build();

    _host.Start();
    // ServiceA and ServiceB can be resolved here.

    return _host.Services.GetService<MainWindow>();
}

While implementing the DryIoC Service Provider Factory it became obvious that I'm going down the wrong path. As you will see, I am taking the instantiated container and casting it to the known underlying type. Normally you would new up a container in CreateBuilder so this current implementation feels wrong.

// DryIocServiceProviderFactory.cs
internal class DryIocServiceProviderFactory : IServiceProviderFactory<IContainer>
{
    private readonly DryIocContainerExtension _containerProvider;

    public DryIocServiceProviderFactory(IContainerProvider containerProvider)
    {
        // I should not be doing this..
        _containerProvider = containerProvider as DryIocContainerExtension;
    }

    public IContainer CreateBuilder(IServiceCollection services)
    {
        return _containerProvider.Instance.WithDependencyInjectionAdapter(services);
    }

    public IServiceProvider CreateServiceProvider(IContainer containerBuilder)
    {
        return containerBuilder.Resolve<IServiceProvider>();
    }
}

Describe suggestions on how to achieve the feature

So if I am correct, I need to somehow use the CreateContainerExtension() method.
The following does not work, Prism services are missing from the container and cannot be resolved.

protected override IContainerExtension CreateContainerExtension()
{
    return new DryIocContainerExtension(new DryIoc.Container());
}

I thought that these would get registered in the container I return from this method.

Hopefully I did not miss anything obvious in the documentation, I searched but found nothing. I would love to contribute to the project and push such a sample, but before doing that I need a bit of hand holding. Thanks!

[BUG] Sample code from Handbook is not working

Describe the bug

The given sample from Handbook/MessageBus/Ways to avoid using MessageBus is not working. Only the last added item is handled correct (removed from the list).

It worked fine on version 10.5.43 and failed after that (>=11.*).

Steps To Reproduce

using DynamicData;
using DynamicData.Binding;

using ReactiveUI;

using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reactive;
using System.Reactive.Linq;

using Xunit;

namespace ReactiveUITests
{
    /// <summary>
    /// <code>https://www.reactiveui.net/docs/handbook/message-bus/#ways-to-avoid-using-messagebus</code>
    /// </summary>
    public class MessageBusWaysToAvoidUsingMessageBusTest
    {
        public class DocumentViewModel : ReactiveObject
        {
            public ReactiveCommand<Unit, Unit> Close { get; set; }

            public DocumentViewModel()
            {
                // Note that we don't actually *subscribe* to Close here or implement
                // anything in DocumentViewModel, because Closing is a responsibility
                // of the document list.
                Close = ReactiveCommand.Create(() => { });
            }
        }

        public class MainViewModel : ReactiveObject
        {
            public ObservableCollection<DocumentViewModel> OpenDocuments { get; protected set; }

            public MainViewModel()
            {
                OpenDocuments = new ObservableCollection<DocumentViewModel>();

                // Whenever the list of documents change, calculate a new Observable
                // to represent whenever any of the *current* documents have been
                // requested to close, then Switch to that. When we get something
                // to close, remove it from the list.
                OpenDocuments
                    .ToObservableChangeSet()
                    .AutoRefreshOnObservable(document => document.Close)
                    .Select(_ => WhenAnyDocumentClosed())
                    .Switch()
                    .Subscribe(x => OpenDocuments.Remove(x));
            }

            IObservable<DocumentViewModel> WhenAnyDocumentClosed()
            {
                // Select the documents into a list of Observables
                // who return the Document to close when signaled,
                // then flatten them all together.
                return OpenDocuments
                    .Select(x => x.Close.Select(_ => x))
                    .Merge();
            }
        }

        [Fact]
        public void TestWithSingleDocument()
        {
            var main = new MainViewModel();
            var doc = new DocumentViewModel();
            main.OpenDocuments.Add(doc);

            doc.Close.Execute().Subscribe();
            var actual = main.OpenDocuments.Count;

            Assert.Equal(0, actual);
        }

        [Fact]
        public void TestWithFirstFromMultipleDocuments()
        {
            var main = new MainViewModel();
            var doc = new DocumentViewModel();
            main.OpenDocuments.Add(doc);
            main.OpenDocuments.Add(new DocumentViewModel());
            main.OpenDocuments.Add(new DocumentViewModel());
            main.OpenDocuments.Add(new DocumentViewModel());
            main.OpenDocuments.Add(new DocumentViewModel());

            doc.Close.Execute().Subscribe();
            var actual = main.OpenDocuments.Count;

            Assert.Equal(4, actual);
        }

        [Fact]
        public void TestWithCenterFromMultipleDocuments()
        {
            var main = new MainViewModel();
            var doc = new DocumentViewModel();
            main.OpenDocuments.Add(new DocumentViewModel());
            main.OpenDocuments.Add(new DocumentViewModel());
            main.OpenDocuments.Add(doc);
            main.OpenDocuments.Add(new DocumentViewModel());
            main.OpenDocuments.Add(new DocumentViewModel());

            doc.Close.Execute().Subscribe();
            var actual = main.OpenDocuments.Count;

            Assert.Equal(4, actual);
        }

        [Fact]
        public void TestWithLastFromMultipleDocuments()
        {
            var main = new MainViewModel();
            var doc = new DocumentViewModel();
            main.OpenDocuments.Add(new DocumentViewModel());
            main.OpenDocuments.Add(new DocumentViewModel());
            main.OpenDocuments.Add(new DocumentViewModel());
            main.OpenDocuments.Add(new DocumentViewModel());
            main.OpenDocuments.Add(doc);

            doc.Close.Execute().Subscribe();
            var actual = main.OpenDocuments.Count;

            Assert.Equal(4, actual);
        }
    }
}

Environment

  • OS: Windows
  • Version 10.0.19044.1466
  • ReactiveUI Version: 11.* -> 17.1.17

[BUG] demo is not work

Describe the bug
ReactiveUI.Samples-main\winforms\demo2\WinForms.Reactive.Client
this demo is not work,no data
Steps To Reproduce

  1. git clone https://github.com/reactiveui/ReactiveUI.Samples
    2.go to dir ReactiveUI.Samples-main\winforms\demo2\WinForms.Reactive.Client
    3.click WinForms.Reactive.Client.csproj to open
    4.run app

Expected behavior
work well

Screenshots
q

Environment

  • OS: windows 10
  • Device: dell notebook
  • Version: 19041.450
  • Working Version: 19041.450

[BUG] Commands names violates documented convention

Describe the bug
The doc Command Names says:

Don't suffix ReactiveCommand properties' names with Command; instead, name the property using a verb that describes the command's action. For example:

public ReactiveCommand Synchronize { get; private set; }

But the sample code can find violations everywhere, just name a few:

CalculateCommand
https://github.com/reactiveui/ReactiveUI.Samples/blob/main/wpf/ReactiveUI.Samples.Basics/ViewModels/CalculatorViewModel.cs

StartAsyncCommand
https://github.com/reactiveui/ReactiveUI.Samples/blob/main/wpf/ReactiveUI.Samples.Commands/RxUI/MainVIewModel.cs

WinForms example update to .net Core 6 and latest C# functionality

Hi, I was wondering if you are intersted in accepting a PR in the WinForms example that:

  • updates to the latest .net core 6 and C# functionality
  • made the VS Designer available for a generic UserControl, that I think can stop a newbie like me to join RxUi
  • made the "Open github repo" button working (or at least it was not working for me in Windows 10)
    You can check to changes in my fork:
    ([email protected]ef74506)

ReactiveDemo for WPF throws Null exception

  1. Missing reference in project file to System.Xaml

  2. Running application throws System.NullReferenceException when calling PackageSearchResource.SearchAsync()

    Reason: Cannot pass null to SearchAsync() for NuGet.Common.ILogger parameter
    Fix: pass NuGet.Common.NullLogger.Instance instead of null

Update the samples in old folder

Made the samples in the Old/ folder be updated to RxUI latest.

If any have been converted already, delete them, if any of them aren't relevant anymore also remove them.

Get CI to work

Plug this into the CI server.

Need a Azure-Pipelines that compiles all the projects in this folder.

Request for Xamarin.Mac sample

Is your feature request related to a problem? Please describe.

Need some samples/instructions for Xamarin.Mac.

Describe the solution you'd like

Clear steps for create a Xamarin.Mac project and view/viewmodel binding logics.

Describe alternatives you've considered

Umm, may be like Xamarin.Forms for Mac?

Describe suggestions on how to achieve the feature

Just supply the sample code and instructions.

Additional context

I found a wired project for this request, https://developer.xamarin.com/samples/mac/ReactiveUIExample/ , however, I thought it's wrong way to use ReactiveUI in Xamarin.Mac.

feature: Title

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Describe alternatives you've considered

Describe suggestions on how to achieve the feature

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.