Add some logic around the buttons durring install.
This commit is contained in:
@@ -8,6 +8,89 @@
|
||||
xmlns:simpleControls="clr-namespace:SimpleUI.Controls;assembly=SimpleUI"
|
||||
mc:Ignorable="d"
|
||||
Width="580" Height="380">
|
||||
|
||||
<UserControl.Resources>
|
||||
|
||||
<!-- Dumb but it works... -->
|
||||
<Style x:Key="NextStyle"
|
||||
TargetType="Button"
|
||||
BasedOn="{StaticResource {x:Type Button}}">
|
||||
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
<Setter Property="IsEnabled" Value="false" />
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="simpleControls:SimpleButton">
|
||||
<simpleControls:SimpleButton Width="{TemplateBinding Width}"
|
||||
Height="{TemplateBinding Height}"
|
||||
Content="{TemplateBinding Content}"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Path=MainVM.InstallEnabled}" Value="false">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Path=MainVM.IsThinking}" Value="false">
|
||||
<Setter Property="IsEnabled" Value="true" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CancelStyle"
|
||||
TargetType="Button"
|
||||
BasedOn="{StaticResource {x:Type Button}}">
|
||||
|
||||
<Setter Property="IsEnabled" Value="true"/>
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="simpleControls:SimpleButton">
|
||||
<simpleControls:SimpleButton Width="{TemplateBinding Width}"
|
||||
Height="{TemplateBinding Height}"
|
||||
Content="{TemplateBinding Content}"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Path=MainVM.IsThinking}" Value="false">
|
||||
<Setter Property="IsEnabled" Value="false" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="FinishSyle"
|
||||
TargetType="Button"
|
||||
BasedOn="{StaticResource {x:Type Button}}">
|
||||
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
<Setter Property="IsEnabled" Value="false"/>
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="simpleControls:SimpleButton">
|
||||
<simpleControls:SimpleButton Width="{TemplateBinding Width}"
|
||||
Height="{TemplateBinding Height}"
|
||||
Content="{TemplateBinding Content}"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Path=MainVM.UnInstallEnabled}" Value="false">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
</DataTrigger>
|
||||
|
||||
<DataTrigger Binding="{Binding Path=MainVM.IsThinking}" Value="false">
|
||||
<Setter Property="IsEnabled" Value="true" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
@@ -52,7 +135,9 @@
|
||||
Grid.Column="1" Grid.Row="1"
|
||||
Content="Cancel" x:Name="Cancel"
|
||||
Width="75" Height="26"
|
||||
Margin="0 0 8 0"/>
|
||||
Margin="0 0 8 0"
|
||||
Style="{StaticResource CancelStyle}"
|
||||
Click="Cancel_Click"/>
|
||||
|
||||
<!-- Next -->
|
||||
<simpleControls:SimpleButton HorizontalAlignment="Right"
|
||||
@@ -61,7 +146,18 @@
|
||||
Content="Next" x:Name="Next"
|
||||
Width="75" Height="26"
|
||||
Margin="0 0 8 0"
|
||||
Click="Next_Click"/>
|
||||
Click="Next_Click"
|
||||
Style="{StaticResource NextStyle}"/>
|
||||
|
||||
<!-- Finish -->
|
||||
<simpleControls:SimpleButton HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Grid.Column="1" Grid.Row="1"
|
||||
Content="Finish" x:Name="Finish"
|
||||
Width="75" Height="26"
|
||||
Margin="0 0 8 0"
|
||||
Click="Finish_Click"
|
||||
Style="{StaticResource FinishSyle}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -29,9 +29,17 @@ namespace SetupBA.MVVM.View
|
||||
private void Next_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dc = DataContext as InstallViewModel;
|
||||
|
||||
// Check if we are Installing or Uninstalling to set the next step as installed summary or uninstalled summary.
|
||||
dc.MainVM.CurrentView = dc.MainVM.SummaryVM;
|
||||
}
|
||||
|
||||
private void Cancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SetupBA.BootstrapperDispatcher.InvokeShutdown();
|
||||
}
|
||||
|
||||
private void Finish_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SetupBA.BootstrapperDispatcher.InvokeShutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,16 +39,23 @@ namespace SetupBA.MVVM.ViewModel
|
||||
|
||||
public MainViewModel MainVM { get; set; }
|
||||
|
||||
//TODO: Move to main vm and set when changes happen so view is updated.
|
||||
public string Title {
|
||||
get
|
||||
{
|
||||
switch (MainVM.CurrentInstallState)
|
||||
{
|
||||
case InstallState.Installing:
|
||||
return "Installing Orbis Suite...";
|
||||
case InstallState.Install:
|
||||
if (MainVM.IsThinking)
|
||||
return "Installing Orbis Suite...";
|
||||
else
|
||||
return "Installation Complete.";
|
||||
|
||||
case InstallState.UnInstalling:
|
||||
return "Un-Installing Orbis Suite...";
|
||||
case InstallState.UnInstall:
|
||||
if (MainVM.IsThinking)
|
||||
return "Un-Installing Orbis Suite...";
|
||||
else
|
||||
return "Un-Installation Complete.";
|
||||
|
||||
default:
|
||||
return "Unknown";
|
||||
|
||||
@@ -140,8 +140,10 @@ namespace SetupBA.MVVM.ViewModel
|
||||
|
||||
private void Bootstrapper_ExecuteMsiMessage(object sender, ExecuteMsiMessageEventArgs e)
|
||||
{
|
||||
Bootstrapper.Engine.Log(LogLevel.Verbose, e.Message);
|
||||
Message = e.Message;
|
||||
if (e.MessageType == InstallMessage.ActionStart)
|
||||
{
|
||||
Message = e.Message;
|
||||
}
|
||||
}
|
||||
|
||||
private void Bootstrapper_PlanComplete(object sender, PlanCompleteEventArgs e)
|
||||
@@ -178,12 +180,10 @@ namespace SetupBA.MVVM.ViewModel
|
||||
|
||||
private void Bootstrapper_ApplyComplete(object sender, ApplyCompleteEventArgs e)
|
||||
{
|
||||
Bootstrapper.Engine.Log(LogLevel.Verbose, "Done.");
|
||||
Message = "";
|
||||
|
||||
// Done...
|
||||
IsThinking = false;
|
||||
InstallEnabled = false;
|
||||
UnInstallEnabled = false;
|
||||
}
|
||||
|
||||
private void Bootstrapper_Progress(object sender, ProgressEventArgs e)
|
||||
|
||||
@@ -1 +1 @@
|
||||
1018
|
||||
1019
|
||||
|
||||
@@ -1 +1 @@
|
||||
Version 3.0.1018 Release Build Tuesday May 10 2022 11:06 PM
|
||||
Version 3.0.1019 Release Build Wednesday May 11 2022 11:58 PM
|
||||
|
||||
Reference in New Issue
Block a user