<UserControl x:Class="Hiyoko.Forms.MainFormUsersPanel" x:Name="this"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:c="clr-namespace:Hiyoko"
	xmlns:local="clr-namespace:Hiyoko.Forms">
	<!--- Resources -->
	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="/Hiyoko;component/forms/generic.xaml" />
			</ResourceDictionary.MergedDictionaries>
			<Style x:Key="UserListBoxStyle" TargetType="{x:Type ListBox}">
				<Setter Property="HorizontalContentAlignment" Value="Stretch" />
				<Setter Property="ItemTemplate" Value="{StaticResource TwitterUserDataTemplate}" />  
				<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
				<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
				<Setter Property="ScrollViewer.Margin" Value="0" />
				<Setter Property="ScrollViewer.Padding" Value="0" />
				<Setter Property="SelectionMode" Value="Extended" />
				<Setter Property="ItemsPanel">
					<Setter.Value>
						<ItemsPanelTemplate>
							<VirtualizingStackPanel Orientation="Vertical" />
						</ItemsPanelTemplate>
					</Setter.Value>
				</Setter>
			</Style>
		</ResourceDictionary>
	</UserControl.Resources>
	
	<!--- Command -->
	<UserControl.CommandBindings>
		<CommandBinding Command="c:HiyokoCommands.Refresh" Executed="Refresh_Executed" CanExecute="Refresh_CanExecute"/>
		<CommandBinding Command="c:HiyokoCommands.NextPage" Executed="NextPage_Executed" CanExecute="NextPage_CanExecute"/>
		<CommandBinding Command="c:HiyokoCommands.PreviousPage" Executed="PreviousPage_Executed" CanExecute="PreviousPage_CanExecute"/>
		<CommandBinding Command="c:HiyokoCommands.FirstPage" Executed="FirstPage_Executed" CanExecute="FirstPage_CanExecute"/>
		<CommandBinding Command="c:HiyokoCommands.CreateBlock" Executed="CreateBlock_Executed" CanExecute="CreateBlock_CanExecute"/>	
		<CommandBinding Command="c:HiyokoCommands.DestroyBlock" Executed="DestroyBlock_Executed" CanExecute="DestroyBlock_CanExecute"/>	
		<CommandBinding Command="c:HiyokoCommands.CreateFriendship" Executed="CreateFriendship_Executed" CanExecute="CreateFriendship_CanExecute"/>
		<CommandBinding Command="c:HiyokoCommands.DestroyFriendship" Executed="DestroyFriendship_Executed" CanExecute="DestroyFriendship_CanExecute"/>
	</UserControl.CommandBindings>
	
	<!--- Control -->
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="auto" />
			<RowDefinition Height="auto" />
			<RowDefinition Height="auto" />
			<RowDefinition Height="auto" />
			<RowDefinition Height="*" />
		</Grid.RowDefinitions>
		<Label Grid.Row="0" Target="{Binding ElementName=usersSourceComboBox}">ソース(_S)</Label>
		<ComboBox Grid.Row="1" Grid.Column="0" Name="usersSourceComboBox">
			<ComboBoxItem Name="sourceFriendsComboBoxItem" IsSelected="true">
				<TextBlock Text="フレンド" />
			</ComboBoxItem>
			<ComboBoxItem Name="sourceFollowersComboBoxItem">
				<TextBlock Text="フォロワー" />
			</ComboBoxItem>
			<ComboBoxItem Name="sourceBlocksComboBoxItem">
				<TextBlock Text="ブロック" />
			</ComboBoxItem>
			<ComboBoxItem Name="sourceUserSearchComboBoxItem">
				<TextBlock Text="ユーザー検索" />
			</ComboBoxItem>
		</ComboBox>
		<GroupBox Grid.Row="2" Visibility="{Binding ElementName=sourceUserSearchComboBoxItem, Path=IsSelected, Converter={StaticResource BooleanToVisibilityConverter}}">
			<GroupBox.Header>
				<Label Target="{Binding ElementName=searchTextBox}">検索語句(_W):</Label>
			</GroupBox.Header>
			<TextBox Grid.Row="0" Grid.Column="0" Name="searchTextBox">
				<TextBox.InputBindings>
					<KeyBinding Key="Enter" Command="c:HiyokoCommands.Refresh" />
				</TextBox.InputBindings>
			</TextBox>
		</GroupBox>
		<Grid Grid.Row="3">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="*" />
				<ColumnDefinition Width="auto" />
			</Grid.ColumnDefinitions>
			<Label Grid.Column="0" Target="{Binding ElementName=userList}">一覧(_L):</Label>
			<local:Pager Grid.Column="1" CurrentPage="{Binding Path=CurrentPage, ElementName=this}" />
		</Grid>
		<ListBox Grid.Row="4" Name="userList" ItemsSource="{Binding}" Style="{StaticResource UserListBoxStyle}" Background="#00000000" BorderThickness="0">
			<ListBox.ContextMenu>
				<ContextMenu>
					<MenuItem Header="フォローに追加(_F)"  Command="c:HiyokoCommands.CreateFriendship" />
					<MenuItem Header="フォローから削除(_L)"  Command="c:HiyokoCommands.DestroyFriendship" />
					<Separator />
					<MenuItem Header="ブロックに追加(_B)"  Command="c:HiyokoCommands.CreateBlock" />
					<MenuItem Header="ブロックから削除(_O)"  Command="c:HiyokoCommands.DestroyBlock" />
				</ContextMenu>
			</ListBox.ContextMenu>
		</ListBox>
	</Grid>
</UserControl>