Permalink
Please sign in to comment.
Browse files
Adding better error reporting dialogs
git-svn-id: http://firstforge.wpi.edu/svn/repos/zomb/trunk@397 0141d0df-edca-4edd-a601-3402401f7f08
- Loading branch information...
Showing
with
163 additions
and 41 deletions.
| @@ -0,0 +1,18 @@ | ||
| +<Window x:Class="System451.Communication.Dashboard.ViZ.ErrorDialog" | ||
| + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
| + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
| + Title="Kaboom!" Height="488" Width="691" xmlns:my="clr-namespace:System451.Communication.Dashboard.ViZ" Topmost="True" WindowStartupLocation="CenterScreen" SnapsToDevicePixels="True"> | ||
| + <Grid Margin="10"> | ||
| + <Grid.RowDefinitions> | ||
| + <RowDefinition Height="Auto" /> | ||
| + <RowDefinition Height="260*" /> | ||
| + <RowDefinition Height="Auto" /> | ||
| + </Grid.RowDefinitions> | ||
| + <StackPanel Grid.Row="2" Name="stackPanel1" HorizontalAlignment="Right" Orientation="Horizontal" Margin="0,5,0,0"> | ||
| + <Label Content="A copy of this report has been saved to C:\ZomB.log" Name="label1" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="5,5,10,5" /> | ||
| + <Button Content="Close" Height="23" Name="button1" Width="75" Click="button1_Click" /> | ||
| + </StackPanel> | ||
| + <Label Content="Ack! ZomB encountered an error. Please let the developers know about this." Name="label2" VerticalAlignment="Top" /> | ||
| + <TextBox Grid.Row="1" Name="textBox1" IsReadOnly="True" Text="{Binding Path=Message, RelativeSource={RelativeSource FindAncestor, AncestorType=my:ErrorDialog, AncestorLevel=1}}" Background="LightGray" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible" /> | ||
| + </Grid> | ||
| +</Window> |
| @@ -0,0 +1,41 @@ | ||
| +using System; | ||
| +using System.Collections.Generic; | ||
| +using System.Linq; | ||
| +using System.Text; | ||
| +using System.Windows; | ||
| +using System.Windows.Controls; | ||
| +using System.Windows.Data; | ||
| +using System.Windows.Documents; | ||
| +using System.Windows.Input; | ||
| +using System.Windows.Media; | ||
| +using System.Windows.Media.Imaging; | ||
| +using System.Windows.Shapes; | ||
| + | ||
| +namespace System451.Communication.Dashboard.ViZ | ||
| +{ | ||
| + /// <summary> | ||
| + /// Interaction logic for ErrorDialog.xaml | ||
| + /// </summary> | ||
| + public partial class ErrorDialog : Window | ||
| + { | ||
| + public ErrorDialog() | ||
| + { | ||
| + InitializeComponent(); | ||
| + } | ||
| + | ||
| + public string Message | ||
| + { | ||
| + get { return (string)GetValue(MessageProperty); } | ||
| + set { SetValue(MessageProperty, value); } | ||
| + } | ||
| + | ||
| + // Using a DependencyProperty as the backing store for Message. This enables animation, styling, binding, etc... | ||
| + public static readonly DependencyProperty MessageProperty = | ||
| + DependencyProperty.Register("Message", typeof(string), typeof(ErrorDialog), new UIPropertyMetadata("")); | ||
| + | ||
| + private void button1_Click(object sender, RoutedEventArgs e) | ||
| + { | ||
| + this.Close(); | ||
| + } | ||
| + } | ||
| +} |
0 comments on commit
56f6037