<UserControl x:Class="Hiyoko.Forms.TwitterStatusViewer" x:Name="this"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:local="clr-namespace:Hiyoko.Forms">
	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="/Hiyoko;component/forms/generic.xaml" />
			</ResourceDictionary.MergedDictionaries>
			
			<local:Int32ToSolidColorBrushConverter x:Key="Int32ToSolidColorBrushConverter" />
			<SolidColorBrush x:Key="TwitterStatusViewerStatusBackground" Color="#80ffffff" />
		</ResourceDictionary>
	</UserControl.Resources>
	<Border Margin="4" Padding="4" BorderThickness="1" CornerRadius="4"
		BorderBrush="{Binding ElementName=this, Path=Status.User.ProfileSidebarBorderColor, Converter={StaticResource Int32ToSolidColorBrushConverter},
			ConverterParameter='128'}"
		Background="{Binding ElementName=this, Path=Status.User.ProfileBackgroundColor, Converter={StaticResource Int32ToSolidColorBrushConverter},
			ConverterParameter='128'}">
		<Grid>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="auto" />
				<ColumnDefinition Width="*" />
			</Grid.ColumnDefinitions>
			<Image Width="48" Height="48" Margin="0,0,4,0"
				Source="{Binding ElementName=this, Path=Status.User.ProfileImageUrl, Converter={StaticResource UrlToImageSourceConverter}}" />
			<Grid Grid.Column="1" Background="{DynamicResource TwitterStatusViewerStatusBackground}">
				<Grid.RowDefinitions>
					<RowDefinition Height="auto" />
					<RowDefinition Height="auto" />
					<RowDefinition Height="auto" />
				</Grid.RowDefinitions>
				<Grid Grid.Row="0">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="auto" />
						<ColumnDefinition Width="*" />
					</Grid.ColumnDefinitions>
					<StackPanel Orientation="Horizontal" Grid.Column="0">
						<local:LinkText Margin="2" FontWeight="UltraBold" Text="{Binding ElementName=this, Path=Status.User.Name, Mode=OneWay}"
							OpenUri="{Binding ElementName=this, Path=Status.User, Converter={StaticResource TwitterUserToUserHomeUriConverter}}"
							Foreground="{Binding ElementName=this, Path=Status.User.ProfileLinkColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}"
							Background="#00000000" TextDecorations="None"
							TextTrimming="CharacterEllipsis" />
						<TextBlock Margin="4,2,4,2" Text="/"
							Foreground="{Binding ElementName=this, Path=Status.User.ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}" 
							TextTrimming="CharacterEllipsis"/>
						<TextBlock Margin="2" Text="{Binding ElementName=this, Path=Status.User.ScreenName, Mode=OneWay}"
							Foreground="{Binding ElementName=this, Path=Status.User.ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}"
							Background="#00000000" TextTrimming="CharacterEllipsis" />
					</StackPanel>
					<StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right">
						<TextBlock Margin="2" Text="{Binding ElementName=this, Path=Status.User.Location, Mode=OneWay}"
							Foreground="{Binding ElementName=this, Path=Status.User.ProfileTextColor, Converter={StaticResource  Int32ToSolidColorBrushConverter}}"
							Background="#00000000" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" HorizontalAlignment="Right"/>
						<TextBlock Margin="2" Text="{Binding ElementName=this, Path=Status.CreatedAt, Mode=OneWay, Converter={StaticResource DateTimeToStringConverter}}"
							Foreground="{Binding ElementName=this, Path=Status.User.ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}"
							Background="#00000000" TextTrimming="CharacterEllipsis" />
					</StackPanel>
				</Grid>
				<TextBlock x:Name="textBlock" Grid.Row="1" Margin="2" TextWrapping="Wrap"
					Foreground="{Binding ElementName=this, Path=Status.User.ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}" Background="#00000000">
					<TextBlock.Resources>
						<ResourceDictionary>
							<Style TargetType="Hyperlink">
								<Setter Property="Foreground"
									Value="{Binding ElementName=this, Path=Status.User.ProfileLinkColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}" />
							</Style>
						</ResourceDictionary>
					</TextBlock.Resources>
				</TextBlock>
				<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
					<!--<local:LinkText OpenUri="{Binding ElementName=this, Converter={StaticResource StatusToUrlConverter}}" 
						Text="{Binding ElementName=this, Path=Status.CreatedAt, Converter={StaticResource DateTimeToAgoStringConverter}}" 
						Foreground="{Binding ElementName=this, Path=Status.User.ProfileLinkColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}"
						TextDecorations="None" />-->
					<TextBlock Text="from "
						Foreground="{Binding ElementName=this, Path=Status.User.ProfileTextColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}" />
					<local:LinkText OpenUri="{Binding ElementName=this, Path=Status.Source, Converter={StaticResource ExtractUriConverter}}" 
						Text="{Binding ElementName=this, Path=Status.Source, Converter={StaticResource RemoveHtmlTagsConverter}}" 
						Foreground="{Binding ElementName=this, Path=Status.User.ProfileLinkColor, Converter={StaticResource Int32ToSolidColorBrushConverter}}"
						TextDecorations="None" />
				</StackPanel>
				<StackPanel Grid.Row="3" Name="inlineImagePanel" Orientation="Horizontal">
				</StackPanel>
			</Grid>
		</Grid>
	</Border>
</UserControl>