initial load
This commit is contained in:
70
YouTubeViewers.WPF/Components/YouTubeViewerDetailsForm.xaml
Normal file
70
YouTubeViewers.WPF/Components/YouTubeViewerDetailsForm.xaml
Normal file
@ -0,0 +1,70 @@
|
||||
<UserControl x:Class="YouTubeViewers.WPF.Components.YouTubeViewerDetailsForm"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:YouTubeViewers.WPF.Components"
|
||||
xmlns:custom="clr-namespace:LoadingSpinnerControl;assembly=LoadingSpinnerControl"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.IsSharedSizeScope="True">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
<Grid Grid.Row="0" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" SharedSizeGroup="Label"/>
|
||||
<ColumnDefinition Width="*" MaxWidth="250"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0" Text="Username" FontWeight="Bold" />
|
||||
<TextBox Margin="20 0 0 0"
|
||||
Grid.Column="1"
|
||||
Text="{Binding UserName, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="1" Margin="0 20 0 0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" SharedSizeGroup="Label"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0" Text="Is Subscribed?" FontWeight="Bold" />
|
||||
<CheckBox Margin="20 0 0 0"
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
IsChecked="{Binding IsSubScribed}" />
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="2" Margin="0 20 0 0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" SharedSizeGroup="Label"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0" Text="Is Member?" FontWeight="Bold" />
|
||||
<CheckBox Margin="20 0 0 0"
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
IsChecked="{Binding IsMember}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
<WrapPanel Grid.Row="1" Margin="0 30 0 0">
|
||||
<Button Margin="0 0 5 0"
|
||||
Command="{Binding SubmitCommand}"
|
||||
Content="Submit"
|
||||
IsEnabled="{Binding CanSubmit}"/>
|
||||
|
||||
<Button Margin="0 0 5 0" Command="{Binding CancelCommand}"
|
||||
Content="Cancel"
|
||||
Style="{StaticResource ButtonSecondary}"/>
|
||||
<custom:LoadingSpinner IsLoading="{Binding IsSubmitting}" Diameter="25" Thickness="2"/>
|
||||
</WrapPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
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.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace YouTubeViewers.WPF.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for YouTubeViewerDetailsForm.xaml
|
||||
/// </summary>
|
||||
public partial class YouTubeViewerDetailsForm : UserControl
|
||||
{
|
||||
public YouTubeViewerDetailsForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
73
YouTubeViewers.WPF/Components/YouTubeViewersDetails.xaml
Normal file
73
YouTubeViewers.WPF/Components/YouTubeViewersDetails.xaml
Normal file
@ -0,0 +1,73 @@
|
||||
<UserControl x:Class="YouTubeViewers.WPF.Components.YouTubeViewersDetails"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:YouTubeViewers.WPF.Components"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Border Padding="20" BorderBrush="{StaticResource BorderPrimary}"
|
||||
BorderThickness="1" CornerRadius="5"
|
||||
SnapsToDevicePixels="True">
|
||||
<Grid>
|
||||
<Grid>
|
||||
<Grid.Style>
|
||||
<Style TargetType="Grid">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding HasSelectedYouTubeViewer}" Value="false">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Grid.Style>
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="Please select a YouTube Viewer to see their details." />
|
||||
</Grid>
|
||||
<Grid Grid.IsSharedSizeScope="True">
|
||||
<Grid.Style>
|
||||
<Style TargetType="Grid">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding HasSelectedYouTubeViewer}" Value="True">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Grid.Style>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0"
|
||||
FontSize="24"
|
||||
Text="{Binding UserName}" />
|
||||
|
||||
<Grid Grid.Row="1" Margin="0 20 0 0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" SharedSizeGroup="Label"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0" Text="Is Subscribed?" FontWeight="Bold" />
|
||||
<TextBlock Margin="20 0 0 0"
|
||||
Grid.Column="1"
|
||||
Text="{Binding IsSubScribedDisplay}" />
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="2" Margin="0 20 0 0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" SharedSizeGroup="Label"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0" Text="Is Member?" FontWeight="Bold" />
|
||||
<TextBlock Margin="20 0 0 0"
|
||||
Grid.Column="1"
|
||||
Text="{Binding IsMemberDisplay}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
YouTubeViewers.WPF/Components/YouTubeViewersDetails.xaml.cs
Normal file
28
YouTubeViewers.WPF/Components/YouTubeViewersDetails.xaml.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
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.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace YouTubeViewers.WPF.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for YouTubeViewersDetails.xaml
|
||||
/// </summary>
|
||||
public partial class YouTubeViewersDetails : UserControl
|
||||
{
|
||||
public YouTubeViewersDetails()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
41
YouTubeViewers.WPF/Components/YouTubeViewersListing.xaml
Normal file
41
YouTubeViewers.WPF/Components/YouTubeViewersListing.xaml
Normal file
@ -0,0 +1,41 @@
|
||||
<UserControl x:Class="YouTubeViewers.WPF.Components.YouTubeViewersListing"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:YouTubeViewers.WPF.Components"
|
||||
xmlns:custom="clr-namespace:DropdownMenuControl;assembly=DropdownMenuControl"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Border
|
||||
BorderBrush="{StaticResource BorderPrimary}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5"
|
||||
SnapsToDevicePixels="True">
|
||||
<Grid>
|
||||
<Grid.OpacityMask>
|
||||
<VisualBrush Visual="{Binding ElementName=border}"/>
|
||||
</Grid.OpacityMask>
|
||||
<Border
|
||||
x:Name="border"
|
||||
Background="White"
|
||||
CornerRadius="5"/>
|
||||
<ListView BorderThickness="0"
|
||||
ItemsSource="{Binding YouTubeViewersListingItemViewModels}"
|
||||
SelectedItem="{Binding SelectedYouTubeViewerListingItemViewModel}">
|
||||
<ListView.ItemContainerStyle>
|
||||
<Style TargetType="ListViewItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<local:YouTubeViewersListingItem/>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
YouTubeViewers.WPF/Components/YouTubeViewersListing.xaml.cs
Normal file
28
YouTubeViewers.WPF/Components/YouTubeViewersListing.xaml.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
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.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace YouTubeViewers.WPF.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for YouTubeViewersListing.xaml
|
||||
/// </summary>
|
||||
public partial class YouTubeViewersListing : UserControl
|
||||
{
|
||||
public YouTubeViewersListing()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
80
YouTubeViewers.WPF/Components/YouTubeViewersListingItem.xaml
Normal file
80
YouTubeViewers.WPF/Components/YouTubeViewersListingItem.xaml
Normal file
@ -0,0 +1,80 @@
|
||||
<UserControl x:Class="YouTubeViewers.WPF.Components.YouTubeViewersListingItem"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:YouTubeViewers.WPF.Components"
|
||||
xmlns:custom="clr-namespace:DropdownMenuControl;assembly=DropdownMenuControl"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Border Padding="10" TextBlock.FontSize="16">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0" Text="{Binding UserName}"/>
|
||||
|
||||
<custom:DropdownMenu x:Name="dropdown" Grid.Column="1" Margin="10 0 0 0">
|
||||
<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"/>
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border
|
||||
Margin="{TemplateBinding Margin}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}">
|
||||
<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>
|
||||
</Border>
|
||||
</UserControl>
|
||||
@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
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.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace YouTubeViewers.WPF.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for YouTubeViewersListingItem.xaml
|
||||
/// </summary>
|
||||
public partial class YouTubeViewersListingItem : UserControl
|
||||
{
|
||||
public YouTubeViewersListingItem()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
dropdown.IsOpen = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user