-
-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding start screen as mentioned in #242
- Loading branch information
Showing
17 changed files
with
378 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
namespace Fluent | ||
{ | ||
using System.Windows; | ||
|
||
/// <summary> | ||
/// Represents the container for the <see cref="StartScreenTabControl"/>. | ||
/// </summary> | ||
public class StartScreen : Backstage | ||
{ | ||
private bool previousTitleBarIsCollapsed; | ||
|
||
/// <summary> | ||
/// Indicates whether the <see cref="StartScreen"/> has aleaady been shown or not. | ||
/// </summary> | ||
public bool Shown | ||
{ | ||
get { return (bool)this.GetValue(ShownProperty); } | ||
set { this.SetValue(ShownProperty, value); } | ||
} | ||
|
||
/// <summary> | ||
/// <see cref="DependencyProperty"/> for <see cref="Shown"/>. | ||
/// </summary> | ||
public static readonly DependencyProperty ShownProperty = | ||
DependencyProperty.Register(nameof(Shown), typeof(bool), typeof(StartScreen), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, null)); | ||
|
||
static StartScreen() | ||
{ | ||
DefaultStyleKeyProperty.OverrideMetadata(typeof(StartScreen), new FrameworkPropertyMetadata(typeof(StartScreen))); | ||
} | ||
|
||
/// <summary> | ||
/// Shows the <see cref="StartScreen"/>. | ||
/// </summary> | ||
protected override bool Show() | ||
{ | ||
var ribbon = this.GetParentRibbon(); | ||
|
||
if (ribbon?.TitleBar != null) | ||
{ | ||
this.previousTitleBarIsCollapsed = ribbon.TitleBar.IsCollapsed; | ||
ribbon.TitleBar.IsCollapsed = true; | ||
} | ||
|
||
if (this.Shown) | ||
{ | ||
return false; | ||
} | ||
|
||
return this.Shown = base.Show(); | ||
} | ||
|
||
/// <summary> | ||
/// Hides the <see cref="StartScreen"/>. | ||
/// </summary> | ||
protected override void Hide() | ||
{ | ||
base.Hide(); | ||
|
||
var ribbon = this.GetParentRibbon(); | ||
if (ribbon?.TitleBar != null) | ||
{ | ||
ribbon.TitleBar.IsCollapsed = this.previousTitleBarIsCollapsed; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.