Application ready before dependency injction
This commit is contained in:
@ -7,10 +7,14 @@
|
||||
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>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.IsSharedSizeScope="True">
|
||||
<Grid.RowDefinitions>
|
||||
@ -66,5 +70,12 @@
|
||||
Style="{StaticResource ButtonSecondary}"/>
|
||||
<custom:LoadingSpinner IsLoading="{Binding IsSubmitting}" Diameter="25" Thickness="2"/>
|
||||
</WrapPanel>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
Margin="0 15 0 0"
|
||||
Style="{StaticResource ErrorMessage}"
|
||||
Text="{Binding ErrorMessage}"
|
||||
Visibility="{Binding HasErrorMessage, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@ -5,76 +5,115 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:YouTubeViewers.WPF.Components"
|
||||
xmlns:custom="clr-namespace:DropdownMenuControl;assembly=DropdownMenuControl"
|
||||
xmlns:loadingspinner="clr-namespace:LoadingSpinnerControl;assembly=LoadingSpinnerControl"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||
</UserControl.Resources>
|
||||
<Border Padding="10" TextBlock.FontSize="16">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0">
|
||||
<TextBlock Text="{Binding UserName}"/>
|
||||
<TextBlock
|
||||
FontSize="10"
|
||||
Style="{StaticResource ErrorMessage}"
|
||||
Text="{Binding ErrorMessage}"
|
||||
Visibility="{Binding HasErrorMessage, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Grid.Column="0" Text="{Binding UserName}"/>
|
||||
<Grid Grid.Column="1" Margin="10 0 0 0">
|
||||
<Grid VerticalAlignment="Center">
|
||||
<Grid.Style>
|
||||
<Style TargetType="Grid">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsDeleting}" Value="true">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Grid.Style>
|
||||
<loadingspinner:LoadingSpinner Diameter="20" IsLoading="True" Thickness="2"/>
|
||||
</Grid>
|
||||
<Grid>
|
||||
<Grid.Style>
|
||||
<Style TargetType="Grid">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsDeleting}" Value="false">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Grid.Style>
|
||||
|
||||
<custom:DropdownMenu x:Name="dropdown" Grid.Column="1" Margin="10 0 0 0">
|
||||
<Border
|
||||
<custom:DropdownMenu x:Name="dropdown" >
|
||||
<Border
|
||||
Background="White"
|
||||
BorderThickness="1"
|
||||
BorderBrush="Gray">
|
||||
<StackPanel MinWidth="125">
|
||||
<StackPanel.Resources>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Background" Value="#f0f0f0"/>
|
||||
<Setter Property="Foreground" Value="Black"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="Padding" Value="20 10"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<EventSetter Event="Click" Handler="Button_Click"/>
|
||||
<StackPanel MinWidth="125">
|
||||
<StackPanel.Resources>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Background" Value="#f0f0f0"/>
|
||||
<Setter Property="Foreground" Value="Black"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="Padding" Value="20 10"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<EventSetter Event="Click" Handler="Button_Click"/>
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border
|
||||
Margin="{TemplateBinding Margin}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}">
|
||||
<ContentPresenter />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<ContentPresenter />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Trigger.EnterActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<ColorAnimation
|
||||
Storyboard.TargetProperty="Background.(SolidColorBrush.Color)"
|
||||
To="#c7c7c7"
|
||||
Duration="0:0:0.1" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.EnterActions>
|
||||
<Trigger.ExitActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<ColorAnimation
|
||||
Storyboard.TargetProperty="Background.(SolidColorBrush.Color)"
|
||||
To="#f0f0f0"
|
||||
Duration="0:0:0.1" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.ExitActions>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</StackPanel.Resources>
|
||||
<Button Content="Edit" Command="{Binding EditCommand}"/>
|
||||
<Button Content="Delete" Command="{Binding DeleteCommand}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</custom:DropdownMenu>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Trigger.EnterActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<ColorAnimation
|
||||
Storyboard.TargetProperty="Background.(SolidColorBrush.Color)"
|
||||
To="#c7c7c7"
|
||||
Duration="0:0:0.1" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.EnterActions>
|
||||
<Trigger.ExitActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<ColorAnimation
|
||||
Storyboard.TargetProperty="Background.(SolidColorBrush.Color)"
|
||||
To="#f0f0f0"
|
||||
Duration="0:0:0.1" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.ExitActions>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</StackPanel.Resources>
|
||||
<Button Content="Edit" Command="{Binding EditCommand}"/>
|
||||
<Button Content="Delete" Command="{Binding DeleteCommand}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</custom:DropdownMenu>
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
||||
|
||||
Reference in New Issue
Block a user