Skip to content

Commit

Permalink
Fix sorting issue when using filter in inflight data grid (#94)
Browse files Browse the repository at this point in the history
* Set hard coded sorting

* Update rider settings
  • Loading branch information
chkr1011 authored May 20, 2024
1 parent d0bd429 commit 6980cbc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Source/Pages/Inflight/InflightPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Threading.Tasks;
using Avalonia.Threading;
using DynamicData;
using DynamicData.Binding;
using mqttMultimeter.Common;
using mqttMultimeter.Controls;
using mqttMultimeter.Pages.Inflight.Export;
Expand Down Expand Up @@ -39,7 +40,12 @@ public InflightPageViewModel(MqttClientService mqttClientService, InflightPageIt

var filter = this.WhenAnyValue(x => x.FilterText).Throttle(TimeSpan.FromMilliseconds(800)).Select(BuildFilter);

_itemsSource.Connect().Filter(filter).ObserveOn(RxApp.MainThreadScheduler).Bind(out _items).Subscribe();
_itemsSource.Connect()
.Filter(filter)
.Sort(SortExpressionComparer<InflightPageItemViewModel>.Ascending(t => t.Number))
.ObserveOn(RxApp.MainThreadScheduler)
.Bind(out _items)
.Subscribe();
}

public event Action<InflightPageItemViewModel>? RepeatMessageRequested;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Task ProcessPacket(InspectMqttPacketEventArgs eventArgs)
{
return Task.CompletedTask;
}

Dispatcher.UIThread.Invoke(() =>
{
var number = _number++;
Expand Down
1 change: 1 addition & 0 deletions Source/mqttMultimeter.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
&lt;/Entry&gt;&#xD;
&lt;/TypePattern&gt;&#xD;
&lt;/Patterns&gt;</s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/ApplyAutoDetectedRules/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
Expand Down

0 comments on commit 6980cbc

Please sign in to comment.