|
<Window x:Class="RSSMVVM_CS6.MainWindow" |
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
xmlns:local="clr-namespace:RSSMVVM_CS6" |
|
Title="RSS Reader ( C# 6.0版 )" Height="480" Width="640"> |
|
<Window.DataContext> |
|
<local:RSSViewModel x:Name="rssViewModel" |
|
Url="http://chronoir.net/feed/" |
|
GetRSSCompleted="rssViewModel_GetRSSCompleted"/> |
|
</Window.DataContext> |
|
<Grid> |
|
<Grid.RowDefinitions> |
|
<RowDefinition Height="Auto"/> |
|
<RowDefinition Height="*"/> |
|
<RowDefinition Height="Auto"/> |
|
</Grid.RowDefinitions> |
|
|
|
<!-- RSSフィードの配信元情報を表示します --> |
|
<StackPanel Grid.Row="0" Background="Black"> |
|
<TextBlock Text="{Binding Title, TargetNullValue=No RSS Feed}" |
|
FontSize="14" Foreground="Lime" Padding="10, 5"/> |
|
<TextBlock Text="{Binding Description}" |
|
Foreground="White" Padding="10, 5"/> |
|
<TextBlock Text="{Binding LastUpdatedTime, StringFormat=最終更新日 : yyyy年MM月dd日 HH:mm:dd, ConverterCulture=ja-JP}" |
|
Foreground="Yellow" Padding="10, 5"/> |
|
</StackPanel> |
|
|
|
<!-- RSSフィードのコンテンツを表示します --> |
|
<ListBox x:Name="RSSListBox" |
|
Grid.Row="1" |
|
ItemsSource="{Binding Items}" |
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled" |
|
Background="Black" |
|
MouseDoubleClick="RSSListBox_MouseDoubleClick"> |
|
<ListBox.ItemTemplate> |
|
<DataTemplate> |
|
<StackPanel> |
|
<TextBlock Text="{Binding Title}" FontSize="14" |
|
TextWrapping="Wrap" Foreground="Lime" Padding="5,3,5,1"/> |
|
<TextBlock Text="{Binding PubDate, StringFormat=投稿日 : yyyy年MM月dd日 HH:mm:dd, ConverterCulture=ja-JP}" |
|
TextWrapping="Wrap" Foreground="Yellow" Padding="5,1,5,2"/> |
|
<TextBlock Text="{Binding Summary}" |
|
TextWrapping="Wrap" Foreground="White" Padding="5,1,5,3"/> |
|
</StackPanel> |
|
</DataTemplate> |
|
</ListBox.ItemTemplate> |
|
</ListBox> |
|
|
|
<Grid Grid.Row="2"> |
|
<Grid.ColumnDefinitions> |
|
<ColumnDefinition Width="*"/> |
|
<ColumnDefinition Width="Auto"/> |
|
</Grid.ColumnDefinitions> |
|
|
|
<!-- URL入力ボックスと「更新」ボタンです --> |
|
<TextBox Grid.Column="0" Text="{Binding Url}" |
|
Background="Black" Foreground="White"/> |
|
<Button Grid.Column="1" HorizontalAlignment="Right" |
|
Content="更新" Command="{Binding GetRSS}"/> |
|
</Grid> |
|
</Grid> |
|
</Window> |