<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:local="clr-namespace:Hiyoko.Forms">
	<local:Int32ToSolidColorBrushConverter x:Key="Int32ToSolidColorBrushConverter" />
	<local:DateTimeToStringConverter x:Key="DateTimeToStringConverter" />
	<local:RemoveHtmlTagsConverter x:Key="RemoveHtmlTagsConverter" />
	<local:OutputItemToImageSourceConverter x:Key="OutputItemToImageSourceConverter" />
	<local:UrlToImageSourceConverter x:Key="UrlToImageSourceConverter" />
	<local:TextToMarkupTextConverter x:Key="TextToMarkupTextConverter" />
	<local:CommandToInputGestureTextConverter x:Key="CommandToInputGestureTextConverter" />
	<local:ExtractUriConverter x:Key="ExtractUriConverter" />
	<local:ExpandUrlsConverter x:Key="StatusTextExpandUrlsConverter" />
	<local:ObjectOrDefaultConverter x:Key="ObjectOrDefaultConverter" />
	<local:TwitterUserToUserHomeUriConverter x:Key="TwitterUserToUserHomeUriConverter" />
	<local:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
	<local:StringIsNullOrEmptyConverter x:Key="StringIsNullOrEmptyConverter" />
	<local:IsNullConverter x:Key="IsNullConverter" />
	
	<BitmapImage x:Key="PostIcon" UriSource="/Resources/Post.png" />
	<SolidColorBrush x:Key="WindowBrush" Color="{StaticResource {x:Static SystemColors.WindowColorKey}}" />
	<SolidColorBrush x:Key="ControlBrush" Color="{StaticResource {x:Static SystemColors.ControlColorKey}}" />
	<SolidColorBrush x:Key="ControlDarkBrush" Color="{StaticResource {x:Static SystemColors.ControlColorKey}}" />
	<SolidColorBrush x:Key="ControlTextBrush" Color="{StaticResource {x:Static SystemColors.ControlTextColorKey}}" />
	
	<DataTemplate x:Key="TwitterStatusDataTemplate">
		<local:TwitterStatusViewer Name="Item" Width="480" />
		<DataTemplate.Triggers>
			<DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}}" Value="true">
				<Setter TargetName="Item" Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
			</DataTrigger>
		</DataTemplate.Triggers>
	</DataTemplate>  
	
	<Style TargetType="TextBlock">
		<Setter Property="TextWrapping" Value="Wrap" />
	</Style>
	
	<DataTemplate x:Key="TwitterUserDataTemplate">
		<UserControl Name="Item">
			<Border Margin="4" Padding="4" BorderThickness="1" CornerRadius="4"
				BorderBrush="{Binding Path=ProfileSidebarBorderColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}"
				Background="{Binding Path=ProfileBackgroundColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}">
				<Grid>
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="auto" />
						<ColumnDefinition Width="*" />
					</Grid.ColumnDefinitions>
					<Image Grid.Column="0" Width="47" Height="47" Margin="0,0,4,0" Source="{Binding Path=ProfileImageUrl, Converter={StaticResource UrlToImageSourceConverter}}" />
					<Grid Grid.Column="1" Background="#eeffffff">
						<Grid.RowDefinitions>
							<RowDefinition Height="auto" />
							<RowDefinition Height="auto" />
							<RowDefinition Height="auto" />
						</Grid.RowDefinitions>
						<Grid Grid.Row="0">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="auto" />
								<ColumnDefinition Width="auto" />
								<ColumnDefinition Width="*" />
								<ColumnDefinition Width="auto" />
								<ColumnDefinition Width="auto" />
							</Grid.ColumnDefinitions>
							<local:LinkText Grid.Column="0" Margin="2" FontWeight="UltraBold" Text="{Binding Path=Name, Mode=OneWay}"
								OpenUri="{Binding Converter={StaticResource TwitterUserToUserHomeUriConverter}}"
								Foreground="{Binding Path=ProfileLinkColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}"
								Background="#00000000" />
							<TextBlock Grid.Column="1" Margin="4,2,4,2" Text="/"
								Foreground="{Binding Path=ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}" />
							<TextBlock Grid.Column="2" Margin="2" Text="{Binding Path=ScreenName, Mode=OneWay}"
								Foreground="{Binding Path=ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}"
								Background="#00000000" />
							<TextBlock Grid.Column="3" Margin="2" Text="{Binding Path=Location, Mode=OneWay}"
								Foreground="{Binding Path=ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}"
								Background="#00000000" />
							<TextBlock Grid.Column="4" Margin="2" Text="{Binding Path=CreatedAt, Mode=OneWay, Converter={StaticResource DateTimeToStringConverter}}"
								Foreground="{Binding Path=ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}"
								Background="#00000000" />
						</Grid>
						<TextBlock Grid.Row="1" Margin="2" Text="{Binding Path=Description}" />
						<Grid Grid.Row="2" Margin="2">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="auto" />
								<ColumnDefinition Width="auto" />
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
							</Grid.RowDefinitions>
							<TextBlock Grid.Row="0" Grid.Column="0" Text="サイト"
								Foreground="{Binding Path=ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}" />
							<local:LinkText Grid.Row="0" Grid.Column="1" Text="{Binding Path=Url, Mode=OneWay}" OpenUri="{Binding Path=Url}"
								Foreground="{Binding Path=ProfileLinkColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}" />
							<TextBlock Grid.Row="1" Grid.Column="0" Text="フレンド数"
								Foreground="{Binding Path=ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}" />
							<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Path=FriendsCount}"
								Foreground="{Binding Path=ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}" />
							<TextBlock Grid.Row="2" Grid.Column="0" Text="フォロワー数"
								Foreground="{Binding Path=ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}" />
							<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Path=FollowersCount}"
								Foreground="{Binding Path=ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}" />
							<TextBlock Grid.Row="3" Grid.Column="0" Text="お気に入り数"
								Foreground="{Binding Path=ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}" />
							<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding Path=FavouritesCount}"
								Foreground="{Binding Path=ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}" />
							<TextBlock Grid.Row="4" Grid.Column="0" Text="ステータス数"
								Foreground="{Binding Path=ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}" />
							<TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding Path=StatusesCount}"
								Foreground="{Binding Path=ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}" />
							<TextBlock Grid.Row="5" Grid.Column="0" Text="タイムゾーン"
								Foreground="{Binding Path=ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}" />
							<TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding Path=TimeZone}"
								Foreground="{Binding Path=ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}" />
						</Grid>
					</Grid>
				</Grid>
			</Border>
		</UserControl>
		<DataTemplate.Triggers>
			<DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}}" Value="true">
				<Setter TargetName="Item" Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
			</DataTrigger>
		</DataTemplate.Triggers>
	</DataTemplate>  
</ResourceDictionary>
