Add new behavior
ADD
.gitmodules
+[submodule "Zafiro.Avalonia"]
+ path = Zafiro.Avalonia
+ url = https://github.com/SuperJMN-Zafiro/Zafiro.Avalonia.git

MODIFY
WalletWasabi.Fluent.Desktop/packages.lock.json
WalletWasabi.Fluent.Desktop/packages.lock.json
},
"Avalonia.Xaml.Interactivity": {
"type": "Transitive",
- "resolved": "0.10.13.1",
- "contentHash": "jCgTyl3sVMIBZwMEHp7PbY3SMGUQfYWVYTPj010HxvkXo9Zrisxm6iPzDlmd57NfEPgMiW0s/zt6yun4IVnVQQ==",
+ "resolved": "0.10.14",
+ "contentHash": "/AtmTGM+QAjY+8RCkeAbRP5QcEfoWKSDsJYNGnoikRR0xRXlbONvkzhnR0ukxjWkf0NCUh6Sn2dy/HkqWP4y7Q==",
"dependencies": {
- "Avalonia": "0.10.13"
+ "Avalonia": "0.10.14"
}
},
"DynamicData": {
"System.Drawing.Common": "6.0.0",
"System.Reactive": "5.0.0",
"System.Runtime": "4.3.1",
- "WalletWasabi": "1.0.0"
+ "WalletWasabi": "1.0.0",
+ "Zafiro.Avalonia": "1.0.0"
+ }
+ },
+ "zafiro.avalonia": {
+ "type": "Project",
+ "dependencies": {
+ "Avalonia": "0.10.15",
+ "Avalonia.Xaml.Interactivity": "0.10.14"
}
}
},

MODIFY
WalletWasabi.Fluent/ViewModels/SearchBar/SearchBarViewModel.cs
WalletWasabi.Fluent/ViewModels/SearchBar/SearchBarViewModel.cs
@@ -15,6 +15,7 @@ public partial class SearchBarViewModel : ReactiveObject
private readonly ReadOnlyObservableCollection<SearchItemGroup> _groups;
[AutoNotify] private bool _isSearchListVisible;
[AutoNotify] private string _searchText = "";
+ private readonly ObservableAsPropertyHelper<bool> _hasResults;
public SearchBarViewModel(IObservable<IChangeSet<ISearchItem, ComposedKey>> itemsObservable)
{
@@ -37,12 +38,14 @@ public partial class SearchBarViewModel : ReactiveObject
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe();
- Any = filteredItems
+ _hasResults = filteredItems
.Count()
.Select(i => i > 0)
- .ObserveOn(RxApp.MainThreadScheduler);
+ .ToProperty(this, x => x.HasResults);
}
+ public bool HasResults => _hasResults.Value;
+
public IObservable<bool> Any { get; }
public ReadOnlyObservableCollection<SearchItemGroup> Groups => _groups;

MODIFY
WalletWasabi.Fluent/Views/SearchBar/SearchBar.axaml
WalletWasabi.Fluent/Views/SearchBar/SearchBar.axaml
xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
xmlns:searchBar="clr-namespace:WalletWasabi.Fluent.ViewModels.SearchBar"
xmlns:behaviors="clr-namespace:WalletWasabi.Fluent.Behaviors"
+ xmlns:avalonia="clr-namespace:Zafiro.Avalonia;assembly=Zafiro.Avalonia"
x:CompileBindings="True"
x:DataType="searchBar:SearchBarViewModel"
x:Class="WalletWasabi.Fluent.Views.SearchBar.SearchBar">
<PathIcon Name="RightIcon" Data="{DynamicResource search_regular}" />
</TextBox.InnerRightContent>
- </TextBox>
-
<FlyoutBase.AttachedFlyout>
<Flyout Placement="Bottom" ShowMode="Transient">
<s:SearchBarDropdown x:Name="SearchBarDropdown" Width="400" />
</FlyoutBase.AttachedFlyout>
<i:Interaction.Behaviors>
- <behaviors:SearchBarBehavior SearchBox="SearchBox" SearchPanel="SearchBarDropdown"
- IsSearchPanelOpen="{Binding IsSearchListVisible, Mode=TwoWay}" />
+ <avalonia:ShowAttachedFlyoutWhenFocusedBehavior />
</i:Interaction.Behaviors>
+ </TextBox>
+
</UserControl>

MODIFY
WalletWasabi.Fluent/Views/SearchBar/SearchBarDropdown.axaml
WalletWasabi.Fluent/Views/SearchBar/SearchBarDropdown.axaml
</UserControl.DataTemplates>
<Panel VerticalAlignment="Center">
- <TextBlock IsVisible="{Binding !Any^, FallbackValue=False}" Margin="10">No results</TextBlock>
- <ItemsControl IsVisible="{Binding Any^}" Items="{Binding Groups}">
+ <TextBlock IsVisible="{Binding !HasResults, FallbackValue=False}" Margin="10">No results</TextBlock>
+ <ItemsControl IsVisible="{Binding HasResults}" Items="{Binding Groups}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type sb:SearchItemGroup}">
<DockPanel Margin="0 0 0 10">

MODIFY
WalletWasabi.Fluent/WalletWasabi.Fluent.csproj
WalletWasabi.Fluent/WalletWasabi.Fluent.csproj
<ItemGroup>
<ProjectReference Include="..\WalletWasabi\WalletWasabi.csproj" />
<ProjectReference Include="..\WalletWasabi.Fluent.Generators\WalletWasabi.Fluent.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
+ <ProjectReference Include="..\Zafiro.Avalonia\Zafiro.Avalonia\Zafiro.Avalonia.csproj" />
</ItemGroup>
<ItemGroup>

MODIFY
WalletWasabi.Fluent/packages.lock.json
WalletWasabi.Fluent/packages.lock.json
},
"Avalonia.Xaml.Interactivity": {
"type": "Transitive",
- "resolved": "0.10.13.1",
- "contentHash": "jCgTyl3sVMIBZwMEHp7PbY3SMGUQfYWVYTPj010HxvkXo9Zrisxm6iPzDlmd57NfEPgMiW0s/zt6yun4IVnVQQ==",
+ "resolved": "0.10.14",
+ "contentHash": "/AtmTGM+QAjY+8RCkeAbRP5QcEfoWKSDsJYNGnoikRR0xRXlbONvkzhnR0ukxjWkf0NCUh6Sn2dy/HkqWP4y7Q==",
"dependencies": {
- "Avalonia": "0.10.13"
+ "Avalonia": "0.10.14"
}
},
"DynamicData": {
"NBitcoin": "7.0.6",
"NBitcoin.Secp256k1": "3.0.1"
}
+ },
+ "zafiro.avalonia": {
+ "type": "Project",
+ "dependencies": {
+ "Avalonia": "0.10.15",
+ "Avalonia.Xaml.Interactivity": "0.10.14"
+ }
}
},
"net6.0/linux-arm64": {

ADD
Zafiro.Avalonia
+Subproject commit 045e5ff30b14b9b543d65f217d694f246723d0e8

Add new behavior