-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainWindow.axaml
106 lines (102 loc) · 4.95 KB
/
MainWindow.axaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<Window
x:Class="SharpFM.MainWindow"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:AvaloniaEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:behaviors="clr-namespace:SharpFM.Behaviors;assembly=SharpFM"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:SharpFM.ViewModels"
Icon="/Assets/noun-sharp-teeth-monster-4226695.small.png"
Title="SharpFM"
Width="700"
Height="500"
d:DesignHeight="500"
d:DesignWidth="700"
x:DataType="vm:MainWindowViewModel"
mc:Ignorable="d">
<DockPanel>
<Menu DockPanel.Dock="Top">
<MenuItem Header="_File">
<MenuItem Header="_New">
<MenuItem Command="{Binding NewEmptyItem}" Header="Blank Clip" />
<MenuItem Command="{Binding PasteFileMakerClipData}" Header="From Clipboard (copied from FileMaker)" />
</MenuItem>
<Separator />
<MenuItem Command="{Binding OpenFolderPicker}" Header="Open Folder" />
<Separator />
<MenuItem Header="Save">
<MenuItem Command="{Binding SaveClipsStorage}" Header="Save All To Folder" />
<MenuItem Command="{Binding CopySelectedToClip}" Header="Selected clip to Clipboard (to paste into FileMaker)" />
</MenuItem>
<Separator />
<MenuItem Command="{Binding ExitApplication}" Header="_Exit" />
</MenuItem>
<MenuItem Header="Transform">
<MenuItem Command="{Binding CopyAsClass}" Header="Copy as C# Class" />
</MenuItem>
<MenuItem Header="{Binding Version}" />
</Menu>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid
Grid.Row="0"
Margin="8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="75" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="75"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" HorizontalAlignment="Left" VerticalContentAlignment="Center" Content="Clip path:"></Label>
<TextBox Grid.Column="1" Text="{Binding CurrentPath, Mode=OneWay}" />
<Button Grid.Column="2" HorizontalAlignment="Right" Command="{Binding OpenFolderPicker}" Content="Browse" />
</Grid>
<DockPanel Grid.Row="1">
<StackPanel
Width="225"
DockPanel.Dock="Left">
<TextBox Margin="8" Watermark="Search" Text="{Binding SearchText}" />
<ListBox
ItemsSource="{Binding FilteredClips}"
SelectedItem="{Binding SelectedClip}">
<ListBox.Styles>
<Style Selector="ListBoxItem">
<Setter Property="Padding" Value="0"/>
</Style>
</ListBox.Styles>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="8">
<TextBox Text="{Binding Name, Mode=TwoWay}" />
<ComboBox
DisplayMemberBinding="{Binding DisplayName}"
ItemsSource="{Binding Clip.ClipTypes}"
SelectedValue="{Binding ClipType, Mode=TwoWay}"
SelectedValueBinding="{Binding KeyId}" />
<TextBlock MaxLines="1" Text="{Binding ClipType}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
<AvaloniaEdit:TextEditor
x:Name="avaloniaEditor"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
ShowLineNumbers="True"
SyntaxHighlighting="Xml"
WordWrap="False">
<i:Interaction.Behaviors>
<behaviors:DocumentTextBindingBehavior Text="{Binding SelectedClip.ClipXml, Mode=TwoWay}" />
</i:Interaction.Behaviors>
</AvaloniaEdit:TextEditor>
</DockPanel>
</Grid>
</DockPanel>
</Window>