-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request for ReactiveProperty.R3 #487
Comments
Read-only
|
ObservableCollection<TElement>.ObserveElementProperty<TElement, TPropert>() method!!
|
@Funkest Thank you for your feature request. |
@hsytkm I added it to list to implement for ReactiveProperty.R3! |
@runceel Tx! |
@Funkest neuecc (R3 author) have added |
It checked working on xaml in WPF. However, it's sufficient to convert all R3.ReadOnlyReactiveProperty to IBindableReactiveProperty in the ViewModel. Since I don't directly make public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
DataContext = new ViewModel(new SomeDomainModel());
}
public class ViewModel
{
public IReadOnlyBindableReactiveProperty WordsCount { get; }
public ReactiveCommand<object> AddRandomWord { get; } = new();
public ViewModel(ISomeDomainModel someDomainModel)
{
WordsCount = someDomainModel.WordsCount.ToReadOnlyBindableReactiveProperty();
AddRandomWord.Subscribe(_ => someDomainModel.AddWord($"{Random.Shared.Next()}"));
}
}
public class SomeDomainModel : ISomeDomainModel
{
readonly List<string> words = [];
readonly ReactiveProperty<int> wordsCount = new();
public ReadOnlyReactiveProperty<int> WordsCount => wordsCount.ToReadOnlyReactiveProperty();
public void AddWord(string word)
{
words.Add(word);
wordsCount.Value++;
}
}
public interface ISomeDomainModel
{
ReadOnlyReactiveProperty<int> WordsCount { get; }
void AddWord(string word);
}
} |
@runceel fixed a 11th line, sorry. (old shows |
すばらしいプロダクトをご提供いただきありがとうございます! ObservableCollectionsの内容になりますが、IFilteredReadOnlyObservableCollectionが欲しいです。 上記とは関係ない質問ですが、完了したタスクのReactiveCommand.ObserveHasErrors(BindableReactiveProperty.のタイポ?)のように、別ライブラリのクラスにプロパティを追加するのはどうやって実現しているのでしょうか。 Here is a translation from ChatGPT Thank you for providing such an excellent product! I would like to have an This is an unrelated question, but how do you add properties to classes from another library, like |
Ah, the fact that ObservableCollections can no longer be filtered in v2.2.0 is not desirable. |
@neuecc I’m not sure if this is the right place to post this, but I wanted to document what I found.
To retrieve type information of the bound list: private void Button_Click(object sender, RoutedEventArgs e)
{
var dg = (FindName("DG") as DataGrid);
var itemsSource = dg.ItemsSource;
var collectionViewType = CollectionViewSource.GetDefaultView(itemsSource).GetType();
Debug.WriteLine($"{collectionViewType}");
} I haven't been able to debug WPF itself beyond this point, so I’m not entirely sure what’s happening. My guess is that the This is as far as I could figure out. I hope it helps. |
@Funkest The generic one was released on R3 v1.2.3. |
ObservableCollections v3.0.0 reflects filtered collection. |
I have just released a library called R3Utility. |
|
WPFのEventToXXX シリーズ |
Please let us know which classes and methods are blockers when migrating from ReactiveProperty to R3.
For Japanese: It’s okay to write in Japanese.(日本語で書いても大丈夫です。)
Candidate features
The text was updated successfully, but these errors were encountered: