add resultpage

This commit is contained in:
stubbfel
2013-06-10 18:46:39 +02:00
parent 29bc862035
commit faa5dc7440
9 changed files with 91 additions and 72 deletions

View File

@@ -122,8 +122,11 @@
<Compile Include="Model\BaseModel.cs" />
<Compile Include="Model\BaseViewModel.cs" />
<Compile Include="Feed\Mensa\MensaFeed.cs" />
<Compile Include="Pages\Lecture\Results.xaml.cs">
<DependentUpon>Results.xaml</DependentUpon>
<Compile Include="Pages\Lecture\ModulWebPage.xaml.cs">
<DependentUpon>ModulWebPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\Lecture\ResultPage.xaml.cs">
<DependentUpon>ResultPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\Mensa\MensaPage.xaml.cs">
<DependentUpon>MensaPage.xaml</DependentUpon>
@@ -179,7 +182,11 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\Lecture\Results.xaml">
<Page Include="Pages\Lecture\ModulWebPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\Lecture\ResultPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>

View File

@@ -28,7 +28,7 @@ namespace CampusAppWP8.Model.Lecture
[XmlArray("veranstaltungsliste")]
[XmlArrayItem("veranstaltung")]
public ObservableCollection<LectureActivity> Activity { get; set; }
public ObservableCollection<LectureActivity> Activities { get; set; }
#endregion

View File

@@ -9,26 +9,19 @@
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
mc:Ignorable="d"
shell:SystemTray.IsVisible="True">
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
<StackPanel Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="MEINE ANWENDUNG" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock Text="Seitenname" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<phone:WebBrowser x:Name="WebmailBrowser" IsScriptEnabled="True"/>
</Grid>
</Grid>

View File

@@ -7,6 +7,7 @@ using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System.Threading.Tasks;
namespace CampusAppWP8.Pages.Lecture
{
@@ -16,5 +17,17 @@ namespace CampusAppWP8.Pages.Lecture
{
InitializeComponent();
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
if (NavigationContext.QueryString.ContainsKey("URL"))
{
string url = NavigationContext.QueryString["URL"];
this.WebmailBrowser.Navigate(new Uri(url, UriKind.Absolute));
}
base.OnNavigatedTo(e);
}
}
}

View File

@@ -9,10 +9,37 @@
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
mc:Ignorable="d"
shell:SystemTray.IsVisible="True">
<phone:PhoneApplicationPage.Resources>
<DataTemplate x:Key="LectureItemTemplate">
<Border Background="{x:Null}" BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,1,0,0" Padding="0,12,0,12">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Click="ShowOptions">
<TextBlock Text="{Binding Type}" Grid.Column="0" Grid.Row="0"/>
</Button>
<TextBlock Text=" : " Grid.Column="1" Grid.Row="0"/>
<TextBlock Text="{Binding Modul.Title}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="0"/>
<StackPanel Orientation="Horizontal" Grid.Column="2" Grid.Row="1" >
<Button Name="Link" Visibility="Collapsed" Content="Link" Tag="{Binding Modul.Url}" Click="ShowModulWebPage"/>
<Button Name="Details" Visibility="Collapsed" Content="Details" Tag="foo" Click="ShowDetailPage"/>
</StackPanel>
</Grid>
</Border>
</DataTemplate>
</phone:PhoneApplicationPage.Resources>
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
@@ -28,9 +55,10 @@
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<ScrollViewer>
<phone:LongListSelector Name="ResultList"/>
<phone:LongListSelector Name="ResultList" ItemTemplate="{StaticResource LectureItemTemplate}" HorizontalContentAlignment="Left" />
</ScrollViewer>
</Grid>
</Grid>
</phone:PhoneApplicationPage>
</phone:PhoneApplicationPage>

View File

@@ -17,7 +17,7 @@ namespace CampusAppWP8.Pages.Lecture
public Results()
{
InitializeComponent();
this.feed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(this.FeedIsReady);
feed.LoadFeed();
}
@@ -29,5 +29,37 @@ namespace CampusAppWP8.Pages.Lecture
{
ResultList.ItemsSource = feed.Model.Activities;
}
private void ShowOptions(object sender, RoutedEventArgs e)
{
Button btn = (Button)sender;
Grid test = (Grid)btn.Parent;
Button link = (Button)test.FindName("Link");
Button details = (Button)test.FindName("Details");
this.ToogleVisibility(link);
this.ToogleVisibility(details);
}
private void ToogleVisibility(UIElement element)
{
if (System.Windows.Visibility.Visible.Equals(element.Visibility))
{
element.Visibility = System.Windows.Visibility.Collapsed;
}
else
{
element.Visibility = System.Windows.Visibility.Visible;
}
}
private void ShowModulWebPage(object sender, RoutedEventArgs e)
{
Button btn = (Button)sender;
NavigationService.Navigate(new Uri("/Pages/Lecture/ModulWebPage.xaml?URL="+btn.Tag, UriKind.Relative));
}
private void ShowDetailPage(object sender, RoutedEventArgs e)
{
}
}
}

View File

@@ -1,34 +0,0 @@
<phone:PhoneApplicationPage
x:Class="CampusAppWP8.Pages.Lecture.Results"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
mc:Ignorable="d"
shell:SystemTray.IsVisible="True">
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
<StackPanel Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_Title, Source={StaticResource LocalizedStrings}}"/>
</StackPanel>
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
</Grid>
</Grid>
</phone:PhoneApplicationPage>

View File

@@ -1,20 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
namespace CampusAppWP8.Pages.Lecture
{
public partial class Results : PhoneApplicationPage
{
public Results()
{
InitializeComponent();
}
}
}

View File

@@ -13,7 +13,7 @@
<Capability Name="ID_CAP_ISV_CAMERA" />
</Capabilities>
<Tasks>
<DefaultTask Name="_default" NavigationPage="pages/Lecture/LecturePage.xaml" />
<DefaultTask Name="_default" NavigationPage="pages/Lecture/ResultPage.xaml" />
</Tasks>
<Tokens>
<PrimaryToken TokenID="CampusAppWP8Token" TaskName="_default">