示例#1
0
        private IEnumerable <IDisposable> Init()
        {
            yield return(ClearButton
                         .Events()
                         .PreviewMouseUp
                         .Subscribe(_ => ClearAll()));

            yield return(this
                         .WhenAnyValue(p => p.FilterText.Text)
                         .Subscribe(Console.WriteLine));

            var filteredEntries =
                LogEntries
                //.Where(this
                //    .WhenAnyValue(p => p.FilterText.Text)
                //    .ObserveOn(this)
                //    .Select(str => fun((LogEntry v) => v.Message.Contains(str)))
                //)
                .CreateObservableCollection(EqualityComparer <LogEntry> .Default);

            yield return(filteredEntries);

            MainPanel.DataContext = filteredEntries;
            yield return(Disposable.Create(() => MainPanel.DataContext = null));
        }