Fix SearchBar focus when it is disabled
This is a workaround for
MODIFY
WalletWasabi.Fluent/Behaviors/SearchBarBehavior.cs
WalletWasabi.Fluent/Behaviors/SearchBarBehavior.cs
@@ -99,6 +99,11 @@ public class SearchBarBehavior : AttachedToVisualTreeBehavior<Control>
private void SearchBoxOnGotFocus()
{
+ if (AssociatedObject is { IsEffectivelyEnabled: false })
+ {
+ return;
+ }
+
ShowFlyout();
}

MODIFY
WalletWasabi.Fluent/Views/Shell/MainView.axaml
WalletWasabi.Fluent/Views/Shell/MainView.axaml
d:DesignWidth="1000" d:DesignHeight="1000"
x:CompileBindings="True">
- <DockPanel>
+ <DockPanel IsEnabled="{Binding IsMainContentEnabled}">
<shell:TitleBarView DockPanel.Dock="Top" />
<DockPanel>
<navbar:NavBar DockPanel.Dock="Left" DataContext="{Binding NavBar}" />

MODIFY
WalletWasabi.Fluent/Views/Shell/ShellView.axaml
WalletWasabi.Fluent/Views/Shell/ShellView.axaml
x:Class="WalletWasabi.Fluent.Views.Shell.ShellView">
<Panel>
<shell:BackgroundView />
- <shell:MainView x:CompileBindings="False" IsHitTestVisible="{Binding $parent.DataContext.IsMainContentEnabled, FallbackValue=True}" />
+ <shell:MainView />
<shell:DialogsView />
</Panel>
</UserControl>

MODIFY
WalletWasabi.Fluent/Views/Shell/TitleBarView.axaml
WalletWasabi.Fluent/Views/Shell/TitleBarView.axaml
<DataTemplate x:Key="SearchBar">
<searchBar:SearchBar DataContext="{Binding #UserControl.DataContext.SearchBar}" VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
- Margin="5"
- IsHitTestVisible="{Binding $parent.DataContext.IsMainContentEnabled, FallbackValue=True}" />
+ Margin="5" />
</DataTemplate>
<DataTemplate x:Key="WindowsAndLinuxLayout">

Fix SearchBar focus when it is disabled

This is a workaround for https://github.com/AvaloniaUI/Avalonia/issues/7294