mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-13 11:09:28 +08:00
ResultPanelViewModel -> ResultsViewModel, part 2
part of refactoring for PR #494
This commit is contained in:
parent
9db37c2799
commit
d5696010d9
@ -21,7 +21,7 @@
|
||||
Visibility="{Binding IsVisible,Converter={converters:VisibilityConverter}}"
|
||||
PreviewKeyDown="Window_PreviewKeyDown" d:DataContext="{d:DesignInstance vm:MainViewModel, IsDesignTimeCreatable=True}">
|
||||
<Window.Resources>
|
||||
<DataTemplate DataType="{x:Type vm:ResultPanelViewModel}">
|
||||
<DataTemplate DataType="{x:Type vm:ResultsViewModel}">
|
||||
<wox:ResultListBox></wox:ResultListBox>
|
||||
</DataTemplate>
|
||||
<converters:VisibilityConverter x:Key="VisibilityConverter" />
|
||||
|
@ -6,7 +6,7 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:converters="clr-namespace:Wox.Converters"
|
||||
xmlns:vm ="clr-namespace:Wox.ViewModel"
|
||||
mc:Ignorable="d" d:DesignWidth="100" d:DesignHeight="100" d:DataContext="{d:DesignInstance vm:ResultPanelViewModel}">
|
||||
mc:Ignorable="d" d:DesignWidth="100" d:DesignHeight="100" d:DataContext="{d:DesignInstance vm:ResultsViewModel}">
|
||||
<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"
|
||||
|
@ -19,7 +19,7 @@ namespace Wox
|
||||
{
|
||||
public void AddResults(List<Result> newResults, string resultId)
|
||||
{
|
||||
var vm = this.DataContext as ResultPanelViewModel;
|
||||
var vm = this.DataContext as ResultsViewModel;
|
||||
vm.AddResults(newResults, resultId);
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ namespace Wox
|
||||
{
|
||||
this._api = api;
|
||||
InitializeComponent();
|
||||
this.ResultListBoxPreview.DataContext = new ResultPanelViewModel();
|
||||
this.ResultListBoxPreview.DataContext = new ResultsViewModel();
|
||||
Loaded += Setting_Loaded;
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace Wox.ViewModel
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private ResultPanelViewModel _actionPanel;
|
||||
private ResultsViewModel _actionPanel;
|
||||
private string _queryText;
|
||||
private bool _isVisible;
|
||||
private bool _isResultListBoxVisible;
|
||||
@ -56,9 +56,9 @@ namespace Wox.ViewModel
|
||||
|
||||
#region ViewModel Properties
|
||||
|
||||
public ResultPanelViewModel Results { get; private set; }
|
||||
public ResultsViewModel Results { get; private set; }
|
||||
|
||||
public ResultPanelViewModel ActionPanel
|
||||
public ResultsViewModel ActionPanel
|
||||
{
|
||||
get
|
||||
{
|
||||
@ -408,7 +408,7 @@ namespace Wox.ViewModel
|
||||
|
||||
private void InitializeResultListBox()
|
||||
{
|
||||
this.Results = new ResultPanelViewModel();
|
||||
this.Results = new ResultsViewModel();
|
||||
this.IsResultListBoxVisible = false;
|
||||
}
|
||||
|
||||
@ -478,7 +478,7 @@ namespace Wox.ViewModel
|
||||
|
||||
private void InitializeActionPanel()
|
||||
{
|
||||
this._actionPanel = new ResultPanelViewModel();
|
||||
this._actionPanel = new ResultsViewModel();
|
||||
this.IsActionPanelVisible = false;
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ using Wox.Storage;
|
||||
|
||||
namespace Wox.ViewModel
|
||||
{
|
||||
public class ResultPanelViewModel : BaseViewModel
|
||||
public class ResultsViewModel : BaseViewModel
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
@ -28,7 +28,7 @@ namespace Wox.ViewModel
|
||||
|
||||
#region Constructor
|
||||
|
||||
public ResultPanelViewModel()
|
||||
public ResultsViewModel()
|
||||
{
|
||||
this._results = new ResultCollection();
|
||||
}
|
||||
|
@ -137,7 +137,7 @@
|
||||
<Compile Include="ViewModel\BaseViewModel.cs" />
|
||||
<Compile Include="ViewModel\MainViewModel.cs" />
|
||||
<Compile Include="ViewModel\ResultItemViewModel.cs" />
|
||||
<Compile Include="ViewModel\ResultPanelViewModel.cs" />
|
||||
<Compile Include="ViewModel\ResultsViewModel.cs" />
|
||||
<Compile Include="WoxUpdate.xaml.cs">
|
||||
<DependentUpon>WoxUpdate.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
Loading…
Reference in New Issue
Block a user