implementet ErrorMessages
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
xmlns:local="clr-namespace:Apollon.WPF.Views.Components"
|
||||
xmlns:custom="clr-namespace:LoadingSpinnerControl;assembly=LoadingSpinnerControl"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="55"/>
|
||||
@@ -127,6 +130,14 @@
|
||||
HorizontalAlignment="Left"
|
||||
Background="LightGray"/>
|
||||
|
||||
<TextBlock Text="{Binding ErrorMessage}"
|
||||
Grid.Row="7"
|
||||
Grid.ColumnSpan="2"
|
||||
TextAlignment="Center"
|
||||
FontSize="14"
|
||||
Foreground="Red"
|
||||
Visibility="{Binding HasErrorMessage, Converter= {StaticResource BooleanToVisibilityConverter}}"/>
|
||||
|
||||
<Grid Grid.Row="7"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="0 30 0 0"
|
||||
|
||||
@@ -100,10 +100,31 @@
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{StaticResource BrushPrimary1}"
|
||||
Margin="0 0 0 30"
|
||||
FontSize="14">
|
||||
FontSize="14">
|
||||
</TextBlock>
|
||||
<custom:LoadingSpinner Diameter="50" IsLoading="True" Thickness="3" Color="{StaticResource BrushPrimary1}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<Grid Width="250">
|
||||
<Grid.Style>
|
||||
<Style TargetType="Grid">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding HasErrorMessage}" Value="true">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Grid.Style>
|
||||
<TextBlock Text="{Binding ErrorMessage}"
|
||||
FontSize="14"
|
||||
Foreground="Red"
|
||||
TextWrapping="WrapWithOverflow"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
TextAlignment="Center">
|
||||
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Column="2"
|
||||
@@ -116,8 +137,12 @@
|
||||
<DataTrigger Binding="{Binding IsLoading}" Value="false">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding HasErrorMessage}" Value="true">
|
||||
<Setter Property="Visibility" Value="Hidden"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
</Grid.Style>
|
||||
<StackPanel>
|
||||
<TextBlock Margin="20"
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
xmlns:custom="clr-namespace:LoadingSpinnerControl;assembly=LoadingSpinnerControl"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<StackPanel Grid.ColumnSpan="2"
|
||||
MaxWidth="300">
|
||||
@@ -51,6 +54,15 @@
|
||||
Color="{StaticResource BrushPrimary1}"
|
||||
IsLoading="{Binding IsDeleting}"/>
|
||||
</Grid>
|
||||
<TextBlock
|
||||
Text="{Binding ErrorMessage}"
|
||||
Margin="5"
|
||||
Grid.Row="7"
|
||||
Grid.ColumnSpan="2"
|
||||
TextAlignment="Center"
|
||||
FontSize="14"
|
||||
Foreground="Red"
|
||||
Visibility="{Binding HasErrorMessage, Converter= {StaticResource BooleanToVisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
Reference in New Issue
Block a user