Skip to content

Commit b49cb40

Browse files
committed
feat(ui): add search box to ui in stack panel
1 parent 716d017 commit b49cb40

File tree

1 file changed

+39
-35
lines changed

1 file changed

+39
-35
lines changed

MainWindow.axaml

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,11 @@
4444
<RowDefinition Height="*" />
4545
</Grid.RowDefinitions>
4646
<Grid.ColumnDefinitions>
47-
<ColumnDefinition Width="225" />
4847
<ColumnDefinition Width="*" />
4948
</Grid.ColumnDefinitions>
5049

5150
<Grid
5251
Grid.Row="0"
53-
Grid.Column="0"
54-
Grid.ColumnSpan="2"
5552
Margin="8">
5653
<Grid.ColumnDefinitions>
5754
<ColumnDefinition Width="75" />
@@ -63,39 +60,46 @@
6360
<Button Grid.Column="2" HorizontalAlignment="Right" Command="{Binding OpenFolderPicker}" Content="Browse" />
6461
</Grid>
6562

66-
<ListBox
67-
Grid.Row="1"
68-
Grid.Column="0"
69-
ItemsSource="{Binding FileMakerClips}"
70-
SelectedItem="{Binding SelectedClip}">
71-
<ListBox.ItemTemplate>
72-
<DataTemplate>
73-
<StackPanel Margin="0,8">
74-
<TextBox Margin="0" Text="{Binding Name, Mode=TwoWay}" />
75-
<ComboBox
76-
DisplayMemberBinding="{Binding DisplayName}"
77-
ItemsSource="{Binding Clip.ClipTypes}"
78-
SelectedValue="{Binding ClipType, Mode=TwoWay}"
79-
SelectedValueBinding="{Binding KeyId}" />
80-
<TextBlock MaxLines="1" Text="{Binding ClipType}" />
81-
</StackPanel>
82-
</DataTemplate>
83-
</ListBox.ItemTemplate>
84-
</ListBox>
85-
86-
<AvaloniaEdit:TextEditor
87-
x:Name="avaloniaEditor"
88-
Grid.Row="1"
89-
Grid.Column="1"
90-
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
91-
ShowLineNumbers="True"
92-
SyntaxHighlighting="Xml"
93-
WordWrap="False">
94-
<i:Interaction.Behaviors>
95-
<behaviors:DocumentTextBindingBehavior Text="{Binding SelectedClip.ClipXml, Mode=TwoWay}" />
96-
</i:Interaction.Behaviors>
97-
</AvaloniaEdit:TextEditor>
63+
<DockPanel Grid.Row="1">
64+
<StackPanel
65+
Width="225"
66+
DockPanel.Dock="Left">
67+
<TextBox Margin="8" Watermark="Search" />
68+
<ListBox
69+
ItemsSource="{Binding FileMakerClips}"
70+
SelectedItem="{Binding SelectedClip}">
71+
<ListBox.Styles>
72+
<Style Selector="ListBoxItem">
73+
<Setter Property="Padding" Value="0"/>
74+
</Style>
75+
</ListBox.Styles>
76+
<ListBox.ItemTemplate>
77+
<DataTemplate>
78+
<StackPanel Margin="8">
79+
<TextBox Text="{Binding Name, Mode=TwoWay}" />
80+
<ComboBox
81+
DisplayMemberBinding="{Binding DisplayName}"
82+
ItemsSource="{Binding Clip.ClipTypes}"
83+
SelectedValue="{Binding ClipType, Mode=TwoWay}"
84+
SelectedValueBinding="{Binding KeyId}" />
85+
<TextBlock MaxLines="1" Text="{Binding ClipType}" />
86+
</StackPanel>
87+
</DataTemplate>
88+
</ListBox.ItemTemplate>
89+
</ListBox>
90+
</StackPanel>
9891

92+
<AvaloniaEdit:TextEditor
93+
x:Name="avaloniaEditor"
94+
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
95+
ShowLineNumbers="True"
96+
SyntaxHighlighting="Xml"
97+
WordWrap="False">
98+
<i:Interaction.Behaviors>
99+
<behaviors:DocumentTextBindingBehavior Text="{Binding SelectedClip.ClipXml, Mode=TwoWay}" />
100+
</i:Interaction.Behaviors>
101+
</AvaloniaEdit:TextEditor>
102+
</DockPanel>
99103
</Grid>
100104
</DockPanel>
101105

0 commit comments

Comments
 (0)