|
1 | 1 | <Window xmlns="https://github.com/avaloniaui" |
2 | 2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
3 | 3 | xmlns:vm="using:Avalonia.CpuLimiter.ViewModels" |
| 4 | + xmlns:lang="using:Avalonia.CpuLimiter.Lang" |
4 | 5 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
5 | 6 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
6 | | - xmlns:assets="clr-namespace:Avalonia.CpuLimiter.Assets" |
7 | | - mc:Ignorable="d" d:DesignWidth="600" d:DesignHeight="500" |
| 7 | + mc:Ignorable="d" d:DesignWidth="600" d:DesignHeight="400" |
8 | 8 | Width="600" Height="400" |
9 | 9 | x:Class="Avalonia.CpuLimiter.Views.MainWindow" |
10 | 10 | x:DataType="vm:MainWindowViewModel" |
|
36 | 36 | <!-- window menu --> |
37 | 37 | <DockPanel> |
38 | 38 | <Menu DockPanel.Dock="Top"> |
39 | | - <MenuItem Name="FileButton" Header="{x:Static assets:Resources.FileButton}"> |
| 39 | + <MenuItem Name="FileButton" Header="{x:Static lang:Resources.FileButton}"> |
40 | 40 | <MenuItem Header="Open" Command="{Binding ChooseExeFileCommand}" FontSize="13"/> |
41 | 41 | <MenuItem Header="Save" Command="{Binding}" FontSize="13"/> |
42 | 42 | <Separator/> |
43 | 43 | <MenuItem Header="Exit" Click="OnExitButtonClicked" FontSize="13"/> |
44 | 44 | </MenuItem> |
45 | 45 |
|
46 | | - <MenuItem Name="EditButton" Header="{x:Static assets:Resources.EditButton}"> |
| 46 | + <MenuItem Name="EditButton" Header="{x:Static lang:Resources.EditButton}"> |
47 | 47 | <MenuItem Header="Cut" FontSize="13"/> |
48 | 48 | <MenuItem Header="Copy" FontSize="13"/> |
49 | 49 | <MenuItem Header="Paste" FontSize="13"/> |
50 | 50 | </MenuItem> |
51 | 51 |
|
52 | | - <MenuItem Name="SettingButton" Header="{x:Static assets:Resources.SettingButton}"> |
| 52 | + <MenuItem Name="SettingButton" Header="{x:Static lang:Resources.SettingButton}"> |
53 | 53 | <MenuItem Header="View" FontSize="13"/> |
54 | 54 | <MenuItem Header="Config" FontSize="13"/> |
55 | 55 | </MenuItem> |
56 | 56 |
|
57 | | - <MenuItem Name="RunButton" Header="{x:Static assets:Resources.RunButton}"> |
| 57 | + <MenuItem Name="RunButton" Header="{x:Static lang:Resources.RunButton}"> |
58 | 58 | <MenuItem Header="Launch Game" Command="{Binding RunGameCommand}" FontSize="13"/> |
59 | 59 | </MenuItem> |
60 | 60 |
|
61 | | - <MenuItem Name="HelpButton" Header="{x:Static assets:Resources.HelpButton}"> |
| 61 | + <MenuItem Name="HelpButton" Header="{x:Static lang:Resources.HelpButton}"> |
62 | 62 | <MenuItem Header="Docs" FontSize="13" Command="{Binding OpenDocsCommand}" |
63 | 63 | ToolTip.Tip="Click to open docs in browser"/> |
64 | 64 | <Separator/> |
|
77 | 77 | </TextBlock> |
78 | 78 |
|
79 | 79 | <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> |
80 | | - <TextBox Text="{Binding GamePath}" Name="GamePathTextBox" |
81 | | - HorizontalAlignment="Center" |
82 | | - Padding="30 8 30 0" FontSize="16"> |
83 | | - <TextBox.InnerRightContent> |
84 | | - <!-- <Button>Select</Button> --> |
85 | | - |
86 | | - </TextBox.InnerRightContent> |
87 | | - </TextBox> |
| 80 | + <!-- SelectedItem="{Binding HistoryItems[0]}" --> |
| 81 | + <ComboBox Name="HistoryComboBox" HorizontalAlignment="Center" Padding="15 0 15 5" |
| 82 | + FontSize="16" FontWeight="Bold" |
| 83 | + PlaceholderText="Input the Program Path" |
| 84 | + PlaceholderForeground="Yellow" |
| 85 | + ItemsSource="{Binding HistoryItems}" |
| 86 | + ToolTip.Tip="Store no more than five records"> |
| 87 | + |
| 88 | + <ComboBox.ItemTemplate> |
| 89 | + <DataTemplate DataType="vm:HistoryItemViewModel"> |
| 90 | + <Grid ColumnDefinitions="* Auto"> |
| 91 | + <TextBlock Grid.Column="0" Text="{Binding Path}" |
| 92 | + FontSize="16" |
| 93 | + Width="300" |
| 94 | + Height="20"/> |
| 95 | + <Button Grid.Column="1" Padding="10" |
| 96 | + Command="{Binding }" |
| 97 | + CommandParameter="{Binding .}"> |
| 98 | + <PathIcon Data="{StaticResource DeleteRegular}" Padding="0 10" IsVisible="True"/> |
| 99 | + </Button> |
| 100 | + </Grid> |
| 101 | + </DataTemplate> |
| 102 | + </ComboBox.ItemTemplate> |
| 103 | + </ComboBox> |
| 104 | + |
| 105 | + <!-- <TextBox Text="{Binding GamePath}" Name="GamePathTextBox" --> |
| 106 | + <!-- HorizontalAlignment="Center" --> |
| 107 | + <!-- Padding="30 8 30 0" FontSize="16"> --> |
| 108 | + <!-- <TextBox.InnerRightContent> --> |
| 109 | + <!-- ~1~ <Button>Select</Button> @1@ --> |
| 110 | + <!-- --> |
| 111 | + <!-- </TextBox.InnerRightContent> --> |
| 112 | + <!-- </TextBox> --> |
88 | 113 |
|
89 | 114 | <Button Content=" ... " HorizontalAlignment="Center" |
90 | 115 | Background="Beige" Foreground="Black" |
|
107 | 132 |
|
108 | 133 | <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> |
109 | 134 | <TextBlock Name="CPUCoreNumberTextBlock" FontSize="18" FontWeight="Bold" Margin="10 6 10 0" |
110 | | - HorizontalAlignment="Center" Text="{x:Static assets:Resources.CPUCoreNumberTextBlock}"></TextBlock> |
| 135 | + HorizontalAlignment="Center" Text="{x:Static lang:Resources.CPUCoreNumberTextBlock}"></TextBlock> |
111 | 136 | <!-- <TextBlock Text="{Binding #slider.Value}" --> |
112 | 137 | <!-- HorizontalAlignment="Center" FontSize="20" FontWeight="Bold" Padding="0"/> --> |
113 | 138 |
|
|
124 | 149 | FontSize="16" FontWeight="Bold" |
125 | 150 | Margin="10 20" Padding="14" |
126 | 151 | ToolTip.Tip="Run the selected Game" |
127 | | - Content="{x:Static assets:Resources.LaunchGameButton}" |
| 152 | + Content="{x:Static lang:Resources.LaunchGameButton}" |
128 | 153 | HotKey="Enter"> |
129 | 154 | <!-- <PathIcon Data="{StaticResource GamesRegular}"/> --> |
130 | 155 | </Button> |
131 | 156 |
|
132 | | - <ComboBox HorizontalAlignment="Center" Padding="15" |
133 | | - FontSize="16" FontWeight="Bold" |
134 | | - x:Name="HistoryBox" |
135 | | - ToolTip.Tip="Store no more than five records"> |
136 | | - <ComboBox.ItemTemplate> |
137 | | - <DataTemplate> |
138 | | - <Grid ColumnDefinitions="* Auto"> |
139 | | - <TextBlock Grid.Column="0" Text="Hello" |
140 | | - FontSize="18" |
141 | | - FontFamily="{Binding}" |
142 | | - Width="200" |
143 | | - Height="20" |
144 | | - /> |
145 | | - <Button Grid.Column="1" Padding="10">X</Button> |
146 | | - </Grid> |
147 | | - </DataTemplate> |
148 | | - </ComboBox.ItemTemplate> |
149 | | - </ComboBox> |
| 157 | + |
150 | 158 |
|
151 | 159 | </StackPanel> |
152 | 160 | </DockPanel> |
|
0 commit comments