Merge branch 'release/r#106' into develmaster

This commit is contained in:
stubbfel
2013-07-11 16:45:41 +02:00
18 changed files with 119 additions and 178 deletions

View File

@@ -8,9 +8,16 @@
<!--Anwendungsressourcen-->
<Application.Resources>
<local:LocalizedStrings xmlns:local="clr-namespace:CampusAppWP8" x:Key="LocalizedStrings"/>
<local:ThemelizedIcons xmlns:local="clr-namespace:CampusAppWP8" x:Key="ThemelizedIcons"/>
<local:Const xmlns:local="clr-namespace:CampusAppWP8" x:Key="Const"/>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Styles/ListButton.xaml"/>
<ResourceDictionary>
<local:LocalizedStrings xmlns:local="clr-namespace:CampusAppWP8" x:Key="LocalizedStrings"/>
<local:ThemelizedIcons xmlns:local="clr-namespace:CampusAppWP8" x:Key="ThemelizedIcons"/>
<local:Const xmlns:local="clr-namespace:CampusAppWP8" x:Key="Const"/>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
<Application.ApplicationLifetimeObjects>

View File

@@ -290,6 +290,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Styles\ListButton.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<None Include="Assets\psd\holo_optionsbuttons.psd" />
@@ -350,6 +354,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="README_FIRST.txt" />
<None Include="Resources\Icon1.ico" />
<Content Include="Toolkit.Content\ApplicationBar.Cancel.png" />
<Content Include="Toolkit.Content\ApplicationBar.Check.png" />
<Content Include="Toolkit.Content\ApplicationBar.Delete.png" />

View File

@@ -37,6 +37,11 @@ namespace CampusAppWP8.Model.events_news
if (value != this.item)
{
this.item = value;
int i = 0;
foreach (RSSModel rssItem in this.item)
{
rssItem.Index = i++;
}
NotifyPropertyChanged("item");
}
}

View File

@@ -108,6 +108,11 @@ namespace CampusAppWP8.Model.events_news
get { return String.Format("{0:h:mm} Uhr", this.timestamp); }
}
/// <summary>
/// Gets or sets the ListIndex
/// </summary>
public int Index { get; set; }
/// <summary>
/// Set/Get the link/url of the feed.
/// </summary>

View File

@@ -6,6 +6,7 @@
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"
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
@@ -26,7 +27,20 @@
<TextBlock Text="{Binding Path=LocalizedResources.EventApp_Title, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!-- Content -->
<ListBox x:Name="ButtonPanel" Grid.Row="1">
<ListBox x:Name="EventList" Grid.Row="1">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<lui:NavigateButton Name="EventItem" QuerryStringValue="{Binding Index}" Url="{Binding Path=Constants.PathEvent_EventPage, Source={StaticResource Const}}" QuerryStringName="{Binding Path=Constants.ParamPivotIndex, Source={StaticResource Const}}" Style="{StaticResource ListButtonStyle}">
<TextBlock TextWrapping="Wrap" Text="{Binding Title}" />
</lui:NavigateButton>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</phone:PhoneApplicationPage>

View File

@@ -7,18 +7,12 @@
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Pages.Events
{
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using CampusAppWP8.Api.Events;
using CampusAppWP8.Model.events_news;
using CampusAppWP8.Utility;
using Microsoft.Phone.Controls;
/// <summary>
/// Overview page of all events.
/// </summary>
@@ -59,37 +53,13 @@ namespace CampusAppWP8.Pages.Events
}
/// <summary>
/// Is called after the RSS feeds are loaded into the eventFeed model.
/// Is called after the RSS feeds are loaded into the newsFeed model.
/// If there was no feed information set to the UI, the feed list
/// will be sorted by timestamp and the buttons will be created.
/// </summary>
private void SetupEventPageList()
{
if ((EventIndexPage.eventFeed.Model != null)
&& (EventIndexPage.eventFeed.Model.Channel != null)
&& (EventIndexPage.eventFeed.Model.Channel.Count() >= 1)
&& (this.ButtonPanel.Items.Count() == 0))
{
// Sort the list of rssfeeds.
IEnumerable<RSSModel> tempList = EventIndexPage.eventFeed.Model.Channel[0].item.OrderByDescending(e => e.DTTimestamp);
EventIndexPage.eventFeed.Model.Channel[0].item = new ObservableCollection<RSSModel>(tempList);
// Create the buttons for the fees selection and add it to the buttonpanel.
for (int i = 0; i < EventIndexPage.eventFeed.Model.Channel[0].item.Count(); i++)
{
Button tempBtn = new Button();
tempBtn.Name = "EventRowAppButton";
tempBtn.Content = EventIndexPage.eventFeed.Model.Channel[0].item[i].Title;
tempBtn.VerticalContentAlignment = VerticalAlignment.Stretch;
tempBtn.HorizontalContentAlignment = HorizontalAlignment.Stretch;
tempBtn.BorderThickness = new Thickness(0.0);
tempBtn.Padding = new Thickness(0.0);
tempBtn.Click += this.EventRowAppButton_Click;
tempBtn.Tag = i;
this.ButtonPanel.Items.Add(tempBtn);
}
}
this.EventList.ItemsSource = EventIndexPage.eventFeed.Model.Channel[0].Item;
}
/// <summary>
@@ -99,19 +69,5 @@ namespace CampusAppWP8.Pages.Events
{
get { return EventIndexPage.eventFeed; }
}
/// <summary>
/// Is called on clicking on a feed button.
/// Navigates to the event pivot page with the information of the
/// selected feed index.
/// </summary>
/// <param name="sender">pressed button object</param>
/// <param name="e">event args</param>
private void EventRowAppButton_Click(object sender, RoutedEventArgs e)
{
FrameworkElement tempElem = sender as FrameworkElement;
NavigationService.Navigate(new Uri("/pages/events/EventPage.xaml?pivotindex=" + tempElem.Tag, UriKind.Relative));
}
}
}

View File

@@ -36,7 +36,7 @@
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<Button Click="ToggleOptions" Background="Gray" BorderBrush="Gray" Foreground="Black" Margin="-10,-10,-10,-10" >
<lui:ToggleButton ToggleContentTag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Style="{StaticResource ListButtonStyle}" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
@@ -50,10 +50,10 @@
<TextBlock Text=" : " Grid.Column="1" Grid.Row="0"/>
<TextBlock Text="{Binding Title}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="0"/>
</Grid>
</Button>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Visibility="Collapsed">
</lui:ToggleButton>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Visibility="Collapsed" Tag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}">
<lui:NavigateButton Name="Link" Url="{Binding Path=Constants.PathLecture_ModulWebPage, Source={StaticResource Const}}" QuerryStringValue="{Binding Modul.Number}" QuerryStringName="{Binding Path=Constants.ParamModelLecture_ModulNumber, Source={StaticResource Const}}">
<Image Source="{Binding Path=ThemelizedIcon.Link, Source={StaticResource ThemelizedIcons}}" Height="75"/>
<Image Source="{Binding Path=ThemelizedIcon.Link, Source={StaticResource ThemelizedIcons}}" Height="50"/>
</lui:NavigateButton>
<lui:NavigateButton Name="Details" Content="Details" Url="{Binding Path=Constants.PathLecture_ResultDetailPage, Source={StaticResource Const}}" QuerryStringValue="{Binding Id}" QuerryStringName="{Binding Path=Constants.ParamModelLecture_ActivityId, Source={StaticResource Const}}"/>
</StackPanel>

View File

@@ -21,12 +21,6 @@ namespace CampusAppWP8.Pages.Lecture
/// </summary>
public partial class ResultPage : PhoneApplicationPage
{
/// <summary>
/// last visible UI element.
/// </summary>
private UIElement lastOpenUIElem = null;
/// <summary>
/// Initializes a new instance of the <see cref="ResultPage" /> class.
/// </summary>
@@ -52,34 +46,5 @@ namespace CampusAppWP8.Pages.Lecture
this.ResultList.ItemsSource = list.Activities;
base.OnNavigatedTo(e);
}
/// <summary>
/// Method toggle the Visibility of the Link- and Details-Buttons
/// </summary>
/// <param name="sender">Caller of the function</param>
/// <param name="e">some EventArgs</param>
private void ToggleOptions(object sender, RoutedEventArgs e)
{
if (this.lastOpenUIElem != null)
{
this.lastOpenUIElem.Visibility = Visibility.Collapsed;
}
FrameworkElement btn = sender as FrameworkElement;
StackPanel parent = btn.Parent as StackPanel;
if (parent.Children.Count() >= 2)
{
if (!parent.Children[1].Equals(this.lastOpenUIElem))
{
this.lastOpenUIElem = parent.Children[1];
this.lastOpenUIElem.Visibility = Visibility.Visible;
}
else
{
this.lastOpenUIElem = null;
}
}
}
}
}

View File

