Родитель
65f3fc970e
Коммит
0e24227de0
|
@ -110,6 +110,11 @@
|
||||||
<Setter Property="IsSelected" Value="{Binding Mode=TwoWay, Path=IsSelected}"/>
|
<Setter Property="IsSelected" Value="{Binding Mode=TwoWay, Path=IsSelected}"/>
|
||||||
</Style>
|
</Style>
|
||||||
</ListBox.ItemContainerStyle>
|
</ListBox.ItemContainerStyle>
|
||||||
|
<ListBox.ContextMenu>
|
||||||
|
<ContextMenu>
|
||||||
|
<MenuItem Header="Clear" Command="{Binding TraitsClearCommand}" />
|
||||||
|
</ContextMenu>
|
||||||
|
</ListBox.ContextMenu>
|
||||||
<i:Interaction.Triggers>
|
<i:Interaction.Triggers>
|
||||||
<i:EventTrigger EventName="SelectionChanged">
|
<i:EventTrigger EventName="SelectionChanged">
|
||||||
<cmd:EventToCommand Command="{Binding TraitSelectionChangedCommand}" />
|
<cmd:EventToCommand Command="{Binding TraitSelectionChangedCommand}" />
|
||||||
|
|
|
@ -50,6 +50,7 @@ namespace xunit.runner.wpf.ViewModel
|
||||||
this.RunCommand = new RelayCommand(OnExecuteRun, CanExecuteRun);
|
this.RunCommand = new RelayCommand(OnExecuteRun, CanExecuteRun);
|
||||||
this.CancelCommand = new RelayCommand(OnExecuteCancel, CanExecuteCancel);
|
this.CancelCommand = new RelayCommand(OnExecuteCancel, CanExecuteCancel);
|
||||||
this.TraitSelectionChangedCommand = new RelayCommand(OnTraitSelectionChanged);
|
this.TraitSelectionChangedCommand = new RelayCommand(OnTraitSelectionChanged);
|
||||||
|
this.TraitsClearCommand = new RelayCommand(OnTraitsClear);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool TestCaseMatches(TestCaseViewModel testCase, SearchQuery searchQuery)
|
private static bool TestCaseMatches(TestCaseViewModel testCase, SearchQuery searchQuery)
|
||||||
|
@ -108,6 +109,7 @@ namespace xunit.runner.wpf.ViewModel
|
||||||
public RelayCommand RunCommand { get; }
|
public RelayCommand RunCommand { get; }
|
||||||
public RelayCommand CancelCommand { get; }
|
public RelayCommand CancelCommand { get; }
|
||||||
public ICommand TraitSelectionChangedCommand { get; }
|
public ICommand TraitSelectionChangedCommand { get; }
|
||||||
|
public ICommand TraitsClearCommand { get; }
|
||||||
|
|
||||||
public CommandBindingCollection CommandBindings { get; }
|
public CommandBindingCollection CommandBindings { get; }
|
||||||
|
|
||||||
|
@ -328,8 +330,6 @@ namespace xunit.runner.wpf.ViewModel
|
||||||
tc.State = TestState.NotRun;
|
tc.State = TestState.NotRun;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Need a way to filter based on traits
|
|
||||||
|
|
||||||
var runAll = TestCases.Count == this.allTestCases.Count;
|
var runAll = TestCases.Count == this.allTestCases.Count;
|
||||||
var testSessionList = new List<ITestSession>();
|
var testSessionList = new List<ITestSession>();
|
||||||
|
|
||||||
|
@ -437,6 +437,14 @@ namespace xunit.runner.wpf.ViewModel
|
||||||
FilterAfterDelay();
|
FilterAfterDelay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnTraitsClear()
|
||||||
|
{
|
||||||
|
foreach (var cur in this.traitCollectionView.Collection)
|
||||||
|
{
|
||||||
|
cur.IsSelected = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool IncludePassedTests
|
public bool IncludePassedTests
|
||||||
{
|
{
|
||||||
get { return searchQuery.IncludePassedTests; }
|
get { return searchQuery.IncludePassedTests; }
|
||||||
|
|
|
@ -9,13 +9,19 @@ namespace xunit.runner.wpf.ViewModel
|
||||||
{
|
{
|
||||||
public sealed class TraitViewModel : ViewModelBase
|
public sealed class TraitViewModel : ViewModelBase
|
||||||
{
|
{
|
||||||
public readonly string _name;
|
private readonly string _name;
|
||||||
public readonly string _value;
|
private readonly string _value;
|
||||||
|
private bool _isSelected;
|
||||||
|
|
||||||
public string Name => _name;
|
public string Name => _name;
|
||||||
public string Value => _value;
|
public string Value => _value;
|
||||||
public string DisplayName => $"{Name}={Value}";
|
public string DisplayName => $"{Name}={Value}";
|
||||||
public bool IsSelected { get; set; }
|
|
||||||
|
public bool IsSelected
|
||||||
|
{
|
||||||
|
get { return _isSelected; }
|
||||||
|
set { Set(ref _isSelected, value, nameof(IsSelected)); }
|
||||||
|
}
|
||||||
|
|
||||||
public TraitViewModel(string name, string value)
|
public TraitViewModel(string name, string value)
|
||||||
{
|
{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче