diff options
author | sr55 <[email protected]> | 2017-01-08 17:51:05 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2017-01-08 17:51:05 +0000 |
commit | d563e79ad6a21fc06e1ca8f23f106704313962fc (patch) | |
tree | a791f6cbf1da08b09e24746b28fb22c8da7949e5 /win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs | |
parent | 3e3218dfb1e09f7f2aa851d03c0dfedbf1b53a68 (diff) |
WinGui: Allow the log window to be opened from the Scan Status Overlay.
Diffstat (limited to 'win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs | 73 |
1 files changed, 57 insertions, 16 deletions
diff --git a/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs b/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs index 90afe8e33..64e279517 100644 --- a/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs +++ b/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs @@ -27,36 +27,27 @@ namespace HandBrakeWPF.Controls this.Message = "Message";
}
- /// <summary>
- /// Dependancy Property for the IsLoading Property
- /// </summary>
public static readonly DependencyProperty IsLoadingProperty =
DependencyProperty.Register("IsLoading", typeof(bool), typeof(StatusPanel), new UIPropertyMetadata(false));
- /// <summary>
- /// Dependancy Property for the Message Property
- /// </summary>
public static readonly DependencyProperty MessageProperty =
DependencyProperty.Register("Message", typeof(string), typeof(StatusPanel), new UIPropertyMetadata("Loading..."));
- /// <summary>
- /// Dependancy Property for the submessage propery
- /// </summary>
public static readonly DependencyProperty SubMessageProperty =
DependencyProperty.Register("SubMessage", typeof(string), typeof(StatusPanel), new FrameworkPropertyMetadata("Please Wait", FrameworkPropertyMetadataOptions.AffectsRender));
- /// <summary>
- /// Dependancy Property for the submessage propery
- /// </summary>
public static readonly DependencyProperty ActionProperty =
DependencyProperty.Register("CancelAction", typeof(Action), typeof(StatusPanel), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.None, OnCancelActionSet));
- /// <summary>
- /// Dependancy Property for the submessage propery
- /// </summary>
+ public static readonly DependencyProperty SecondaryActionProperty =
+ DependencyProperty.Register("SecondaryAction", typeof(Action), typeof(StatusPanel), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.None, OnSecondaryActionSet));
+
public static readonly DependencyProperty ActionTextProperty =
DependencyProperty.Register("ActionText", typeof(string), typeof(StatusPanel), new UIPropertyMetadata("Cancel"));
+ public static readonly DependencyProperty SecondaryActionTextProperty =
+ DependencyProperty.Register("SecondaryActionText", typeof(string), typeof(StatusPanel), new UIPropertyMetadata("Open Log Window"));
+
/// <summary>
/// Gets or sets a value indicating whether IsLoading.
/// </summary>
@@ -90,7 +81,25 @@ namespace HandBrakeWPF.Controls public Action CancelAction
{
get { return (Action)GetValue(ActionProperty); }
- set { SetValue(SubMessageProperty, value); }
+ set { SetValue(ActionProperty, value); }
+ }
+
+ /// <summary>
+ /// Gets or sets the cancel action.
+ /// </summary>
+ public Action SecondaryAction
+ {
+ get { return (Action)GetValue(SecondaryActionProperty); }
+ set { SetValue(SecondaryActionProperty, value); }
+ }
+
+ /// <summary>
+ /// Gets or sets SecondaryActionText.
+ /// </summary>
+ public string SecondaryActionText
+ {
+ get { return (string)GetValue(SecondaryActionTextProperty); }
+ set { SetValue(SecondaryActionTextProperty, value); }
}
/// <summary>
@@ -107,6 +116,19 @@ namespace HandBrakeWPF.Controls }
/// <summary>
+ /// The on Secondary Action Set.
+ /// </summary>
+ /// <param name="d">
+ /// The d.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private static void OnSecondaryActionSet(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ }
+
+ /// <summary>
/// Gets or sets the action text.
/// </summary>
public string ActionText
@@ -127,6 +149,17 @@ namespace HandBrakeWPF.Controls }
/// <summary>
+ ///
+ /// </summary>
+ public bool IsActionButton2Visibile
+ {
+ get
+ {
+ return true; //SecondaryAction != null;
+ }
+ }
+
+ /// <summary>
/// The status action button_ on click.
/// </summary>
/// <param name="sender">
@@ -142,5 +175,13 @@ namespace HandBrakeWPF.Controls this.CancelAction();
}
}
+
+ private void PerformSecondaryAction(object sender, RoutedEventArgs e)
+ {
+ if (this.SecondaryAction != null)
+ {
+ this.SecondaryAction();
+ }
+ }
}
}
|