@@ -31,7 +31,7 @@
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<lui:LinkButton Content="{Binding Title}" Background="Gray" BorderBrush="Gray" Foreground="Black" Margin="-10,-10,-10,-10" Url="{Binding Link}"/>
<lui:LinkButton Style="{StaticResource ListButtonStyle}" Content="{Binding Title}" Url="{Binding Link}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
@@ -50,7 +50,7 @@
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<lui:LinkButton Content="{Binding Title}" Background="Gray" BorderBrush="Gray" Foreground="Black" Margin="-10,-10,-10,-10" Url="{Binding Link}"/>
<lui:LinkButton Style="{StaticResource ListButtonStyle}" Content="{Binding Title}" Url="{Binding Link}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
@@ -58,5 +58,5 @@
</phone:PivotItem>
</phone:Pivot>
</Grid>
</phone:PhoneApplicationPage>

View File

@@ -6,6 +6,7 @@
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"
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
@@ -26,7 +27,20 @@
<TextBlock Text="{Binding Path=LocalizedResources.NewsApp_Title, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!-- Content -->
<ListBox x:Name="ButtonPanel" Grid.Row="1">
<ListBox x:Name="NewsList" Grid.Row="1">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<lui:NavigateButton Name="NewsItem" QuerryStringValue="{Binding Index}" Url="{Binding Path=Constants.PathNews_NewsPage, Source={StaticResource Const}}" QuerryStringName="{Binding Path=Constants.ParamPivotIndex, Source={StaticResource Const}}" Style="{StaticResource ListButtonStyle}">
<TextBlock TextWrapping="Wrap" Text="{Binding Title}" />
</lui:NavigateButton>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>

View File

@@ -7,15 +7,9 @@
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Pages.News
{
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using CampusAppWP8.Api.News;
using CampusAppWP8.Model.events_news;
using CampusAppWP8.Utility;
using Microsoft.Phone.Controls;
@@ -65,31 +59,7 @@ namespace CampusAppWP8.Pages.News
/// </summary>
private void SetupNewsPageList()
{
if ((NewsIndexPage.newsFeed.Model != null)
&& (NewsIndexPage.newsFeed.Model.Channel != null)
&& (NewsIndexPage.newsFeed.Model.Channel.Count() >= 1)
&& (this.ButtonPanel.Items.Count() == 0))
{
// Sort the list of rssfeeds.
IEnumerable<RSSModel> tempList = NewsIndexPage.newsFeed.Model.Channel[0].item.OrderByDescending(e => e.DTTimestamp);
NewsIndexPage.newsFeed.Model.Channel[0].item = new ObservableCollection<RSSModel>(tempList);
// Create the buttons for the fees selection and add it to the buttonpanel.
for (int i = 0; i < NewsIndexPage.newsFeed.Model.Channel[0].item.Count(); i++)
{
Button tempBtn = new Button();
tempBtn.Name = "NewsRowAppButton";
tempBtn.Content = NewsIndexPage.newsFeed.Model.Channel[0].item[i].Title;
tempBtn.VerticalContentAlignment = VerticalAlignment.Stretch;
tempBtn.HorizontalContentAlignment = HorizontalAlignment.Stretch;
tempBtn.BorderThickness = new Thickness(0.0);
tempBtn.Padding = new Thickness(0.0);
tempBtn.Click += this.NewsRowAppButton_Click;
tempBtn.Tag = i;
this.ButtonPanel.Items.Add(tempBtn);
}
}
this.NewsList.ItemsSource = NewsIndexPage.newsFeed.Model.Channel[0].Item;
}
/// <summary>
@@ -99,19 +69,5 @@ namespace CampusAppWP8.Pages.News
{
get { return NewsIndexPage.newsFeed; }
}
/// <summary>
/// Is called on clicking on a feed button.
/// Navigates to the news pivot page with the information of the
/// selected feed index.
/// </summary>
/// <param name="sender">pressed button object</param>
/// <param name="e">event args</param>
private void NewsRowAppButton_Click(object sender, RoutedEventArgs e)
{
FrameworkElement tempElem = sender as FrameworkElement;
NavigationService.Navigate(new Uri("/pages/news/NewsPage.xaml?pivotindex=" + tempElem.Tag, UriKind.Relative));
}
}
}

View File

