mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-07 09:28:03 +08:00
Add support for design time DataContext binding
Add this support to suppress the warning from Resharper
This commit is contained in:
parent
8de26af246
commit
1b6a43ae15
@ -2,6 +2,8 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:wox="clr-namespace:Wox"
|
||||
xmlns:vm="clr-namespace:Wox.ViewModel" xmlns:converters="clr-namespace:Wox.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
|
||||
Title="Wox"
|
||||
Topmost="True"
|
||||
Loaded="MainWindow_OnLoaded"
|
||||
@ -17,8 +19,7 @@
|
||||
Icon="Images\app.png"
|
||||
AllowsTransparency="True"
|
||||
Visibility="{Binding IsVisible,Converter={converters:VisibilityConverter}}"
|
||||
PreviewKeyDown="Window_PreviewKeyDown"
|
||||
>
|
||||
PreviewKeyDown="Window_PreviewKeyDown" d:DataContext="{d:DesignInstance vm:MainViewModel}">
|
||||
<Window.InputBindings>
|
||||
<KeyBinding Key="Esc" Command="{Binding EscCommand}"></KeyBinding>
|
||||
<KeyBinding Key="Tab" Command="{Binding SelectNextItemCommand}"></KeyBinding>
|
||||
|
@ -5,7 +5,8 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:converters="clr-namespace:Wox.Converters"
|
||||
mc:Ignorable="d" d:DesignWidth="100" d:DesignHeight="100">
|
||||
xmlns:vm ="clr-namespace:Wox.ViewModel"
|
||||
mc:Ignorable="d" d:DesignWidth="100" d:DesignHeight="100" d:DataContext="{d:DesignInstance vm:ResultPanelViewModel}">
|
||||
<ListBox x:Name="lbResults" MaxHeight="{Binding MaxHeight}" SelectedItem="{Binding SelectedResult}"
|
||||
HorizontalContentAlignment="Stretch" ItemsSource="{Binding Results}" Margin="{Binding Margin}"
|
||||
Style="{DynamicResource BaseListboxStyle}" SelectionChanged="lbResults_SelectionChanged" Focusable="False"
|
||||
@ -13,6 +14,9 @@
|
||||
VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<DataTemplate.DataType>
|
||||
<x:Type TypeName="vm:ResultItemViewModel" />
|
||||
</DataTemplate.DataType>
|
||||
<Button Command="{Binding OpenResultCommand}">
|
||||
<Button.InputBindings>
|
||||
<MouseBinding Command="{Binding OpenResultActionPanelCommand}" MouseAction="RightClick"></MouseBinding>
|
||||
|
Loading…
Reference in New Issue
Block a user