Skip to content

Commit

Permalink
Further cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKert committed Mar 16, 2019
1 parent f4ccea4 commit edfb460
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 38 deletions.
59 changes: 26 additions & 33 deletions src/BuildVision.UI/Components/ControlView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<!--<ContentControl Grid.Column="0"
<ContentControl Grid.Column="0"
Margin="0,-7,8,0"
Template="{DynamicResource State}" /> TODO Add stateimages-->
Template="{DynamicResource State}" />

<TextBlock Grid.Column="1"
FontSize="18"
Expand All @@ -124,8 +124,6 @@
extensions:TextBlockUtils.AutoTooltip="True" />
</Grid>

<!-- TODO ADD progressbar -->

<controls:BuildVisionProgressBar DataContext="{Binding BuildProgressViewModel.ActionProgressIsVisible}" />

<Grid Visibility="{Binding ControlSettings.GeneralSettings.IndicatorsPanelVisible,
Expand All @@ -144,40 +142,35 @@
Margin="0,0,0,0"
Orientation="Horizontal">

<customButtons:BuildSolutionButton
Command="{Binding BuildSolutionAction}"
Visibility="{Binding BuildProgressViewModel.ActionProgressIsVisible, Converter={StaticResource InvertedBoolToVisibilityConverter}}"
IsEnabled="{Binding SolutionModel.IsEmpty, Converter={StaticResource InverseBoolean}}" />

<customButtons:RebuildSolutionButton
Command="{Binding RebuildSolutionAction}"
Visibility="{Binding BuildProgressViewModel.ActionProgressIsVisible, Converter={StaticResource InvertedBoolToVisibilityConverter}}"
IsEnabled="{Binding SolutionModel.IsEmpty, Converter={StaticResource InverseBoolean}}" />
<StackPanel Orientation="Horizontal"
IsEnabled="true">
<StackPanel.Style>
<Style TargetType="{x:Type StackPanel}">
<Setter Property="Visibility" Value="Visible" />
<Style.Triggers>
<DataTrigger Binding="{Binding BuildInformationModel.CurrentBuildState}" Value="{x:Static contracts:BuildState.InProgress}">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Style>

<customButtons:BuildSolutionButton Command="{Binding BuildSolutionAction}" IsEnabled="True" />

<customButtons:RebuildSolutionButton Command="{Binding RebuildSolutionButton}" />

<customButtons:CleanSolutionButton
Command="{Binding CleanSolutionAction}"
Visibility="{Binding BuildProgressViewModel.ActionProgressIsVisible, Converter={StaticResource InvertedBoolToVisibilityConverter}}"
IsEnabled="{Binding SolutionModel.IsEmpty, Converter={StaticResource InverseBoolean}}" />
<customButtons:CleanSolutionButton Command="{Binding CleanSolutionButton}" />
</StackPanel>

<customButtons:CancelButton
Command="{Binding CancelBuildSolutionAction}"
Visibility="{Binding BuildProgressViewModel.ActionProgressIsVisible, Converter={StaticResource BoolToVisibilityConverter}}">
<customButtons:CancelButton Command="{Binding CancelBuildSolutionAction}">
<customButtons:CancelButton.Style>
<Style TargetType="Button"
BasedOn="{StaticResource ToolBarButtonBaseStyle}">
<Setter Property="IsEnabled"
Value="True" />
<Style TargetType="{x:Type customButtons:CancelButton}">
<Setter Property="IsEnabled" Value="False" />
<Setter Property="Visibility" Value="Collapsed" />

<Style.Triggers>
<DataTrigger Binding="{Binding SolutionModel.IsEmpty}"
Value="True">
<Setter Property="IsEnabled"
Value="False" />
</DataTrigger>
<DataTrigger Binding="{Binding BuildProgressViewModel.ActionProgressIsPaused}"
Value="True">
<Setter Property="IsEnabled"
Value="False" />
<DataTrigger Binding="{Binding BuildInformationModel.CurrentBuildState}" Value="{x:Static contracts:BuildState.InProgress}">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
Expand Down
6 changes: 3 additions & 3 deletions src/BuildVision.UI/Resources/BuildAction.Resources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<Style TargetType="Polygon">
<Setter Property="Fill" Value="Gray" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=RebuildSolutionIcon, Path=IsMouseOver}" Value="True"> <!-- TODO Is this reallythe button`?? -->
<DataTrigger Binding="{Binding ElementName=RebuildSolutionButton, Path=IsMouseOver}" Value="True"> <!-- TODO Is this reallythe button`?? -->
<Setter Property="Fill" Value="#399AFC" />
</DataTrigger>
</Style.Triggers>
Expand Down Expand Up @@ -47,7 +47,7 @@
<Style TargetType="Polygon">
<Setter Property="Fill" Value="Gray" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=BuildSolutionIcon, Path=IsMouseOver}" Value="True">
<DataTrigger Binding="{Binding ElementName=BuildSolutionButton, Path=IsMouseOver}" Value="True">
<Setter Property="Fill" Value="#399AFC" />
</DataTrigger>
</Style.Triggers>
Expand Down Expand Up @@ -115,7 +115,7 @@
<Style TargetType="Path">
<Setter Property="Fill" Value="Gray" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=CleanSolutionIcon, Path=IsMouseOver}" Value="True">
<DataTrigger Binding="{Binding ElementName=CleanSolutionButton, Path=IsMouseOver}" Value="True">
<Setter Property="Fill" Value="#D0A200" />
</DataTrigger>
</Style.Triggers>
Expand Down
6 changes: 4 additions & 2 deletions src/BuildVision.UI/ViewModels/BuildVisionPaneViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace BuildVision.UI.ViewModels
public class BuildVisionPaneViewModel : BindableBase, IBuildVisionPaneViewModel
{
public IBuildProgressViewModel BuildProgressViewModel { get; set; }
public ISolutionModel SoltuionModel { get; set; }
public ISolutionModel SolutionModel { get; set; }

private ObservableCollection<DataGridColumn> _gridColumnsRef;

Expand Down Expand Up @@ -198,7 +198,7 @@ public BuildVisionPaneViewModel(IBuildService buildManager, IBuildInformationPro
_buildInformationProvider = buildInformationProvider;
BuildInformationModel = _buildInformationProvider.GetBuildInformationModel();
BuildProgressViewModel = new BuildProgressViewModel(ControlSettings);
SoltuionModel = solutionProvider.GetSolutionModel();
SolutionModel = solutionProvider.GetSolutionModel();
ControlSettings = settingsProvider.Settings;
}

Expand All @@ -209,6 +209,8 @@ internal BuildVisionPaneViewModel()
{
ControlSettings = new ControlSettings();
BuildProgressViewModel = new BuildProgressViewModel(ControlSettings);
BuildInformationModel = new BuildInformationModel();
SolutionModel = new SolutionModel();
}

private void OpenContainingFolder()
Expand Down

0 comments on commit edfb460

Please sign in to comment.