Inbox development 1
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
<Page
|
||||
x:Class="FoxTube.Pages.Inbox"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:FoxTube.Pages"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
|
||||
mc:Ignorable="d"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ScrollViewer>
|
||||
<StackPanel VerticalAlignment="Stretch" Background="#FFF2F2F2">
|
||||
<ComboBox Header="Filter" Margin="10" HorizontalAlignment="Stretch" SelectedIndex="0">
|
||||
<ComboBoxItem Content="All"/>
|
||||
<ComboBoxItem Content="Messages"/>
|
||||
<ComboBoxItem Content="Patch notes"/>
|
||||
</ComboBox>
|
||||
<ListBox>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ListBoxItem Padding="10" HorizontalContentAlignment="Stretch">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Margin="0,0,10,0">
|
||||
<Ellipse Fill="Red" Height="40" Width="40"/>
|
||||
<TextBlock Foreground="White" FontFamily="Segoe MDL2 Assets" Text="{Binding Path=Icon}" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Light" FontSize="17"/>
|
||||
</Grid>
|
||||
<StackPanel Grid.Column="1">
|
||||
<TextBlock FontWeight="Bold" Text="{Binding Path=Title}"/>
|
||||
<TextBlock Foreground="Gray" Text="{Binding Path=Subtitle}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Foreground="Gray" FontSize="13" Text="{Binding Path=Timestamp}" Grid.Column="2"/>
|
||||
</Grid>
|
||||
</ListBoxItem>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
<ListBoxItem Padding="10" HorizontalContentAlignment="Stretch">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<PersonPicture Height="40" Initials="" FontFamily="Segoe MDL2 Assets" Background="Red" Margin="0,0,10,0"/>
|
||||
<StackPanel Grid.Column="1">
|
||||
<TextBlock FontWeight="Bold" Text="What's new in v1.01"/>
|
||||
<TextBlock Foreground="Gray" Text="Patch note"/>
|
||||
</StackPanel>
|
||||
<TextBlock Foreground="Gray" FontSize="13" Text="11:00 PM" Grid.Column="2"/>
|
||||
</Grid>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Padding="10" HorizontalContentAlignment="Stretch">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<PersonPicture Height="40" Initials="" FontFamily="Segoe MDL2 Assets" Background="Red" Margin="0,0,10,0"/>
|
||||
<StackPanel Grid.Column="1">
|
||||
<TextBlock FontWeight="Bold" Text="Hello, World! We went live!"/>
|
||||
<TextBlock Foreground="Gray" Text="Developer's message"/>
|
||||
</StackPanel>
|
||||
<TextBlock Foreground="Gray" FontSize="13" Text="11:00 PM" Grid.Column="2"/>
|
||||
</Grid>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Padding="10" HorizontalContentAlignment="Stretch">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Margin="0,0,10,0">
|
||||
<Ellipse Fill="Red" Height="40" Width="40"/>
|
||||
<TextBlock Foreground="White" FontFamily="Segoe MDL2 Assets" Text="" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Light" FontSize="17"/>
|
||||
</Grid>
|
||||
<StackPanel Grid.Column="1">
|
||||
<TextBlock FontWeight="Bold" Text="Hello, World! We went live!"/>
|
||||
<TextBlock Foreground="Gray" Text="Developer's message"/>
|
||||
</StackPanel>
|
||||
<TextBlock Foreground="Gray" FontSize="13" Text="11:00 PM" Grid.Column="2"/>
|
||||
</Grid>
|
||||
</ListBoxItem>
|
||||
</ListBox>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<ScrollViewer Grid.Column="1">
|
||||
<StackPanel Margin="10">
|
||||
<TextBlock FontWeight="Bold" Text="Hello, World!" FontSize="26"/>
|
||||
<controls:MarkdownTextBlock IsTextSelectionEnabled="True" Text="Content"/>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Controls.Primitives;
|
||||
using Windows.UI.Xaml.Data;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using FoxTube.Classes;
|
||||
using System.Xml;
|
||||
|
||||
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
|
||||
|
||||
namespace FoxTube.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class Inbox : Page
|
||||
{
|
||||
List<InboxItem> items = new List<InboxItem>();
|
||||
public Inbox()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
LoadItems();
|
||||
}
|
||||
|
||||
public void LoadItems()
|
||||
{
|
||||
XmlDocument doc = new XmlDocument();
|
||||
|
||||
doc.Load("ms-appx:///Assets/Data/Patchnotes.xml");
|
||||
foreach (XmlElement e in doc["items"].ChildNodes)
|
||||
items.Add(new InboxItem(
|
||||
e.GetAttribute("version"),
|
||||
e["content"].InnerText,
|
||||
e.GetAttribute("time")
|
||||
));
|
||||
|
||||
doc.Load("http://foxgame.hol.es/ftp.xml");
|
||||
foreach (XmlElement e in doc["items"].ChildNodes)
|
||||
items.Add(new InboxItem(
|
||||
e["header"].InnerText,
|
||||
e["content"].InnerText,
|
||||
XmlConvert.ToDateTime(e.GetAttribute("time"), XmlDateTimeSerializationMode.Unspecified)
|
||||
));
|
||||
|
||||
items.Sort();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user