Skip to content

Commit

Permalink
Merge pull request #524 from IvanDmitriev1/AutoSuggestBox-refactoring
Browse files Browse the repository at this point in the history
`AutoSuggestBox` refactoring
  • Loading branch information
pomianowski authored Feb 8, 2023
2 parents a99b6c8 + 3f17f96 commit 0d70824
Show file tree
Hide file tree
Showing 17 changed files with 718 additions and 605 deletions.
11 changes: 8 additions & 3 deletions src/Wpf.Ui.Gallery/Views/Pages/Text/AutoSuggestBoxPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Wpf.Ui.Gallery.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Wpf.Ui.Gallery.Views.Pages.Text"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:text="clr-namespace:Wpf.Ui.Gallery.ViewModels.Pages.Text"
xmlns:text1="clr-namespace:Wpf.Ui.Gallery.Views.Pages.Text"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Title="AutoSuggestBoxPage"
d:DataContext="{d:DesignInstance local:AutoSuggestBoxPage,
d:DataContext="{d:DesignInstance text1:AutoSuggestBoxPage,
IsDesignTimeCreatable=False}"
d:DesignHeight="450"
d:DesignWidth="800"
Expand All @@ -27,6 +28,7 @@
x:Name="PageScrollViewer"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">

<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
Expand All @@ -38,17 +40,20 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<controls:GalleryControlPresenter
Grid.Row="0"
Margin="0"
CodeText="&lt;ui:AutoSuggestBox PlaceholderText=&quot;Search...&quot; /&gt;"
HeaderText="WPF UI AutoSuggestBox.">
<controls:GalleryControlPresenter.Content>
<ui:AutoSuggestBox ItemsSource="{Binding ViewModel.AutoSuggestBoxSuggestions, Mode=OneWay}" PlaceholderText="Search..." />
<ui:AutoSuggestBox OriginalItemsSource="{Binding ViewModel.AutoSuggestBoxSuggestions, Mode=OneWay}" PlaceholderText="Search..." />
</controls:GalleryControlPresenter.Content>
</controls:GalleryControlPresenter>
</Grid>
</Grid>


</ui:DynamicScrollViewer>
<controls:ControlDocumentationSummary CsharpUrl="{StaticResource PageCsharpUrl}" XamlUrl="{StaticResource PageXamlUrl}" />
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.


using Wpf.Ui.Controls.Navigation;
using Wpf.Ui.Gallery.ViewModels.Pages.Text;

Expand Down
11 changes: 9 additions & 2 deletions src/Wpf.Ui.Gallery/Views/Windows/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
WindowCornerPreference="Default"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">

<ui:FluentWindow.InputBindings>
<KeyBinding
Key="F"
Command="{Binding ElementName=AutoSuggestBox, Path=FocusCommand}"
Modifiers="Control" />
</ui:FluentWindow.InputBindings>

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
Expand All @@ -40,9 +48,8 @@
</ui:NavigationView.Header>
<ui:NavigationView.AutoSuggestBox>
<ui:AutoSuggestBox
x:Name="AutoSuggestBox"
Margin="8,8,8,16"
IconPlacement="Right"
PlaceholderEnabled="True"
PlaceholderText="Search" />
</ui:NavigationView.AutoSuggestBox>
<ui:NavigationView.ContentOverlay>
Expand Down
Loading

0 comments on commit 0d70824

Please sign in to comment.