Text="{Binding Message, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"\r
/>\r
\r
- <TextBlock SnapsToDevicePixels="True" VerticalAlignment="Top" FontSize="12" FontFamily="Segoe UI Light" Margin="0,5" HorizontalAlignment="Left"\r
+ <TextBlock SnapsToDevicePixels="True" VerticalAlignment="Top" FontSize="14" FontFamily="Segoe UI Light" Margin="0,5" HorizontalAlignment="Left"\r
Text="{Binding SubMessage, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" \r
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
+ x:Name="StatusActionButton" Click="StatusActionButton_OnClick" Padding="8,2" HorizontalAlignment="Right" IsDefault="True"\r
Visibility="{Binding IsActionButtonVisible, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Converter={StaticResource boolTovisibility}}" />\r
\r
</StackPanel>\r
--- /dev/null
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="AlertPanel.xaml.cs" company="HandBrake Project (http://handbrake.fr)">\r
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
+// </copyright>\r
+// <summary>\r
+// Interaction logic for AlertPanel.xaml\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrakeWPF.Controls\r
+{\r
+ using System;\r
+ using System.Windows;\r
+ using System.Windows.Controls;\r
+\r
+ /// <summary>\r
+ /// Interaction logic for AlertPanel.xaml\r
+ /// </summary>\r
+ public partial class AlertPanel : UserControl\r
+ {\r
+ /// <summary>\r
+ /// Initializes a new instance of the <see cref="AlertPanel"/> class.\r
+ /// </summary>\r
+ public AlertPanel()\r
+ {\r
+ InitializeComponent();\r
+ this.Message = "Message";\r
+ }\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(AlertPanel), 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(AlertPanel), new FrameworkPropertyMetadata("Please Wait", FrameworkPropertyMetadataOptions.AffectsRender));\r
+\r
+ /// <summary>\r
+ /// Dependancy Property for the submessage propery\r
+ /// </summary>\r
+ public static readonly DependencyProperty DefaultActionProperty =\r
+ DependencyProperty.Register("DefaultAction", typeof(Action), typeof(AlertPanel), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.None, DefaultActionSet));\r
+\r
+ /// <summary>\r
+ /// Dependancy Property for the submessage propery\r
+ /// </summary>\r
+ public static readonly DependencyProperty ActionTextProperty =\r
+ DependencyProperty.Register("ActionText", typeof(string), typeof(AlertPanel), new UIPropertyMetadata("Cancel"));\r
+\r
+ /// <summary>\r
+ /// Gets or sets Message.\r
+ /// </summary>\r
+ public string Message\r
+ {\r
+ get { return (string)GetValue(MessageProperty); }\r
+ set { SetValue(MessageProperty, value); }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets or sets SubMessage.\r
+ /// </summary>\r
+ public string SubMessage\r
+ {\r
+ get { return (string)GetValue(SubMessageProperty); }\r
+ set { SetValue(SubMessageProperty, value); }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets or sets the cancel action.\r
+ /// </summary>\r
+ public Action DefaultAction\r
+ {\r
+ get { return (Action)GetValue(DefaultActionProperty); }\r
+ set { SetValue(DefaultActionProperty, value); }\r
+ }\r
+\r
+ /// <summary>\r
+ /// The on cancel 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 DefaultActionSet(DependencyObject d, DependencyPropertyChangedEventArgs e)\r
+ { \r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets or sets the action text.\r
+ /// </summary>\r
+ public string ActionText\r
+ {\r
+ get { return (string)GetValue(ActionTextProperty); }\r
+ set { SetValue(ActionTextProperty, value); }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets a value indicating whether is action button visible.\r
+ /// </summary>\r
+ public bool IsActionButtonVisible\r
+ {\r
+ get\r
+ {\r
+ return true; // this.CancelAction != null;\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// The status action button_ on click.\r
+ /// </summary>\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
+ private void StatusActionButton_OnClick(object sender, RoutedEventArgs e)\r
+ {\r
+ if (this.DefaultAction != null)\r
+ {\r
+ this.DefaultAction();\r
+ }\r
+ }\r
+ }\r
+}\r