Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
raphgodart committed Nov 17, 2017
1 parent 3e57c59 commit eae68b8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
22 changes: 9 additions & 13 deletions Dopamine.Common/Controls/DopamineWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ private void BorderlessWindowBase_CloseToolTipChanged(object sender, EventArgs e
this.closeButton.ToolTip = this.CloseToolTip;
}

/// <summary>
/// Custom Activate function because the real Activate function doesn't always bring the window on top.
/// </summary>
/// <remarks></remarks>
public void ForceActivate()
{
// Prevent calling Activate() before Show() was called. Otherwise Activate() fails
Expand All @@ -106,10 +102,6 @@ public void ForceActivate()
t.Start();
}

/// <summary>
/// Sets the border
/// </summary>
/// <remarks></remarks>
public void SetWindowBorder(bool hasBorder)
{
this.hasBorder = hasBorder;
Expand All @@ -126,15 +118,19 @@ private void SetBorderThickness(Thickness borderThickness)
this.previousBorderThickness = borderThickness;
}

/// <summary>
/// The Deactivate function which goes together with ActivateNow
/// </summary>
/// <remarks></remarks>
private void Deactivate()
{
System.Threading.Thread.Sleep(500);
Application.Current.Dispatcher.Invoke(() => this.Topmost = this.oldTopMost);
System.Threading.Thread.CurrentThread.Abort();

try
{
System.Threading.Thread.CurrentThread.Abort();
}
catch (System.Exception)
{
// This fails sometimes. We don't care about it.
}
}
}
}
3 changes: 1 addition & 2 deletions Dopamine/ViewModels/InitializeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public string InitializeText

return $"Updating {ProductInformation.ApplicationName}";
}
}

}
}
}
5 changes: 2 additions & 3 deletions Dopamine/Views/Initialize.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
xmlns:prismMvvm="clr-namespace:Prism.Mvvm;assembly=Prism.Wpf"
xmlns:dc="clr-namespace:Digimezzo.WPFControls;assembly=Digimezzo.WPFControls"
mc:Ignorable="d"
Title="Updating" Height="75" Width="350"
Title="Dopamine" Height="75" Width="350"
Background="#0B0B0B"
ShowWindowControls="False"
Loaded="Window_Loaded"
Expand All @@ -20,8 +20,7 @@
Height="30"
VerticalAlignment="Center"
Foreground="#1D7DD4"
IsActive="{Binding IsBusy}"
Visibility="{Binding IsBusy,Converter={StaticResource BooleanToCollapsedConverter}}"/>
IsActive="True"/>
<TextBlock Text="{Binding InitializeText}" VerticalAlignment="Center" Margin="30,0,0,0" FontSize="22" FontWeight="Light" Foreground="White"/>
</DockPanel>
</controls:DopamineWindow>

0 comments on commit eae68b8

Please sign in to comment.