@@ -38,8 +38,8 @@
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<Button Content="{Binding Title}" Background="Gray" BorderBrush="Gray" Foreground="Black" Margin="-10,-10,-10,-10" Click="InstitutionBtn_Click"/>
<StackPanel Visibility="Collapsed">
<lui:ToggleButton Content="{Binding Title}" ToggleContentTag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Style="{StaticResource ListButtonStyle}"/>
<StackPanel Visibility="Collapsed" Tag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}">
<Grid>
<Grid.ColumnDefinitions>
<!--day-->
@@ -95,7 +95,7 @@
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<!--building-->
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Path=LocalizedResources.Building, Source={StaticResource LocalizedStrings}}" Visibility="{Binding VisibleBuilding}" Padding="10,3,10,0"/>
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Building}" Visibility="{Binding VisibleBuilding}" HorizontalAlignment="Left" Padding="10,3,10,0"/>
@@ -112,7 +112,7 @@
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<!--mail button-->
<lui:EmailButton Grid.Column="0" EmailAddress="{Binding EMail}" BorderBrush="Transparent" Background="Transparent" Height="100" Visibility="{Binding VisibleEMail}" Padding="0" Margin="-10"/>
<!--phone button-->

View File

@@ -28,11 +28,6 @@ namespace CampusAppWP8.Pages.Openinghours
/// </summary>
private OpeninghoursFeed feed = null;
/// <summary>
/// last visible UI element.
/// </summary>
private UIElement lastOpenUIElem = null;
#endregion
#region Constructor
@@ -103,35 +98,6 @@ namespace CampusAppWP8.Pages.Openinghours
this.InstitutionPanel.ItemsSource = this.feed.Model.Institutions;
}
/// <summary>
/// Called on clicking on a institution.
/// </summary>
/// <param name="sender">button object</param>
/// <param name="e">event args</param>
private void InstitutionBtn_Click(object sender, RoutedEventArgs e)
{
if (this.lastOpenUIElem != null)
{
this.lastOpenUIElem.Visibility = Visibility.Collapsed;
}
FrameworkElement btn = sender as FrameworkElement;
StackPanel parent = btn.Parent as StackPanel;
parent.Children.Count();
if (parent.Children.Count() >= 2)
{
if (this.lastOpenUIElem != parent.Children[1])
{
this.lastOpenUIElem = parent.Children[1];
this.lastOpenUIElem.Visibility = Visibility.Visible;
}
else
{
this.lastOpenUIElem = null;
}
}
}
// private
#endregion
// Method

View File

@@ -39,7 +39,7 @@
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<lui:ToggleButton Content="{Binding Name}" ToggleContentTag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Background="Gray" BorderBrush="Gray" Foreground="Black" Margin="-10,-10,-10,-10"/>
<lui:ToggleButton Content="{Binding Name}" ToggleContentTag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Style="{StaticResource ListButtonStyle}"/>
<StackPanel Tag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Orientation="Horizontal" HorizontalAlignment="Center" Visibility="Collapsed">
<lui:LinkButton Height="75" Url="{Binding Url}" />
<lui:EmailButton Height="75" EmailAddress="{Binding Email}"/>

View File

@@ -177,6 +177,15 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die pivotindex ähnelt.
/// </summary>
public static string ParamPivotIndex {
get {
return ResourceManager.GetString("ParamPivotIndex", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Url ähnelt.
/// </summary>
@@ -186,6 +195,15 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/Events/EventPage.xaml ähnelt.
/// </summary>
public static string PathEvent_EventPage {
get {
return ResourceManager.GetString("PathEvent_EventPage", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/Events/EventIndexPage.xaml ähnelt.
/// </summary>
@@ -267,6 +285,15 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die /pages/news/NewsPage.xaml ähnelt.
/// </summary>
public static string PathNews_NewsPage {
get {
return ResourceManager.GetString("PathNews_NewsPage", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/Openinghours/OpeninghoursPage.xaml ähnelt.
/// </summary>

View File

@@ -216,4 +216,13 @@
<data name="ToggleContent" xml:space="preserve">
<value>ToggleContent</value>
</data>
<data name="ParamPivotIndex" xml:space="preserve">
<value>pivotindex</value>
</data>
<data name="PathNews_NewsPage" xml:space="preserve">
<value>/pages/news/NewsPage.xaml</value>
</data>
<data name="PathEvent_EventPage" xml:space="preserve">
<value>/Pages/Events/EventPage.xaml</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

@@ -0,0 +1,12 @@
<ResourceDictionary 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"
mc:Ignorable="d">
<Style x:Key="ListButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Gray"/>
<Setter Property="BorderBrush" Value="Gray"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Margin" Value="-10"/>
</Style>
</ResourceDictionary>