This commit is contained in:
2024-02-23 06:55:00 -05:00
commit 277fc69c11
12 changed files with 1073 additions and 0 deletions

19
Views/TickerItemView.xaml Normal file
View File

@@ -0,0 +1,19 @@
<UserControl x:Class="Ticker.Views.TickerItemView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
x:Name="UserControl"
d:DesignWidth="640" d:DesignHeight="480" Height="39">
<Grid Height="39" Margin="2,0,2,0" >
<TextBlock Foreground="#00ABA9" Height="18" VerticalAlignment="Top" TextWrapping="NoWrap">
<Hyperlink NavigateUri="{Binding Path=FeedItem.Link}" RequestNavigate="Navigate">
<TextBlock Text="{Binding Path=FeedItem.Title}" Foreground="{Binding Path=FeedItem.ForegroundBrush}" TextWrapping="NoWrap"/>
</Hyperlink>
</TextBlock>
<TextBlock Text="{Binding Path=FeedItem.PubDate}" Margin="0,12,0,1" Foreground="#FF939393" TextWrapping="NoWrap" FontSize="10"/>
<TextBlock Text="{Binding Path=FeedItem.Source}" Margin="0,20,0,1" Foreground="#F09609" TextWrapping="NoWrap" FontSize="10" />
</Grid>
</UserControl>

View File

@@ -0,0 +1,35 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Windows.Navigation;
using Ticker.Models;
namespace Ticker.Views
{
/// <summary>
/// Interaction logic for TickerItemView.xaml
/// </summary>
public partial class TickerItemView : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private FeedItem feedItem;
public TickerItemView(FeedItem item)
{
InitializeComponent();
DataContext = this;
FeedItem = item;
}
public FeedItem FeedItem
{
get { return feedItem; }
set
{
feedItem = value;
if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("FeedItem"));
}
}
public void Navigate(object sender, RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.ToString()));
}
}
}