RxUi | pure functional concept of talking to Android View layer | Reactive Programming library
kandi X-RAY | RxUi Summary
kandi X-RAY | RxUi Summary
Minimal implementation of the concept of talking to Android View layer in a Reactive way described here.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Initializes the main view
- Binds the main view to the main view
- Bind a function to a UI function
- Enable sign in button
- Wraps an action on the main thread
- Destroy the disposable object
- The login text of the login button
- List of password changes
- Artist click in button
- Disable sign in button
- Display a failure message
- Display a toast in success button
RxUi Key Features
RxUi Examples and Code Snippets
Community Discussions
Trending Discussions on RxUi
QUESTION
I have entry fields in a Xamarin Forms page that I want to trigger a ReactiveUI command when the user is finished entering text into them. I am using ReactiveUI.Events.XamForms and am trying to trigger a command based off of the Unfocused event, but I am not sure how to set up the command to get that to work.
Here is my XAML:
...ANSWER
Answered 2021-Jun-08 at 20:44In comment above, OP says that this works if change:
QUESTION
I'm trying to learn ReactiveUI
. Currently I'm playing with ReactiveUI.Validation
.
I'm using a simple TextBox
. Everything is working as expected if the binding doesn't have UpdateSourceTrigger=PropertyChanged
. If i add it, it will hang when i type something in the textbox.
What do I miss?
Here is the MainWindow not working code:
...ANSWER
Answered 2021-Apr-23 at 11:29You have infinite loop, because you use this code:
QUESTION
I have a list of rectangles that I want to display on a canvas. I used Krzysztof Skowronek's answer to this question, but he doesn't use ReactiveUI Binding; I am. But I can't get any of my rectangles to show up on my canvas. Everything compiles with no errors and there are no exceptions being thrown. There's not much to this code because I created a new project just to test this out before adding it to my actual project. Here's what I got.
MainWindowViewModel.cs
...ANSWER
Answered 2020-Jun-21 at 03:43As per my comment above I added a data context to MainWindow.xaml header so I can bind to the collection in my ViewModel:
QUESTION
I've been testing ReactiveUI for a while now (highly recommend it!) but recently came across a performance issue that I'm not sure if it's due to ReactiveUI itself (given that it seems to rely on reflection for some things) OR the Xamarin.Forms App Shell. There's a distinct delay when changing to a Tab whose content has ReactiveUI bindings, this is more noticeable when running on an emulator but can also be experienced on a real device too (tested on Android 6 and Android 9 devices). Is there a strategy to improve App Shell tab performance? The performance issue is only on the tab's first load. Relevant code below (simplified example based on base App Shell visual studio template):
AppShell.Xaml
...ANSWER
Answered 2019-Oct-03 at 11:06Well, I have been giving a lot of my time to the awesome Xamarin Forms Shell and I think that itself is the reason for the performance delay that you are talking about right now.
When you read the Microsoft documents it clearly says:
In a Shell application, each ContentPage that's a child of a ShellContent object is created during application startup. Adding additional ShellContent objects using this approach will result in additional pages being created during application startup, which can lead to a poor startup experience. However, Shell is also capable of creating pages on demand, in response to navigation. For more information, see Efficient page loading.
The good thing is that you can fix this by loading these pages on Demand as you may see here: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/shell/tabs#efficient-page-loading
Basically, This can be accomplished by using the DataTemplate markup extension to convert each ContentPage into a DataTemplate and then setting the result as the ShellContent.ContentTemplate property value.
QUESTION
I am trying to get my head around with ReactiveUI
. I created a new project with the following main packages:
- Xamarin.Forms 4.1.0.618606
- PropertyChanged.Fody 3.0.1
- ReactiveUI 9.19.5
- ReactiveUI.XamForms 9.19.5
The project have a page
with associated viewmodel
. I want to Bind View with the ViewModel using ReactiveUI
. But the binding does not work. The project build and run but does not fire any property changed notification
neither any command
. The app needs to display a list
of company names
. But the list does not display the collection defined in ViewModel
. The app should allows the user the sort the list with CollectionChangeCommand
with every change in search query
.
The View Code :
...ANSWER
Answered 2019-Jul-27 at 14:52In your MainPage.xaml.cs you never seem to create the ViewModel?
You are using INotifyPropertyChanged fody on a ReactiveObject, there is a ReactiveUI fody out there. You should not generate mix the INotifyPropertyChange on ReactiveObject's.
You have a vm
property but that isn't created either.
On ReactiveContentControl
it has a property called ViewModel
which you need to set with something. That can be passed in from another control.
Also in your ViewModel.cs
file you have a this.WhenAny
but don't seem to do anything with the observable that is generated?
Be aware also that a better approach for the sorting might be to use the DynamicData framework which is part of the ReactiveUI family now.
You could do something like
ViewModel.cs:
QUESTION
I am just starting to use ReactiveUI for my Xamarin Android and iOS projects. I noticed that my Android fragment that uses ReactiveUI takes a long time to load initially. For example when calling ReactiveCommand.Create for the very first time in my app, it takes about 250 milliseconds. Similar thing when calling the OneWayBind, WhenAny, BindCommand for the first time. But if I re-instantiate the view and view model again these methods return almost immediately ( < 3 ms).
...ANSWER
Answered 2019-Jul-02 at 05:23At the moment the way RxUI does it's dependent DLL loading is it uses the following class.
What happens is it has a list of hard coded strings, that match DLLs of NuGet packages we have. It will then attempt to load the DLLs listed in the list, and then if found, run IWantsToRegisterStuff
interface contained within the class.
I believe your slowness is happening because of this DLL registration.
The plan is very shortly to replace as part of the work in this task the plan is to make it so you call a Init method in the namespace of your DLL package against the RxApp instance. This work will come in ReactiveUI 11.
QUESTION
I'm relatively new to ReactiveUI and I'm trying to asynchronously execute a database query from a ReactiveCommand. From what I can tell, the problem isn't with executing the async query, but when I try to load the results into a ReactiveList in my view model. I believe that this is a scheduling issue but I'm not familiar enough with RxUI to come up with the correct approach.
I've tried subscribing to the command in the view model using ObserveOn with both RxApp.TaskPoolScheduler and RxApp.MainThreadScheduler but neither seems to help.
My view model:
...ANSWER
Answered 2019-May-27 at 12:39. First as stated in my comment reactivelist is deprecated.
There is a problem with the way the LoadUsers command is invoked.
One is you can do WhenActivated in your view model. You derive your view model from ISupportsActivation
, your view will call the WhenActivated block inside your view when it's WhenActivated is called. See https://reactiveui.net/docs/handbook/when-activated/#viewmodels for ideas.
Second way is to use
QUESTION
Caveat:
Brand new to ReactiveUI. Trying to go full on RxUI with the intention of never setting a view's DataContext. I believe this can be done!
Scenario:
I have a button and the button has a style and that button's style has a MultiDataTrigger with first condition being IsMouseOver and second condition being a property on my ViewModel of type bool. This then changes the background or foreground of the button. Traditionally, you would just bind that second condition to the ViewModel's property.
Is there a feasible way for this interaction to work without using a DataContext yet still have the same outcome I expect? I can't directly access the condition binding since it doesn't have a name. So there has to be some weird setup to get this to work.
Solution not really a fan of:
I could potentially add a control that isn't visible, give it a name, and use the this.OneWayBind() to bind that property to the "IsEnabled" property of this control. In doing so, my second condition of the button's MultiDataTrigger could then use binding based on ElementName and its path of IsEnabled. This would allow me to NOT use a DataContext but seems way too "hacky" for my taste. There's gotta be another way!
Thanks in advance!
Edit 1 - Attempt 1 based off Glenn Watson's comment to the post
...ANSWER
Answered 2018-Nov-30 at 23:36I would recommend something close to the solution you have:
QUESTION
I'm trying to add RoutedViewHost to my View:
...ANSWER
Answered 2018-Jul-27 at 13:03This one is likely related to the following bug:
https://github.com/reactiveui/ReactiveUI/issues/1696
Is it designer only related?
QUESTION
I'm using the excellent dynamicdata for bridging my data layer to my UI (using RxUI). The dynamic data part boils down to the following typical piece of code. There is a SourceCache of ItemViewModels ("_sourceCache") which gets bound to a ReactiveList of ItemViewModels ("Models") which in turn (in the View) is bound as a ListView.ItemsSource:
...ANSWER
Answered 2018-Apr-30 at 18:33The overload of sort which you are using will force a complete resort for every property change and / or when new items are added or updated. That overload is designed to be used when the comparer changes rather than when an item changes.
The solution is to make use of AutoRefresh
which instructs dd to reevaluate individual items when properties change.
.AutoRefresh(p=>p.LastChange).Sort(comparer)
There is an overload to specify a throttle and a scheduler.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install RxUi
You can use RxUi like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the RxUi component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page