0

I've tried following the documentation for ReactiveUI.Fody.

https://github.com/kswoll/ReactiveUI.Fody

  1. Added the FodyWeavers.xml the generated file to the shared project.
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
  <ReactiveUI />
</Weavers>
  1. Added the [Reactive] attribute to the property in the shared project.
    [Reactive]
    public int MyNumber
    {
       get;
       set;
    }
  1. Added references to the ReactiveUI.Fody 16.3.10 Nuget package to my Android, iOS & Shared project.

The property never updates to a newly set value.

Why doesn't this work?

4
  • 1
    please post the relevant code Commented Nov 16, 2021 at 22:34
  • And add link to the installation instructions you are following. Not sure if its still needed, but does FodyWeavers.xml contain line <ReactiveUI />? Commented Nov 17, 2021 at 0:07
  • Probably deeper than you want/need to go, but might be worth looking at github.com/reactiveui/ReactiveUI/tree/main/integrationtests/… and github.com/reactiveui/ReactiveUI/tree/main/integrationtests/…. Not sure exactly how to run those, but they presumably have been verified against current Xamarin.Forms. Commented Nov 17, 2021 at 0:16
  • Added extra information Commented Nov 17, 2021 at 7:38

2 Answers 2

0

For ReactiveUI.Fody 16.3.10, you need to ensure that The minimum version of Xamarin Android is Android 11.0, with SDK 30 and .Net Standard minimum version is 2.0.

Make sure your AndroidManifest.xml has SDK 30 as the target SDK.

If you want to dynamically refresh data in Xamarin Forms, using the INotifyPropertyChanged interface is also a good choice. For information about its use, you can refer to INotifyPropertyChanged.

Sign up to request clarification or add additional context in comments.

3 Comments

The target SDK is 30 and .NET Standard version is 2.0 but, still getting the same issue
The link I provided is also a very common method, you can try it.
The requirement is to get Fody working. I already know about the INotifyPropertyChanged interface
0

This might be an old question but to answer for anyone looking at this in the future, we need to also inherit from ReactiveObject Base class to make the [Reactive] attribute work

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.