Skip to content

Commit

Permalink
Hide pending items
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKert committed Apr 6, 2019
1 parent 9e7f92d commit 51c606f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/BuildVision.UI/BuildVision.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Attributes\DisplayStringAttribute.cs" />
<Compile Include="Components\ProjectGrid.xaml.cs">
<DependentUpon>ProjectGrid.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -129,7 +130,6 @@
<Compile Include="Extensions\TextBlockUtils.cs" />
<Compile Include="Extensions\VectorResources.cs" />
<Compile Include="Extensions\VisualHelper.cs" />
<Compile Include="Attributes\DisplayStringAttribute.cs" />
<Compile Include="Helpers\EnumExtensions.cs" />
<Compile Include="Helpers\StyleConverting.cs" />
<Compile Include="MainWindow.xaml.cs">
Expand Down
9 changes: 9 additions & 0 deletions src/BuildVision.UI/Components/ProjectGrid.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,15 @@
<Setter Property="Visibility" Value="Collapsed"/>
</MultiDataTrigger>


<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Value="{x:Static contracts:ProjectState.Pending}" Binding="{Binding Path=State}"/>
<Condition Binding="{Binding Path=DataContext.FillProjectListOnBuildBegin, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Value="False"/>
</MultiDataTrigger.Conditions>
<Setter Property="Visibility" Value="Collapsed"/>
</MultiDataTrigger>

<DataTrigger Value="True">
<DataTrigger.Binding>
<MultiBinding Converter="{StaticResource ObjectsReferencesEqualsConverter}">
Expand Down
28 changes: 14 additions & 14 deletions src/BuildVision.UI/DataGrid/ColumnsManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
Expand All @@ -9,25 +9,25 @@
using System.Windows.Media;
using System.Windows.Media.Imaging;
using BuildVision.Contracts;
using BuildVision.UI.Modelss;
using BuildVision.UI.Helpers;
using BuildVision.UI.Extensions;
using BuildVision.UI.Common.Logging;
using BuildVision.UI.Extensions;
using BuildVision.UI.Helpers;
using BuildVision.UI.Models;
using BuildVision.UI.Modelss;
using BuildVision.UI.Settings.Models;
using BuildVision.UI.Settings.Models.Columns;
using BuildVision.UI.Settings.Models.Sorting;
using BuildVision.UI.Settings.Models;

namespace BuildVision.UI.DataGrid
{
public static class ColumnsManager
{
private static List<string> _nonSortableColumns = new List<string>
private static readonly List<string> _nonSortableColumns = new List<string>
{
nameof(ProjectItem.StateBitmap)
};

private static List<string> _nonGroupableColumns = new List<string>
private static readonly List<string> _nonGroupableColumns = new List<string>
{
nameof(ProjectItem.StateBitmap),
nameof(ProjectItem.BuildStartTime),
Expand Down Expand Up @@ -112,11 +112,11 @@ public static void GenerateColumns(ObservableCollection<DataGridColumn> columns,
else
{
columnSettings = new GridColumnSettings(
propertyName,
columnConfiguration.Header,
columnConfiguration.Visible,
columnConfiguration.DisplayIndex,
columnConfiguration.Width,
propertyName,
columnConfiguration.Header,
columnConfiguration.Visible,
columnConfiguration.DisplayIndex,
columnConfiguration.Width,
columnConfiguration.ValueStringFormat);
gridSettings.Columns.Add(columnSettings);
}
Expand Down Expand Up @@ -149,7 +149,7 @@ public static void SyncColumnSettings(ObservableCollection<DataGridColumn> colum
foreach (DataGridBoundColumn column in columns.OfType<DataGridBoundColumn>())
{
string propertyName = column.GetBindedProperty();
GridColumnSettings columnSettings = gridSettings.Columns[propertyName];
var columnSettings = gridSettings.Columns[propertyName];
if (columnSettings == null)
continue;

Expand Down Expand Up @@ -283,4 +283,4 @@ private static void InitColumn(DataGridBoundColumn column, GridColumnAttribute c
column.SetValue(DataGridColumnExtensions.NameProperty, columnName);
}
}
}
}
2 changes: 1 addition & 1 deletion src/BuildVision.UI/Enums/BuildMajorMessageFormat.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using BuildVision.UI.Helpers;
using BuildVision.UI.Helpers;

namespace BuildVision.UI.Models
{
Expand Down

0 comments on commit 51c606f

Please sign in to comment.