TextWrapping="WrapWithOverflow"\r
/>\r
</StackPanel>\r
- \r
- <Button Content="{Binding ActionText, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Margin="0,10,0,0"\r
- x:Name="StatusActionButton" Click="StatusActionButton_OnClick" Padding="8,2" HorizontalAlignment="Right"\r
- Visibility="{Binding IsActionButtonVisible, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Converter={StaticResource boolTovisibility}}" />\r
+\r
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">\r
+\r
+ <Button Content="{Binding SecondaryActionText, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Margin="0,10,5,0"\r
+ x:Name="SecondaryActionCtl" Click="PerformSecondaryAction" Padding="8,2" Visibility="{Binding IsActionButton2Visibile, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Converter={StaticResource boolTovisibility}}" />\r
+\r
+ <Button Content="{Binding ActionText, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Margin="0,10,0,0"\r
+ x:Name="StatusActionButton" Click="StatusActionButton_OnClick" Padding="8,2"\r
+ Visibility="{Binding IsActionButtonVisible, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Converter={StaticResource boolTovisibility}}" />\r
+\r
+ </StackPanel>\r
\r
</StackPanel>\r
</StackPanel>\r
this.Message = "Message";\r
}\r
\r
- /// <summary>\r
- /// Dependancy Property for the IsLoading Property\r
- /// </summary>\r
public static readonly DependencyProperty IsLoadingProperty =\r
DependencyProperty.Register("IsLoading", typeof(bool), typeof(StatusPanel), new UIPropertyMetadata(false));\r
\r
- /// <summary>\r
- /// Dependancy Property for the Message Property\r
- /// </summary>\r
public static readonly DependencyProperty MessageProperty =\r
DependencyProperty.Register("Message", typeof(string), typeof(StatusPanel), new UIPropertyMetadata("Loading..."));\r
\r
- /// <summary>\r
- /// Dependancy Property for the submessage propery\r
- /// </summary>\r
public static readonly DependencyProperty SubMessageProperty =\r
DependencyProperty.Register("SubMessage", typeof(string), typeof(StatusPanel), new FrameworkPropertyMetadata("Please Wait", FrameworkPropertyMetadataOptions.AffectsRender));\r
\r
- /// <summary>\r
- /// Dependancy Property for the submessage propery\r
- /// </summary>\r
public static readonly DependencyProperty ActionProperty =\r
DependencyProperty.Register("CancelAction", typeof(Action), typeof(StatusPanel), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.None, OnCancelActionSet));\r
\r
- /// <summary>\r
- /// Dependancy Property for the submessage propery\r
- /// </summary>\r
+ public static readonly DependencyProperty SecondaryActionProperty =\r
+ DependencyProperty.Register("SecondaryAction", typeof(Action), typeof(StatusPanel), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.None, OnSecondaryActionSet));\r
+\r
public static readonly DependencyProperty ActionTextProperty =\r
DependencyProperty.Register("ActionText", typeof(string), typeof(StatusPanel), new UIPropertyMetadata("Cancel"));\r
\r
+ public static readonly DependencyProperty SecondaryActionTextProperty =\r
+ DependencyProperty.Register("SecondaryActionText", typeof(string), typeof(StatusPanel), new UIPropertyMetadata("Open Log Window"));\r
+\r
/// <summary>\r
/// Gets or sets a value indicating whether IsLoading.\r
/// </summary>\r
public Action CancelAction\r
{\r
get { return (Action)GetValue(ActionProperty); }\r
- set { SetValue(SubMessageProperty, value); }\r
+ set { SetValue(ActionProperty, value); }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets or sets the cancel action.\r
+ /// </summary>\r
+ public Action SecondaryAction\r
+ {\r
+ get { return (Action)GetValue(SecondaryActionProperty); }\r
+ set { SetValue(SecondaryActionProperty, value); }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets or sets SecondaryActionText.\r
+ /// </summary>\r
+ public string SecondaryActionText\r
+ {\r
+ get { return (string)GetValue(SecondaryActionTextProperty); }\r
+ set { SetValue(SecondaryActionTextProperty, value); }\r
}\r
\r
/// <summary>\r
{\r
}\r
\r
+ /// <summary>\r
+ /// The on Secondary Action Set.\r
+ /// </summary>\r
+ /// <param name="d">\r
+ /// The d.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
+ private static void OnSecondaryActionSet(DependencyObject d, DependencyPropertyChangedEventArgs e)\r
+ {\r
+ }\r
+\r
/// <summary>\r
/// Gets or sets the action text.\r
/// </summary>\r
}\r
}\r
\r
+ /// <summary>\r
+ /// \r
+ /// </summary>\r
+ public bool IsActionButton2Visibile\r
+ {\r
+ get\r
+ {\r
+ return true; //SecondaryAction != null;\r
+ }\r
+ }\r
+\r
/// <summary>\r
/// The status action button_ on click.\r
/// </summary>\r
this.CancelAction();\r
}\r
}\r
+\r
+ private void PerformSecondaryAction(object sender, RoutedEventArgs e)\r
+ {\r
+ if (this.SecondaryAction != null)\r
+ {\r
+ this.SecondaryAction();\r
+ }\r
+ }\r
}\r
}\r