|
196 | 196 | Content="{Binding ViewModel.CurrentImmediateResult}">
|
197 | 197 | <ContentControl.Resources>
|
198 | 198 | <DataTemplate DataType="{x:Type models_imr:MenuResult}">
|
199 |
| - <ListView Name="MenuResultBox" Margin="0 5 0 0" MinHeight="0" |
200 |
| - Height="Auto" |
201 |
| - MaxHeight="{Binding Source={StaticResource AppConfigProxy},Path=Data.LauncherResultViewHeight}" |
202 |
| - BorderThickness="0" |
203 |
| - ScrollViewer.HorizontalScrollBarVisibility="Disabled" |
204 |
| - ScrollViewer.VerticalScrollBarVisibility="Auto" |
205 |
| - ItemsSource="{Binding Items}" d:ItemsSource="{d:SampleData ItemCount=5}" |
206 |
| - SelectedItem="{Binding SelectedItem,Mode=OneWayToSource}" |
207 |
| - SelectedIndex="{Binding SelectedIndex}"> |
208 |
| - <behaviors:Interaction.Triggers> |
209 |
| - <behaviors:EventTrigger EventName="SelectionChanged"> |
210 |
| - <behaviors:InvokeCommandAction Command="{Binding Source={StaticResource WindowProxy},Path=Data.ScrollToSelectedItemCommand}" |
211 |
| - CommandParameter="{x:Reference Name=MenuResultBox}"/> |
212 |
| - </behaviors:EventTrigger> |
213 |
| - </behaviors:Interaction.Triggers> |
214 |
| - <ListView.ItemTemplate> |
215 |
| - <DataTemplate DataType="models:QueryResultModel"> |
216 |
| - <Border Padding="{DynamicResource QueryResultPaddingThickness}"> |
217 |
| - <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch"> |
218 |
| - <Grid.ColumnDefinitions> |
219 |
| - <ColumnDefinition Width="Auto"/> |
220 |
| - <ColumnDefinition Width="8"/> |
221 |
| - <ColumnDefinition/> |
222 |
| - </Grid.ColumnDefinitions> |
| 199 | + <Grid Margin="0 5 0 0"> |
| 200 | + <Grid.ColumnDefinitions> |
| 201 | + <ColumnDefinition Width="1*"/> |
| 202 | + <ColumnDefinition Width="{Binding PreviewPaneWidth}"/> |
| 203 | + </Grid.ColumnDefinitions> |
223 | 204 |
|
224 |
| - <Border Width="{DynamicResource QueryResultIconSize}" |
225 |
| - Height="{DynamicResource QueryResultIconSize}" |
226 |
| - CornerRadius="{DynamicResource QueryResultIconCornerRadius}"> |
227 |
| - <Border.Background> |
228 |
| - <ImageBrush Stretch="Uniform" |
229 |
| - ImageSource="{Binding Icon}"/> |
230 |
| - </Border.Background> |
231 |
| - </Border> |
| 205 | + <ListView Name="MenuResultBox" |
| 206 | + MinHeight="0" |
| 207 | + Height="Auto" |
| 208 | + MaxHeight="{Binding Source={StaticResource AppConfigProxy},Path=Data.LauncherResultViewHeight}" |
| 209 | + BorderThickness="0" |
| 210 | + ScrollViewer.HorizontalScrollBarVisibility="Disabled" |
| 211 | + ScrollViewer.VerticalScrollBarVisibility="Auto" |
| 212 | + ItemsSource="{Binding Items}" d:ItemsSource="{d:SampleData ItemCount=5}" |
| 213 | + SelectedItem="{Binding SelectedItem,Mode=OneWayToSource}" |
| 214 | + SelectedIndex="{Binding SelectedIndex}"> |
| 215 | + <behaviors:Interaction.Triggers> |
| 216 | + <behaviors:EventTrigger EventName="SelectionChanged"> |
| 217 | + <behaviors:InvokeCommandAction Command="{Binding Source={StaticResource WindowProxy},Path=Data.ScrollToSelectedItemCommand}" |
| 218 | + CommandParameter="{x:Reference Name=MenuResultBox}"/> |
| 219 | + </behaviors:EventTrigger> |
| 220 | + </behaviors:Interaction.Triggers> |
| 221 | + <ListView.ItemTemplate> |
| 222 | + <DataTemplate DataType="models:QueryResultModel"> |
| 223 | + <Border Padding="{DynamicResource QueryResultPaddingThickness}"> |
| 224 | + <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch"> |
| 225 | + <Grid.ColumnDefinitions> |
| 226 | + <ColumnDefinition Width="Auto"/> |
| 227 | + <ColumnDefinition Width="8"/> |
| 228 | + <ColumnDefinition/> |
| 229 | + </Grid.ColumnDefinitions> |
232 | 230 |
|
233 |
| - <Grid Grid.Column="2"> |
234 |
| - <Grid.RowDefinitions> |
235 |
| - <RowDefinition/> |
236 |
| - <RowDefinition/> |
237 |
| - </Grid.RowDefinitions> |
238 |
| - <TextBlock Text="{Binding Title}" |
239 |
| - FontSize="{DynamicResource QueryResultTitleTextSize}" |
240 |
| - Foreground="{DynamicResource TextFillColorPrimaryBrush}"/> |
241 |
| - <TextBlock Grid.Row="1" |
242 |
| - TextTrimming="WordEllipsis" |
243 |
| - Text="{Binding Description}" |
244 |
| - FontSize="{DynamicResource QueryResultDescriptionTextSize}" |
245 |
| - Foreground="{DynamicResource TextFillColorSecondaryBrush}"/> |
| 231 | + <Border Width="{DynamicResource QueryResultIconSize}" |
| 232 | + Height="{DynamicResource QueryResultIconSize}" |
| 233 | + CornerRadius="{DynamicResource QueryResultIconCornerRadius}"> |
| 234 | + <Border.Background> |
| 235 | + <ImageBrush Stretch="Uniform" |
| 236 | + ImageSource="{Binding Icon}"/> |
| 237 | + </Border.Background> |
| 238 | + </Border> |
| 239 | + |
| 240 | + <Grid Grid.Column="2"> |
| 241 | + <Grid.RowDefinitions> |
| 242 | + <RowDefinition/> |
| 243 | + <RowDefinition/> |
| 244 | + </Grid.RowDefinitions> |
| 245 | + <TextBlock Text="{Binding Title}" |
| 246 | + FontSize="{DynamicResource QueryResultTitleTextSize}" |
| 247 | + Foreground="{DynamicResource TextFillColorPrimaryBrush}"/> |
| 248 | + <TextBlock Grid.Row="1" |
| 249 | + TextTrimming="WordEllipsis" |
| 250 | + Text="{Binding Description}" |
| 251 | + FontSize="{DynamicResource QueryResultDescriptionTextSize}" |
| 252 | + Foreground="{DynamicResource TextFillColorSecondaryBrush}"/> |
| 253 | + </Grid> |
246 | 254 | </Grid>
|
247 |
| - </Grid> |
248 |
| - </Border> |
249 |
| - </DataTemplate> |
250 |
| - </ListView.ItemTemplate> |
251 |
| - <ListView.ItemContainerStyle> |
252 |
| - <Style TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource {x:Type ListViewItem}}"> |
253 |
| - <Setter Property="BorderThickness" Value="0" /> |
254 |
| - <Setter Property="HorizontalContentAlignment" Value="Stretch"/> |
255 |
| - <EventSetter Event="PreviewMouseDown" |
256 |
| - Handler="ResultBoxItemMouseDown"/> |
257 |
| - </Style> |
258 |
| - </ListView.ItemContainerStyle> |
259 |
| - </ListView> |
| 255 | + </Border> |
| 256 | + </DataTemplate> |
| 257 | + </ListView.ItemTemplate> |
| 258 | + <ListView.ItemContainerStyle> |
| 259 | + <Style TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource {x:Type ListViewItem}}"> |
| 260 | + <Setter Property="BorderThickness" Value="0" /> |
| 261 | + <Setter Property="HorizontalContentAlignment" Value="Stretch"/> |
| 262 | + <EventSetter Event="PreviewMouseDown" |
| 263 | + Handler="ResultBoxItemMouseDown"/> |
| 264 | + </Style> |
| 265 | + </ListView.ItemContainerStyle> |
| 266 | + </ListView> |
| 267 | + |
| 268 | + <Grid Grid.Column="1"> |
| 269 | + <GridSplitter VerticalAlignment="Stretch" |
| 270 | + HorizontalAlignment="Left" |
| 271 | + Background="Transparent" |
| 272 | + Width="3"/> |
| 273 | + <Rectangle VerticalAlignment="Stretch" |
| 274 | + HorizontalAlignment="Left" |
| 275 | + Fill="#80777777" |
| 276 | + Width="1" |
| 277 | + Margin="1 0"/> |
| 278 | + <Border Margin="3 0 0 0"> |
| 279 | + <FlowDocumentScrollViewer Document="{Binding SelectedItem.Preview}"/> |
| 280 | + </Border> |
| 281 | + </Grid> |
| 282 | + </Grid> |
| 283 | + |
260 | 284 | </DataTemplate>
|
261 | 285 | <DataTemplate DataType="{x:Type models_imr:DocumentResult}">
|
262 | 286 | <FlowDocumentScrollViewer Document="{Binding Document}"
|
263 |
| - MinHeight="{Binding Source={StaticResource AppConfigProxy},Path=Data.LauncherResultViewHeight}"> |
264 |
| - |
265 |
| - </FlowDocumentScrollViewer> |
| 287 | + FontFamily="Microsoft Yahei" |
| 288 | + MinHeight="{Binding Source={StaticResource AppConfigProxy},Path=Data.LauncherResultViewHeight}"/> |
266 | 289 | </DataTemplate>
|
267 | 290 | </ContentControl.Resources>
|
268 | 291 | </ContentControl>
|
|
0 commit comments