Merge branch 'develop' of 141.43.76.143:repos/bare/win8phoneApp into develop
This commit is contained in:
@@ -168,7 +168,11 @@
|
||||
<Compile Include="Utility\AppUriMapper.cs" />
|
||||
<Compile Include="Utility\BackgroundTasks.cs" />
|
||||
<Compile Include="Utility\BoolToVisibilityConverter.cs" />
|
||||
<Compile Include="Utility\FrameworkAnimator.cs" />
|
||||
<Compile Include="Utility\ListFiller.cs" />
|
||||
<Compile Include="Utility\Lui\Button\AddButton.cs" />
|
||||
<Compile Include="Utility\Lui\Button\AddPersonButton.cs" />
|
||||
<Compile Include="Utility\Lui\Button\DelButton.cs" />
|
||||
<Compile Include="Utility\Lui\Header\DefaultHeader.xaml.cs">
|
||||
<DependentUpon>DefaultHeader.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -285,6 +289,7 @@
|
||||
<Compile Include="Pages\Dev\QRScanner.xaml.cs">
|
||||
<DependentUpon>QRScanner.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utility\PortraitLandscapePage.cs" />
|
||||
<Compile Include="Utility\Wp8StringManager.cs" />
|
||||
<Compile Include="Utility\Utilities.cs">
|
||||
<SubType>Code</SubType>
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
|
||||
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
SupportedOrientations="Portrait" Orientation="Portrait"
|
||||
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
|
||||
mc:Ignorable="d"
|
||||
shell:SystemTray.IsVisible="True">
|
||||
|
||||
@@ -25,7 +26,7 @@
|
||||
<header:DefaultHeader x:Name="DefHeader" Grid.Row="0" HeaderName="{Binding Path=LocalizedResources.Favorites, Source={StaticResource LocalizedStrings}}"/>
|
||||
|
||||
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
|
||||
<ListBox x:Name="ContentPanel" ItemsSource="{Binding Chairs}" Grid.Row="1" Margin="12,0,12,0">
|
||||
<ListBox x:Name="TheList" ItemsSource="{Binding}" Grid.Row="1" Margin="12,0,12,0">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
@@ -34,36 +35,31 @@
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<!--chair main button-->
|
||||
<Button Tag="{Binding Url}" Click="ChairTB_Click" HorizontalContentAlignment="Left" Style="{StaticResource ListButtonStyle}">
|
||||
<TextBlock Text="{Binding Name}" HorizontalAlignment="Stretch" TextWrapping="Wrap"/>
|
||||
</Button>
|
||||
<StackPanel Visibility="Collapsed">
|
||||
<!--delete button-->
|
||||
<Button BorderBrush="Transparent" Tag="{Binding Name}" Click="DeleteBtn_Click" HorizontalContentAlignment="Left">
|
||||
<Grid>
|
||||
<Border BorderBrush="{StaticResource PhoneContrastBackgroundBrush}" Style="{StaticResource ListButtonBorder}">
|
||||
<StackPanel Margin="12,0,12,0">
|
||||
<lui:ToggleButton ToggleContentTag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Style="{StaticResource ListButtonNoneBorder}" HorizontalContentAlignment="Left">
|
||||
<TextBlock Text="{Binding Name}" TextWrapping="Wrap" HorizontalAlignment="Left"/>
|
||||
</lui:ToggleButton>
|
||||
<StackPanel Visibility="Collapsed" Tag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}">
|
||||
<Grid HorizontalAlignment="Center">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="64"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Grid.Column="0" Grid.Row="0" Height="32" Width="32" Source="{Binding Path=ThemelizedIcon.Delete, Source={StaticResource ThemelizedIcons}}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
|
||||
|
||||
<lui:DelButton Grid.Column="0" Grid.Row="0" Value="{Binding Name}" Click="DeleteBtn_Click" Height="80" Margin="0" Padding="0"/>
|
||||
<TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding Path=LocalizedResources.Delete, Source={StaticResource LocalizedStrings}}" VerticalAlignment="Center"/>
|
||||
|
||||
<lui:LinkButton Grid.Column="0" Grid.Row="1" Url="{Binding Url}" Height="80" Margin="0" Padding="0"/>
|
||||
<TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding Path=LocalizedResources.Info, Source={StaticResource LocalizedStrings}}" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Button>
|
||||
<!--info button-->
|
||||
<Button x:Name="InfoBtn" BorderBrush="Transparent" Tag="{Binding Url}" Click="InfoBtn_Click" HorizontalContentAlignment="Left">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="64"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Grid.Column="0" Grid.Row="0" Height="32" Width="32" Source="{Binding Path=ThemelizedIcon.Info, Source={StaticResource ThemelizedIcons}}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
|
||||
<TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding Path=LocalizedResources.Info, Source={StaticResource LocalizedStrings}}" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
@@ -7,49 +7,35 @@
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Pages.Departments
|
||||
{
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.File.Departments;
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWPortalLib8.Model.Departments;
|
||||
using CampusAppWP8.Utility.Lui.Button;
|
||||
using Microsoft.Phone.Controls;
|
||||
using CampusAppWPortalLib8.Model.Departments;
|
||||
|
||||
/// <summary>
|
||||
/// Page to visualize the favorite department list.
|
||||
/// </summary>
|
||||
/// <summary> Page to visualize the favorite department list. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <seealso cref="T:Microsoft.Phone.Controls.PhoneApplicationPage"/>
|
||||
public partial class DepartmentFavoritePage : PhoneApplicationPage
|
||||
{
|
||||
#region Member
|
||||
|
||||
/// <summary>
|
||||
/// Object to store the last clicked chair button.
|
||||
/// </summary>
|
||||
private FrameworkElement lastClickedBtn = null;
|
||||
|
||||
/// <summary>
|
||||
/// For checking if instance is back from tombstone.
|
||||
/// </summary>
|
||||
private bool isNewInstance = false;
|
||||
|
||||
/// <summary>
|
||||
/// For checking if the source of the list is set.
|
||||
/// </summary>
|
||||
private bool isSourceSet = false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DepartmentFavoritePage" /> class.
|
||||
/// Initializes a new instance of the <see cref="DepartmentFavoritePage" /> class.
|
||||
/// </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
public DepartmentFavoritePage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
||||
this.isNewInstance = true;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -58,110 +44,58 @@ namespace CampusAppWP8.Pages.Departments
|
||||
|
||||
#region protected
|
||||
|
||||
/// <summary>
|
||||
/// On navigation to this page.
|
||||
/// Initialize the list source.
|
||||
/// </summary>
|
||||
/// <param name="e">event args</param>
|
||||
/// <summary> On navigation to this page. Initialize the list source. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Page.OnNavigatedTo(NavigationEventArgs)"/>
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
|
||||
if (this.isNewInstance)
|
||||
if ((DepartmentIndexPage.FavoriteFeed == null) || (DepartmentIndexPage.FavoriteFeed.Model == null))
|
||||
{
|
||||
if ((DepartmentIndexPage.FavoriteFile == null) || (DepartmentIndexPage.FavoriteFile.Model == null))
|
||||
{
|
||||
DepartmentModel tempModel = null;
|
||||
|
||||
if ((tempModel = App.LoadFromIsolatedStorage<DepartmentModel>(Constants.IsolatedStorage_DepartmentFavoriteModel)) != null)
|
||||
{
|
||||
if (DepartmentIndexPage.FavoriteFile == null)
|
||||
{
|
||||
DepartmentIndexPage.FavoriteFile = new DepartmentFavoriteFile(false);
|
||||
}
|
||||
|
||||
DepartmentIndexPage.FavoriteFile.Model = tempModel;
|
||||
this.isSourceSet = false;
|
||||
}
|
||||
}
|
||||
|
||||
this.isNewInstance = false;
|
||||
DepartmentIndexPage.InitFavoriteFeed(this.SetListSource);
|
||||
}
|
||||
|
||||
if (this.isSourceSet == false)
|
||||
else
|
||||
{
|
||||
this.ContentPanel.ItemsSource = DepartmentIndexPage.GetFavoriteFile().Model.Faculties[0].Chairs;
|
||||
this.isSourceSet = true;
|
||||
this.SetListSource();
|
||||
}
|
||||
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override the OnNavigatedFrom function.
|
||||
/// </summary>
|
||||
/// <param name="e">event args</param>
|
||||
/// <summary> Override the OnNavigatedFrom function. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Page.OnNavigatedFrom(NavigationEventArgs)"/>
|
||||
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedFrom(e);
|
||||
|
||||
if (e.NavigationMode != System.Windows.Navigation.NavigationMode.Back)
|
||||
{
|
||||
App.SaveToIsolatedStorage<DepartmentModel>(Constants.IsolatedStorage_DepartmentFavoriteModel, DepartmentIndexPage.FavoriteFile.Model);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// On clicking on a chair button.
|
||||
/// Open or close the chair details.
|
||||
/// </summary>
|
||||
/// <param name="sender">clicked button</param>
|
||||
/// <param name="e">event args</param>
|
||||
private void ChairTB_Click(object sender, RoutedEventArgs e)
|
||||
/// <summary> Sets list source. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
private void SetListSource()
|
||||
{
|
||||
FrameworkElement tempBtn = sender as FrameworkElement;
|
||||
StackPanel tempParent = null;
|
||||
|
||||
if (tempBtn == this.lastClickedBtn)
|
||||
if (this.TheList.ItemsSource == null)
|
||||
{
|
||||
tempParent = this.lastClickedBtn.Parent as StackPanel;
|
||||
tempParent.Children[1].Visibility = Visibility.Collapsed;
|
||||
this.lastClickedBtn = null;
|
||||
this.TheList.ItemsSource = DepartmentIndexPage.FavoriteFeed.Model.Faculties[0].Chairs;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.lastClickedBtn != null)
|
||||
{
|
||||
tempParent = this.lastClickedBtn.Parent as StackPanel;
|
||||
tempParent.Children[1].Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
tempParent = tempBtn.Parent as StackPanel;
|
||||
tempParent.Children[1].Visibility = Visibility.Visible;
|
||||
|
||||
this.lastClickedBtn = tempBtn;
|
||||
}
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On clicking on a delete button.
|
||||
/// Removes the chair from the favorite list.
|
||||
/// </summary>
|
||||
/// <param name="sender">clicked button</param>
|
||||
/// <param name="e">event args</param>
|
||||
/// <summary> On clicking on a delete button. Removes the chair from the favorite list. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <param name="sender"> clicked button. </param>
|
||||
/// <param name="e"> event args. </param>
|
||||
private void DeleteBtn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Button btn = this.lastClickedBtn as Button;
|
||||
TextBlock btnText = btn.Content as TextBlock;
|
||||
DelButton btn = sender as DelButton;
|
||||
|
||||
if (DepartmentIndexPage.GetFavoriteFile().Model.Faculties[0].RemoveChair(btnText.Text) == true)
|
||||
if (DepartmentIndexPage.GetFavoriteFile().Model.Faculties[0].RemoveChair(btn.Value as string) == true)
|
||||
{
|
||||
MessageBox.Show(AppResources.DeleteSucceeded);
|
||||
//MessageBox.Show(AppResources.DeleteSucceeded);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -169,20 +103,6 @@ namespace CampusAppWP8.Pages.Departments
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On clicking on a info button.
|
||||
/// Open a department info page.
|
||||
/// </summary>
|
||||
/// <param name="sender">clicked button</param>
|
||||
/// <param name="e">event args</param>
|
||||
private void InfoBtn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
FrameworkElement infoBtn = sender as FrameworkElement;
|
||||
string chairName = ((this.lastClickedBtn as Button).Content as TextBlock).Text.ToString();
|
||||
|
||||
NavigationService.Navigate(new Uri(Constants.PathDepartment_DepartmentInfoPage + "?" + Constants.ParamUrl + "=" + infoBtn.Tag.ToString() + "&" + Constants.ParamName + "=" + chairName, UriKind.Relative));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<phone:PhoneApplicationPage
|
||||
<!--<phone:PhoneApplicationPage-->
|
||||
<page:PortraitLandscapePage
|
||||
x:Class="CampusAppWP8.Pages.Departments.DepartmentIndexPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -8,6 +9,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
|
||||
xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
|
||||
xmlns:page="clr-namespace:CampusAppWP8.Utility"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
@@ -78,4 +80,4 @@
|
||||
<lui:UpdateButtonAppBar Click="DeptForceUpdate_Click"/>
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
</phone:PhoneApplicationPage>
|
||||
</page:PortraitLandscapePage>
|
||||
@@ -17,21 +17,16 @@ namespace CampusAppWP8.Pages.Departments
|
||||
using CampusAppWP8.Utility.Lui.MessageBoxes;
|
||||
using Microsoft.Phone.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Page with a list of the faculties.
|
||||
/// </summary>
|
||||
public partial class DepartmentIndexPage : PhoneApplicationPage
|
||||
/// <summary> Page with a list of the faculties. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <seealso cref="T:Microsoft.Phone.Controls.PhoneApplicationPage"/>
|
||||
public partial class DepartmentIndexPage : PortraitLandscapePage
|
||||
{
|
||||
#region Member
|
||||
|
||||
/// <summary>
|
||||
/// Department/chair feed object, storing the model and data.
|
||||
/// </summary>
|
||||
/// <summary> Department/chair feed object, storing the model and data. </summary>
|
||||
private static DepartmentFeed feed = null;
|
||||
|
||||
/// <summary>
|
||||
/// Department feed object for storing the favorite list.
|
||||
/// </summary>
|
||||
/// <summary> Department feed object for storing the favorite list. </summary>
|
||||
private static DepartmentFavoriteFile favorite = null;
|
||||
|
||||
#endregion
|
||||
@@ -39,32 +34,24 @@ namespace CampusAppWP8.Pages.Departments
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DepartmentIndexPage" /> class.
|
||||
/// Initializes a new instance of the <see cref="DepartmentIndexPage" /> class.
|
||||
/// </summary>
|
||||
public DepartmentIndexPage()
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
public DepartmentIndexPage() : base()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
|
||||
//// init feed objects
|
||||
DepartmentIndexPage.InitFeed(this.SetupFacultyList, this.FeedIsFailedWeb, this.FeedIsFailedFile);
|
||||
|
||||
if (DepartmentIndexPage.favorite == null)
|
||||
{
|
||||
DepartmentIndexPage.favorite = new DepartmentFavoriteFile(false);
|
||||
}
|
||||
|
||||
DepartmentIndexPage.favorite.OnFailedFile += new DepartmentFavoriteFile.OnFailed(this.CheckFavoriteFeed);
|
||||
DepartmentIndexPage.favorite.LoadData();
|
||||
DepartmentIndexPage.InitFavoriteFeed(null, null, this.CheckFavoriteFeed);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Property
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the feed object.
|
||||
/// </summary>
|
||||
/// <summary> Gets or sets the feed object. </summary>
|
||||
/// <value> The feed. </value>
|
||||
public static DepartmentFeed Feed
|
||||
{
|
||||
get
|
||||
@@ -78,10 +65,9 @@ namespace CampusAppWP8.Pages.Departments
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the favorite feed object.
|
||||
/// </summary>
|
||||
public static DepartmentFavoriteFile FavoriteFile
|
||||
/// <summary> Gets or sets the favorite feed object. </summary>
|
||||
/// <value> The favorite feed. </value>
|
||||
public static DepartmentFavoriteFile FavoriteFeed
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -103,19 +89,17 @@ namespace CampusAppWP8.Pages.Departments
|
||||
|
||||
#region public
|
||||
|
||||
/// <summary>
|
||||
/// Return the feed object of the departments.
|
||||
/// </summary>
|
||||
/// <returns>feed object</returns>
|
||||
/// <summary> Return the feed object of the departments. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <returns> feed object. </returns>
|
||||
public static DepartmentFeed GetFeed()
|
||||
{
|
||||
return DepartmentIndexPage.feed; // DepartmentIndexPage.feed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return the feed object of the favorite departments.
|
||||
/// </summary>
|
||||
/// <returns>feed object</returns>
|
||||
/// <summary> Return the feed object of the favorite departments. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <returns> feed object. </returns>
|
||||
public static DepartmentFavoriteFile GetFavoriteFile()
|
||||
{
|
||||
return DepartmentIndexPage.favorite; // DepartmentIndexPage.favorite;
|
||||
@@ -125,20 +109,13 @@ namespace CampusAppWP8.Pages.Departments
|
||||
|
||||
#region protected
|
||||
|
||||
/// <summary>
|
||||
/// On navigation to this page.
|
||||
/// Initialize the feed loading.
|
||||
/// </summary>
|
||||
/// <param name="e">event args</param>
|
||||
/// <summary> On navigation to this page. Initialize the feed loading. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Page.OnNavigatedTo(NavigationEventArgs)"/>
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
|
||||
|
||||
if (NavigationContext.QueryString.ContainsKey(Constants.ParamRemoveBack))
|
||||
{
|
||||
if (NavigationContext.QueryString[Constants.ParamRemoveBack].Equals("true")) {
|
||||
@@ -147,11 +124,9 @@ namespace CampusAppWP8.Pages.Departments
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On navigation from this page.
|
||||
/// Store the favorite list.
|
||||
/// </summary>
|
||||
/// <param name="e">event args</param>
|
||||
/// <summary> On navigation from this page. Store the favorite list. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Page.OnNavigatedFrom(NavigationEventArgs)"/>
|
||||
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
||||
{
|
||||
if (NavigationMode.Back == e.NavigationMode)
|
||||
@@ -162,32 +137,12 @@ namespace CampusAppWP8.Pages.Departments
|
||||
base.OnNavigatedFrom(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On orientation changed.
|
||||
/// </summary>
|
||||
/// <param name="sender">sender object</param>
|
||||
/// <param name="e">event args</param>
|
||||
protected override void OnOrientationChanged(OrientationChangedEventArgs e)
|
||||
{
|
||||
if (e.Orientation.Equals(PageOrientation.Landscape) || e.Orientation.Equals(PageOrientation.LandscapeLeft) || e.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Minimized;
|
||||
}
|
||||
base.OnOrientationChanged(e);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the feed objects and load the data.
|
||||
/// </summary>
|
||||
public static void InitFeed(DepartmentFeed.OnIO onLoaded = null, DepartmentFeed.OnIO failedWeb = null, DepartmentFeed.OnIO failedFile = null)
|
||||
/// <summary> Initialize the feed objects and load the data. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <param name="onLoaded"> (Optional) the on loaded. </param>
|
||||
/// <param name="failedWeb"> (Optional) the failed web. </param>
|
||||
/// <param name="failedFile"> (Optional) the failed file. </param>
|
||||
public static void InitFeed(DepartmentFeed.OnIO onLoaded = null, DepartmentFeed.OnFailed failedWeb = null, DepartmentFeed.OnFailed failedFile = null)
|
||||
{
|
||||
if (DepartmentIndexPage.feed == null)
|
||||
{
|
||||
@@ -195,27 +150,47 @@ namespace CampusAppWP8.Pages.Departments
|
||||
}
|
||||
|
||||
if (onLoaded != null)
|
||||
DepartmentIndexPage.feed.OnLoaded += new DepartmentFeed.OnIO(onLoaded);
|
||||
DepartmentIndexPage.feed.OnLoaded += onLoaded;
|
||||
if (failedWeb != null)
|
||||
DepartmentIndexPage.feed.OnFailedWeb += new DepartmentFeed.OnFailed(failedWeb);
|
||||
DepartmentIndexPage.feed.OnFailedWeb += failedWeb;
|
||||
if (failedFile != null)
|
||||
DepartmentIndexPage.feed.OnFailedFile += new DepartmentFeed.OnFailed(failedFile);
|
||||
DepartmentIndexPage.feed.OnFailedFile += failedFile;
|
||||
|
||||
DepartmentIndexPage.feed.LoadData(Utilities.GetLoadModus<CampusAppWPortalLib8.Model.Departments.DepartmentModel>());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Setup the faculty list.
|
||||
/// </summary>
|
||||
/// <summary> Initialises the favorite feed. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <param name="onLoaded"> (Optional) the on loaded. </param>
|
||||
/// <param name="failedWeb"> (Optional) the failed web. </param>
|
||||
/// <param name="failedFile"> (Optional) the failed file. </param>
|
||||
public static void InitFavoriteFeed(DepartmentFeed.OnIO onLoaded = null, DepartmentFeed.OnFailed failedWeb = null, DepartmentFeed.OnFailed failedFile = null)
|
||||
{
|
||||
if (DepartmentIndexPage.favorite == null)
|
||||
{
|
||||
DepartmentIndexPage.favorite = new DepartmentFavoriteFile(false);
|
||||
}
|
||||
|
||||
if (onLoaded != null)
|
||||
DepartmentIndexPage.favorite.OnLoaded += onLoaded;
|
||||
if (failedWeb != null)
|
||||
DepartmentIndexPage.favorite.OnFailedWeb += failedWeb;
|
||||
if (failedFile != null)
|
||||
DepartmentIndexPage.favorite.OnFailedFile += failedFile;
|
||||
|
||||
DepartmentIndexPage.favorite.LoadData();
|
||||
}
|
||||
|
||||
/// <summary> Setup the faculty list. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
private void SetupFacultyList()
|
||||
{
|
||||
this.FacultyList.ItemsSource = DepartmentIndexPage.feed.Model.Faculties;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the favorite feed is valid.
|
||||
/// </summary>
|
||||
/// <summary> Checks if the favorite feed is valid. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
private void CheckFavoriteFeed()
|
||||
{
|
||||
if (DepartmentIndexPage.favorite.Model == null)
|
||||
@@ -229,21 +204,19 @@ namespace CampusAppWP8.Pages.Departments
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On clicking on the favorite button.
|
||||
/// </summary>
|
||||
/// <param name="sender">clicked button</param>
|
||||
/// <param name="e">event args</param>
|
||||
/// <summary> On clicking on the favorite button. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <param name="sender"> clicked button. </param>
|
||||
/// <param name="e"> event args. </param>
|
||||
private void FavoriteBtn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
NavigationService.Navigate(new Uri(Constants.PathDepartment_DepartmentFavoritePage, UriKind.Relative));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On clicking on a faculty button.
|
||||
/// </summary>
|
||||
/// <param name="sender">clicked button</param>
|
||||
/// <param name="e">event args</param>
|
||||
/// <summary> On clicking on a faculty button. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <param name="sender"> clicked button. </param>
|
||||
/// <param name="e"> event args. </param>
|
||||
private void FacultyBtn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
FrameworkElement tempElem = sender as FrameworkElement;
|
||||
@@ -252,28 +225,26 @@ namespace CampusAppWP8.Pages.Departments
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On clicking the update button in the ApplicationBar.
|
||||
/// Force a data update from the web.
|
||||
/// On clicking the update button in the ApplicationBar. Force a data update from the web.
|
||||
/// </summary>
|
||||
/// <param name="sender">button object</param>
|
||||
/// <param name="e">event args</param>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <param name="sender"> button object. </param>
|
||||
/// <param name="e"> event args. </param>
|
||||
private void DeptForceUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
DepartmentIndexPage.feed.ForceWebUpdate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method will be execute if the feed is failed
|
||||
/// </summary>
|
||||
/// <summary> Method will be execute if the feed is failed. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
private void FeedIsFailedWeb()
|
||||
{
|
||||
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadWeb);
|
||||
DepartmentIndexPage.feed.ForceReadFile();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method will be execute if the feed is failed
|
||||
/// </summary>
|
||||
/// <summary> Method will be execute if the feed is failed. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
private void FeedIsFailedFile()
|
||||
{
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
|
||||
OrientationChanged="PhoneApplicationPage_OrientationChanged"
|
||||
mc:Ignorable="d"
|
||||
shell:SystemTray.IsVisible="True">
|
||||
|
||||
|
||||
@@ -82,15 +82,6 @@ namespace CampusAppWP8.Pages.Departments
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// On orientation changed.
|
||||
/// </summary>
|
||||
/// <param name="sender">sender object</param>
|
||||
/// <param name="e">event args</param>
|
||||
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On feed ready.
|
||||
/// </summary>
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
|
||||
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
|
||||
OrientationChanged="PhoneApplicationPage_OrientationChanged"
|
||||
shell:SystemTray.IsVisible="True">
|
||||
|
||||
<!-- LayoutRoot -->
|
||||
@@ -26,16 +26,16 @@
|
||||
<header:DefaultHeader x:Name="DefHeader" Grid.Row="0" HeaderName="{Binding Path=LocalizedResources.DepartmentApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
|
||||
<!-- Pivot -->
|
||||
<phone:Pivot x:Name="DepartmentPivot" Grid.Row="1" ItemsSource="{Binding Faculties}">
|
||||
<phone:Pivot x:Name="DepartmentPivot" Grid.Row="1" ItemsSource="{Binding Faculties}" SelectionChanged="DepartmentPivot_SelectionChanged">
|
||||
<!-- Pivotitem template -->
|
||||
<phone:Pivot.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=Name, Mode=OneWay}" Margin="0,-36,0,0"/>
|
||||
<TextBlock Text="{Binding Path=Name, Mode=OneTime}" Margin="0,-36,0,0"/>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.HeaderTemplate>
|
||||
<phone:Pivot.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ListBox ItemsSource="{Binding Chairs}" Loaded="OnListBoxLoaded">
|
||||
<ListBox x:Name="TheListBox" ItemsSource="{Binding Path=Chairs, Mode=OneWay}">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
@@ -44,36 +44,31 @@
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<!--chair button-->
|
||||
<Button Tag="{Binding Url}" Click="ChairTB_Click" HorizontalContentAlignment="Left" Style="{StaticResource ListButtonStyle}">
|
||||
<TextBlock Text="{Binding Name}" HorizontalAlignment="Stretch" TextWrapping="Wrap"/>
|
||||
</Button>
|
||||
<StackPanel Visibility="Collapsed">
|
||||
<!--add to favorite button-->
|
||||
<Button BorderBrush="Transparent" Tag="{Binding Name}" Click="AddBtn_Click" HorizontalContentAlignment="Left">
|
||||
<Grid>
|
||||
<Border BorderBrush="{StaticResource PhoneContrastBackgroundBrush}" Style="{StaticResource ListButtonBorder}">
|
||||
<StackPanel Margin="12,0,12,0">
|
||||
<lui:ToggleButton ToggleContentTag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Style="{StaticResource ListButtonNoneBorder}" HorizontalContentAlignment="Left">
|
||||
<TextBlock Text="{Binding Name}" TextWrapping="Wrap" HorizontalAlignment="Left"/>
|
||||
</lui:ToggleButton>
|
||||
<StackPanel Visibility="Collapsed" Tag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}">
|
||||
<Grid HorizontalAlignment="Center">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="64"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Grid.Column="0" Grid.Row="0" Height="32" Width="32" Source="{Binding Path=ThemelizedIcon.Add, Source={StaticResource ThemelizedIcons}}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
|
||||
|
||||
<lui:AddButton Grid.Column="0" Grid.Row="0" Value="{Binding Name}" Click="AddBtn_Click" Height="80" Margin="0" Padding="0"/>
|
||||
<TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding Path=LocalizedResources.Add, Source={StaticResource LocalizedStrings}}" VerticalAlignment="Center"/>
|
||||
|
||||
<lui:LinkButton Grid.Column="0" Grid.Row="1" Url="{Binding Url}" Height="80" Margin="0" Padding="0"/>
|
||||
<TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding Path=LocalizedResources.Info, Source={StaticResource LocalizedStrings}}" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Button>
|
||||
<!--info button-->
|
||||
<Button x:Name="InfoBtn" BorderBrush="Transparent" Tag="{Binding Url}" Click="InfoBtn_Click" HorizontalContentAlignment="Left">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="64"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Grid.Column="0" Grid.Row="0" Height="32" Width="32" Source="{Binding Path=ThemelizedIcon.Info, Source={StaticResource ThemelizedIcons}}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
|
||||
<TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding Path=LocalizedResources.Info, Source={StaticResource LocalizedStrings}}" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
@@ -8,36 +8,41 @@
|
||||
namespace CampusAppWP8.Pages.Departments
|
||||
{
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWP8.Utility;
|
||||
using CampusAppWP8.Utility.Lui.Button;
|
||||
using CampusAppWPortalLib8.Model.Departments;
|
||||
using Microsoft.Phone.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Pivot page with list of the chairs of the faculties.
|
||||
/// </summary>
|
||||
/// <summary> Pivot page with list of the chairs of the faculties. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <seealso cref="T:Microsoft.Phone.Controls.PhoneApplicationPage"/>
|
||||
public partial class DepartmentPage : PhoneApplicationPage
|
||||
{
|
||||
#region Member
|
||||
|
||||
/// <summary>
|
||||
/// Last clicked button object.
|
||||
/// </summary>
|
||||
private FrameworkElement lastClickedBtn = null;
|
||||
/// <summary> the copy. </summary>
|
||||
private ObservableCollection<FacultyModel> theCopy = new ObservableCollection<FacultyModel>();
|
||||
|
||||
/// <summary> The animation step delay. </summary>
|
||||
private TimeSpan animStepDelay = new TimeSpan(0, 0, 0, 0, 50);
|
||||
/// <summary> The animation start delay. </summary>
|
||||
private TimeSpan animStartDelay = new TimeSpan(0, 0, 0, 0);
|
||||
|
||||
/// <summary> Index of the pivot. </summary>
|
||||
int pivotIndex = 0;
|
||||
private int pivotIndex = 0;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DepartmentPage" /> class.
|
||||
/// </summary>
|
||||
/// <summary> Initializes a new instance of the <see cref="DepartmentPage" /> class. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
public DepartmentPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
@@ -51,15 +56,13 @@ namespace CampusAppWP8.Pages.Departments
|
||||
|
||||
#region protected
|
||||
|
||||
/// <summary>
|
||||
/// On navigation to this page.
|
||||
/// Initialize the feed loading.
|
||||
/// </summary>
|
||||
/// <param name="e">event args</param>
|
||||
/// <summary> On navigation to this page. Initialize the feed loading. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Page.OnNavigatedTo(NavigationEventArgs)"/>
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
|
||||
string pivotIndexStr = string.Empty;
|
||||
|
||||
// Navigate to the selected pivotitem
|
||||
@@ -68,14 +71,19 @@ namespace CampusAppWP8.Pages.Departments
|
||||
{
|
||||
this.pivotIndex = int.Parse(pivotIndexStr) - 1;
|
||||
}
|
||||
|
||||
DepartmentIndexPage.InitFeed(this.SetPivotSource);
|
||||
if (DepartmentIndexPage.Feed == null || DepartmentIndexPage.Feed.Model == null)
|
||||
{
|
||||
DepartmentIndexPage.InitFeed(this.SetPivotSource);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.SetPivotSource();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override the OnNavigatedFrom function.
|
||||
/// </summary>
|
||||
/// <param name="e">event args</param>
|
||||
/// <summary> Override the OnNavigatedFrom function. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Page.OnNavigatedFrom(NavigationEventArgs)"/>
|
||||
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedFrom(e);
|
||||
@@ -85,17 +93,24 @@ namespace CampusAppWP8.Pages.Departments
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary> Sets pivot source.</summary>
|
||||
/// <summary> Sets pivot source. </summary>
|
||||
/// <remarks> Fiedler, 15.10.2013. </remarks>
|
||||
private void SetPivotSource()
|
||||
{
|
||||
if (this.pivotIndex >= 0 && this.pivotIndex < DepartmentIndexPage.Feed.Model.Faculties.Count())
|
||||
{
|
||||
this.DepartmentPivot.LoadedPivotItem += new EventHandler<PivotItemEventArgs>(this.OnLoadedPivotItems);
|
||||
|
||||
if (this.DepartmentPivot.ItemsSource == null)
|
||||
{
|
||||
this.DepartmentPivot.ItemsSource = DepartmentIndexPage.Feed.Model.Faculties;
|
||||
this.theCopy.Clear();
|
||||
|
||||
foreach (FacultyModel fm in DepartmentIndexPage.Feed.Model.Faculties)
|
||||
{
|
||||
FacultyModel newModel = new FacultyModel(fm.Id);
|
||||
|
||||
this.theCopy.Add(newModel);
|
||||
}
|
||||
|
||||
this.DepartmentPivot.ItemsSource = this.theCopy;
|
||||
}
|
||||
|
||||
this.DepartmentPivot.SelectedIndex = this.pivotIndex;
|
||||
@@ -104,95 +119,49 @@ namespace CampusAppWP8.Pages.Departments
|
||||
{
|
||||
Utility.Lui.MessageBoxes.MessageBoxes.ShowMainModelErrorMessageBox("pivot index out of bound (0 < " + this.pivotIndex + " < " + DepartmentIndexPage.Feed.Model.Faculties.Count() + ")");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void OnListBoxLoaded(object sender, RoutedEventArgs e)
|
||||
/// <summary> On clicking on a add button. Add the chair to the favorite list. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <param name="sender"> clicked button. </param>
|
||||
/// <param name="e"> event args. </param>
|
||||
private void AddBtn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AddButton btn = sender as AddButton;
|
||||
|
||||
CampusAppWPortalLib8.Model.Departments.ChairModel tempModel = DepartmentIndexPage.Feed.Model.Faculties[this.DepartmentPivot.SelectedIndex].GetChairModel(btn.Value as string);
|
||||
|
||||
if (tempModel != null)
|
||||
{
|
||||
DepartmentIndexPage.FavoriteFeed.Model.Faculties[0].AddChair(tempModel);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Event handler. Called by DepartmentPivot for selection changed events. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <param name="sender"> clicked button. </param>
|
||||
/// <param name="e"> Selection changed event information. </param>
|
||||
private void DepartmentPivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if ((e.AddedItems[0] as FacultyModel).Chairs.Count() == 0)
|
||||
{
|
||||
FacultyModel srcModel = DepartmentIndexPage.Feed.Model.GetFacultyModel((e.AddedItems[0] as FacultyModel).Id);
|
||||
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
|
||||
ListFiller<ChairModel>.Fill(srcModel.Chairs, (e.AddedItems[0] as FacultyModel).Chairs, this.animStepDelay, this.animStartDelay, this.FillCall);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Fill call. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
private void FillCall()
|
||||
{
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
private void OnLoadedPivotItems(object sender, PivotItemEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On orientation changed.
|
||||
/// </summary>
|
||||
/// <param name="sender">sender object</param>
|
||||
/// <param name="e">event args</param>
|
||||
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On clicking a chair TextBlock.
|
||||
/// Open the browser with the url of the chair.
|
||||
/// </summary>
|
||||
/// <param name="sender">clicked chair TextBlock</param>
|
||||
/// <param name="e">event args</param>
|
||||
private void ChairTB_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
FrameworkElement tempBtn = sender as FrameworkElement;
|
||||
StackPanel tempParent = null;
|
||||
|
||||
if (this.lastClickedBtn != tempBtn)
|
||||
{
|
||||
if (this.lastClickedBtn != null)
|
||||
{
|
||||
tempParent = this.lastClickedBtn.Parent as StackPanel;
|
||||
tempParent.Children[1].Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
tempParent = tempBtn.Parent as StackPanel;
|
||||
tempParent.Children[1].Visibility = Visibility.Visible;
|
||||
|
||||
this.lastClickedBtn = tempBtn;
|
||||
}
|
||||
else
|
||||
{
|
||||
tempParent = this.lastClickedBtn.Parent as StackPanel;
|
||||
tempParent.Children[1].Visibility = Visibility.Collapsed;
|
||||
this.lastClickedBtn = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On clicking on a add button.
|
||||
/// Add the chair to the favorite list.
|
||||
/// </summary>
|
||||
/// <param name="sender">clicked button</param>
|
||||
/// <param name="e">event args</param>
|
||||
private void AddBtn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Button btn = this.lastClickedBtn as Button;
|
||||
TextBlock btnText = btn.Content as TextBlock;
|
||||
|
||||
CampusAppWPortalLib8.Model.Departments.ChairModel tempModel = DepartmentIndexPage.GetFeed().Model.Faculties[this.DepartmentPivot.SelectedIndex].GetChairModel(btnText.Text);
|
||||
|
||||
if (tempModel != null)
|
||||
{
|
||||
DepartmentIndexPage.GetFavoriteFile().Model.Faculties[0].AddChair(tempModel);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On clicking on a info button.
|
||||
/// Open the info page to this chair.
|
||||
/// </summary>
|
||||
/// <param name="sender">clicked button</param>
|
||||
/// <param name="e">event args</param>
|
||||
private void InfoBtn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
FrameworkElement infoBtn = sender as FrameworkElement;
|
||||
string chairName = ((this.lastClickedBtn as Button).Content as TextBlock).Text.ToString();
|
||||
|
||||
NavigationService.Navigate(new Uri(Constants.PathDepartment_DepartmentInfoPage + "?" + Constants.ParamUrl + "=" + infoBtn.Tag.ToString() + "&" + Constants.ParamName + "=" + chairName, UriKind.Relative));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
#endregion //private
|
||||
|
||||
#endregion //Method
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<phone:PhoneApplicationPage
|
||||
<page:PortraitLandscapePage
|
||||
x:Class="CampusAppWP8.Pages.Events.EventIndexPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -8,6 +8,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
|
||||
xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
|
||||
xmlns:page="clr-namespace:CampusAppWP8.Utility"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
@@ -24,12 +25,6 @@
|
||||
|
||||
<!--header-->
|
||||
<header:DefaultHeader x:Name="DefHeader" Grid.Row="0" HeaderName="{Binding Path=LocalizedResources.EventApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
<!--
|
||||
<StackPanel Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.EventApp_Title, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
|
||||
</StackPanel>
|
||||
-->
|
||||
<!-- Content -->
|
||||
<ListBox x:Name="EventList" Grid.Row="1" Margin="12,0,12,0">
|
||||
<ListBox.ItemContainerStyle>
|
||||
@@ -52,4 +47,4 @@
|
||||
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="False" Mode="Minimized" Opacity="1.0" >
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
</phone:PhoneApplicationPage>
|
||||
</page:PortraitLandscapePage>
|
||||
@@ -21,7 +21,7 @@ namespace CampusAppWP8.Pages.Events
|
||||
/// <summary>
|
||||
/// Overview page of all events.
|
||||
/// </summary>
|
||||
public partial class EventIndexPage : PhoneApplicationPage
|
||||
public partial class EventIndexPage : PortraitLandscapePage
|
||||
{
|
||||
#region Method
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace CampusAppWP8.Pages.Events
|
||||
/// Event Feed object, which contains the RSS models and data.
|
||||
/// </summary>
|
||||
private static EventFeed eventFeed = null;
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
@@ -41,7 +41,7 @@ namespace CampusAppWP8.Pages.Events
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
|
||||
|
||||
ApplicationBarIconButton updateBtn = new ApplicationBarIconButton();
|
||||
updateBtn.IconUri = new Uri(Icons.Update, UriKind.Relative);
|
||||
updateBtn.Text = AppResources.UpdateBtn;
|
||||
@@ -108,11 +108,6 @@ namespace CampusAppWP8.Pages.Events
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -130,26 +125,6 @@ namespace CampusAppWP8.Pages.Events
|
||||
base.OnNavigatedFrom(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Methods overrides the OnOrientationChanged-Method.
|
||||
/// </summary>
|
||||
/// <param name="e">orientation changed event args.</param>
|
||||
protected override void OnOrientationChanged(OrientationChangedEventArgs e)
|
||||
{
|
||||
if (e.Orientation == PageOrientation.Landscape
|
||||
|| e.Orientation == PageOrientation.LandscapeLeft
|
||||
|| e.Orientation == PageOrientation.LandscapeRight)
|
||||
{
|
||||
ApplicationBar.Mode = ApplicationBarMode.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationBar.Mode = ApplicationBarMode.Minimized;
|
||||
}
|
||||
|
||||
base.OnOrientationChanged(e);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region private
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<phone:PhoneApplicationPage
|
||||
<page:PortraitLandscapePage
|
||||
x:Class="CampusAppWP8.Pages.Events.EventPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -7,6 +7,7 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
|
||||
xmlns:page="clr-namespace:CampusAppWP8.Utility"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
@@ -62,4 +63,4 @@
|
||||
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="False" Mode="Default" Opacity="1.0" >
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
</phone:PhoneApplicationPage>
|
||||
</page:PortraitLandscapePage>
|
||||
@@ -25,7 +25,7 @@ namespace CampusAppWP8.Pages.Events
|
||||
/// <summary>
|
||||
/// EventPage, where every event feed has his own PivotItem.
|
||||
/// </summary>
|
||||
public partial class EventPage : PhoneApplicationPage
|
||||
public partial class EventPage : PortraitLandscapePage
|
||||
{
|
||||
#region Memeber
|
||||
|
||||
@@ -90,11 +90,6 @@ namespace CampusAppWP8.Pages.Events
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
|
||||
if (this.isNewInstance)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<phone:PhoneApplicationPage
|
||||
<page:PortraitLandscapePage
|
||||
x:Class="CampusAppWP8.Pages.Exams.Exams"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -8,6 +8,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
|
||||
xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
|
||||
xmlns:page="clr-namespace:CampusAppWP8.Utility"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
@@ -96,4 +97,4 @@
|
||||
<lui:UpdateButtonAppBar Click="ExamForceUpdate_Click"/>
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
</phone:PhoneApplicationPage>
|
||||
</page:PortraitLandscapePage>
|
||||
@@ -24,7 +24,7 @@ namespace CampusAppWP8.Pages.Exams
|
||||
/// <summary> class of ExamsPage. </summary>
|
||||
/// <remarks> Stubbfel, 02.09.2013. </remarks>
|
||||
/// <seealso cref="T:Microsoft.Phone.Controls.PhoneApplicationPage"/>
|
||||
public partial class Exams : PhoneApplicationPage
|
||||
public partial class Exams : PortraitLandscapePage
|
||||
{
|
||||
#region Member
|
||||
|
||||
@@ -62,11 +62,6 @@ namespace CampusAppWP8.Pages.Exams
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
|
||||
if (this.feed == null)
|
||||
{
|
||||
this.InitializeFeed();
|
||||
@@ -93,23 +88,6 @@ namespace CampusAppWP8.Pages.Exams
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On orientation changed.
|
||||
/// </summary>
|
||||
/// <param name="sender">sender object</param>
|
||||
/// <param name="e">event args</param>
|
||||
protected override void OnOrientationChanged(OrientationChangedEventArgs e)
|
||||
{
|
||||
if (e.Orientation.Equals(PageOrientation.Landscape) || e.Orientation.Equals(PageOrientation.LandscapeLeft) || e.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Minimized;
|
||||
}
|
||||
base.OnOrientationChanged(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region private
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<phone:PhoneApplicationPage
|
||||
<page:PortraitLandscapePage
|
||||
x:Class="CampusAppWP8.Pages.Links.LinkPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -8,12 +8,12 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
|
||||
xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
|
||||
xmlns:page="clr-namespace:CampusAppWP8.Utility"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
|
||||
OrientationChanged="PhoneApplicationPage_OrientationChanged"
|
||||
shell:SystemTray.IsVisible="True">
|
||||
|
||||
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
||||
@@ -79,4 +79,4 @@
|
||||
<lui:UpdateButtonAppBar Click="LinkForceUpdate_Click"/>
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
</phone:PhoneApplicationPage>
|
||||
</page:PortraitLandscapePage>
|
||||
@@ -20,7 +20,7 @@ namespace CampusAppWP8.Pages.Links
|
||||
/// <summary> Class for the LinkPage. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:Microsoft.Phone.Controls.PhoneApplicationPage"/>
|
||||
public partial class LinkPage : PhoneApplicationPage
|
||||
public partial class LinkPage : PortraitLandscapePage
|
||||
{
|
||||
#region Members
|
||||
|
||||
@@ -57,11 +57,6 @@ namespace CampusAppWP8.Pages.Links
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
|
||||
this.InitializeFeeds();
|
||||
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
@@ -199,22 +194,6 @@ namespace CampusAppWP8.Pages.Links
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Method handle OrientationPage. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="sender"> Caller of the function. </param>
|
||||
/// <param name="e"> some EventArgs. </param>
|
||||
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
|
||||
{
|
||||
if (this.Orientation == PageOrientation.LandscapeLeft || this.Orientation == PageOrientation.LandscapeRight)
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Minimized;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<phone:PhoneApplicationPage
|
||||
<page:PortraitLandscapePage
|
||||
x:Class="CampusAppWP8.Pages.Mensa.MensaPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -9,12 +9,12 @@
|
||||
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
|
||||
xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
|
||||
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
|
||||
xmlns:page="clr-namespace:CampusAppWP8.Utility"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
|
||||
OrientationChanged="PhoneApplicationPage_OrientationChanged"
|
||||
shell:SystemTray.IsVisible="True">
|
||||
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
@@ -82,4 +82,4 @@
|
||||
</shell:ApplicationBar.MenuItems>
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
</phone:PhoneApplicationPage>
|
||||
</page:PortraitLandscapePage>
|
||||
@@ -24,7 +24,7 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
/// <summary> Class for the MensaPage. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:Microsoft.Phone.Controls.PhoneApplicationPage"/>
|
||||
public partial class MensaPage : PhoneApplicationPage
|
||||
public partial class MensaPage : PortraitLandscapePage
|
||||
{
|
||||
#region Members
|
||||
|
||||
@@ -92,11 +92,6 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
|
||||
this.InitializeFeed();
|
||||
}
|
||||
|
||||
@@ -370,22 +365,6 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
this.InitializeFeed(CampusAppWPortalLib8.Model.Settings.Campus.SFB_MAIN);
|
||||
}
|
||||
|
||||
/// <summary> Method handle OrientationPage. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="sender"> Caller of the function. </param>
|
||||
/// <param name="e"> some EventArgs. </param>
|
||||
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
|
||||
{
|
||||
if (this.Orientation == PageOrientation.LandscapeLeft || this.Orientation == PageOrientation.LandscapeRight)
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Minimized;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Event handler. Called by MenuItem for click events. </summary>
|
||||
/// <remarks> Stubbfel, 14.10.2013. </remarks>
|
||||
/// <param name="sender"> button object. </param>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<phone:PhoneApplicationPage
|
||||
<page:PortraitLandscapePage
|
||||
x:Class="CampusAppWP8.Pages.News.NewsIndexPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -8,6 +8,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
|
||||
xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
|
||||
xmlns:page="clr-namespace:CampusAppWP8.Utility"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
@@ -60,4 +61,4 @@
|
||||
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="False" Mode="Minimized" Opacity="1.0" >
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
</phone:PhoneApplicationPage>
|
||||
</page:PortraitLandscapePage>
|
||||
@@ -21,7 +21,7 @@ namespace CampusAppWP8.Pages.News
|
||||
/// <summary>
|
||||
/// Overview page of all news.
|
||||
/// </summary>
|
||||
public partial class NewsIndexPage : PhoneApplicationPage
|
||||
public partial class NewsIndexPage : PortraitLandscapePage
|
||||
{
|
||||
#region Member
|
||||
|
||||
@@ -97,20 +97,6 @@ namespace CampusAppWP8.Pages.News
|
||||
|
||||
#region protected
|
||||
|
||||
/// <summary>
|
||||
/// On navigation to this page, creates a FeedEventHandler and load the RSS feed data.
|
||||
/// </summary>
|
||||
/// <param name="e">event args</param>
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Methods overrides the OnNavigatedFrom-Method
|
||||
/// </summary>
|
||||
@@ -130,26 +116,6 @@ namespace CampusAppWP8.Pages.News
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Methods overrides the OnOrientationChanged-Method.
|
||||
/// </summary>
|
||||
/// <param name="e">orientation changed event args.</param>
|
||||
protected override void OnOrientationChanged(OrientationChangedEventArgs e)
|
||||
{
|
||||
if (e.Orientation == PageOrientation.LandscapeRight
|
||||
|| e.Orientation == PageOrientation.LandscapeLeft
|
||||
|| e.Orientation == PageOrientation.Landscape)
|
||||
{
|
||||
ApplicationBar.Mode = ApplicationBarMode.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationBar.Mode = ApplicationBarMode.Minimized;
|
||||
}
|
||||
|
||||
base.OnOrientationChanged(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<phone:PhoneApplicationPage
|
||||
<page:PortraitLandscapePage
|
||||
x:Class="CampusAppWP8.Pages.News.NewsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -7,6 +7,7 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
|
||||
xmlns:page="clr-namespace:CampusAppWP8.Utility"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
@@ -61,4 +62,4 @@
|
||||
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="False" Mode="Default" Opacity="1.0" >
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
</phone:PhoneApplicationPage>
|
||||
</page:PortraitLandscapePage>
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace CampusAppWP8.Pages.News
|
||||
/// <summary>
|
||||
/// EventPage, where every news fees has his own PivotItem.
|
||||
/// </summary>
|
||||
public partial class NewsPage : PhoneApplicationPage
|
||||
public partial class NewsPage : PortraitLandscapePage
|
||||
{
|
||||
/// <summary>
|
||||
/// for checking if the feed source is already set or not.
|
||||
@@ -76,11 +76,6 @@ namespace CampusAppWP8.Pages.News
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
|
||||
if (this.isNewInstance)
|
||||
@@ -151,24 +146,6 @@ namespace CampusAppWP8.Pages.News
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
protected override void OnOrientationChanged(OrientationChangedEventArgs e)
|
||||
{
|
||||
if (e.Orientation == PageOrientation.Landscape
|
||||
|| e.Orientation == PageOrientation.LandscapeLeft
|
||||
|| e.Orientation == PageOrientation.LandscapeRight)
|
||||
{
|
||||
ApplicationBar.Mode = ApplicationBarMode.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationBar.Mode = ApplicationBarMode.Minimized;
|
||||
}
|
||||
|
||||
base.OnOrientationChanged(e);
|
||||
}
|
||||
*/
|
||||
|
||||
/// <summary>
|
||||
/// Called when the index of the selected PivotItem is changed.
|
||||
/// Set the text Grid to visible and the WebBrowser to collapsed.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<phone:PhoneApplicationPage
|
||||
<page:PortraitLandscapePage
|
||||
x:Class="CampusAppWP8.Pages.Openinghours.OpeninghoursPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -8,6 +8,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
|
||||
xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
|
||||
xmlns:page="clr-namespace:CampusAppWP8.Utility"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
@@ -131,4 +132,4 @@
|
||||
<lui:UpdateButtonAppBar Click="OpenHoursForceUpdate_Click"/>
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
</phone:PhoneApplicationPage>
|
||||
</page:PortraitLandscapePage>
|
||||
@@ -20,7 +20,7 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
/// <summary>
|
||||
/// Opening hours page.
|
||||
/// </summary>
|
||||
public partial class OpeninghoursPage : PhoneApplicationPage
|
||||
public partial class OpeninghoursPage : PortraitLandscapePage
|
||||
{
|
||||
#region Members
|
||||
|
||||
@@ -72,11 +72,6 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
|
||||
if (this.isNewInstance)
|
||||
{
|
||||
if ((this.feed == null) || (this.feed.Model == null))
|
||||
@@ -113,26 +108,6 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override the OnOrientationChanged method.
|
||||
/// </summary>
|
||||
/// <param name="e">orientation changed event args.</param>
|
||||
protected override void OnOrientationChanged(OrientationChangedEventArgs e)
|
||||
{
|
||||
if (e.Orientation == PageOrientation.Landscape
|
||||
|| e.Orientation == PageOrientation.LandscapeLeft
|
||||
|| e.Orientation == PageOrientation.LandscapeRight)
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Minimized;
|
||||
}
|
||||
|
||||
base.OnOrientationChanged(e);
|
||||
}
|
||||
|
||||
// protected
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<phone:PhoneApplicationPage
|
||||
<page:PortraitLandscapePage
|
||||
x:Class="CampusAppWP8.Pages.PlaceNews.PlaceNews"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -7,6 +7,7 @@
|
||||
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"
|
||||
xmlns:page="clr-namespace:CampusAppWP8.Utility"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
@@ -57,4 +58,4 @@
|
||||
</shell:ApplicationBar.MenuItems>
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
</phone:PhoneApplicationPage>
|
||||
</page:PortraitLandscapePage>
|
||||
@@ -29,7 +29,7 @@ namespace CampusAppWP8.Pages.PlaceNews
|
||||
/// <summary> Place news. </summary>
|
||||
/// <remarks> Stubbfel, 09.09.2013. </remarks>
|
||||
/// <seealso cref="T:Microsoft.Phone.Controls.PhoneApplicationPage"/>
|
||||
public partial class PlaceNews : PhoneApplicationPage
|
||||
public partial class PlaceNews : PortraitLandscapePage
|
||||
{
|
||||
#region Member
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<phone:PhoneApplicationPage
|
||||
<page:PortraitLandscapePage
|
||||
x:Class="CampusAppWP8.Pages.StartPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -8,6 +8,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
|
||||
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
|
||||
xmlns:page="clr-namespace:CampusAppWP8.Utility"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
@@ -279,4 +280,4 @@
|
||||
</shell:ApplicationBar.MenuItems>
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
</phone:PhoneApplicationPage>
|
||||
</page:PortraitLandscapePage>
|
||||
@@ -29,7 +29,7 @@ namespace CampusAppWP8.Pages
|
||||
/// <summary> Class for the StartPage. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:Microsoft.Phone.Controls.PhoneApplicationPage"/>
|
||||
public partial class StartPage : PhoneApplicationPage
|
||||
public partial class StartPage : PortraitLandscapePage
|
||||
{
|
||||
#region Member
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<phone:PhoneApplicationPage
|
||||
<page:PortraitLandscapePage
|
||||
x:Class="CampusAppWP8.Pages.StudentCouncil.StudentCouncilPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -8,6 +8,7 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
|
||||
xmlns:page="clr-namespace:CampusAppWP8.Utility"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
@@ -70,4 +71,4 @@
|
||||
<lui:UpdateButtonAppBar Click="StudentForceUpdate_Click"/>
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
</phone:PhoneApplicationPage>
|
||||
</page:PortraitLandscapePage>
|
||||
@@ -20,7 +20,7 @@ namespace CampusAppWP8.Pages.StudentCouncil
|
||||
/// <summary> Class for the StudentCouncilPage. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:Microsoft.Phone.Controls.PhoneApplicationPage"/>
|
||||
public partial class StudentCouncilPage : PhoneApplicationPage
|
||||
public partial class StudentCouncilPage : PortraitLandscapePage
|
||||
{
|
||||
#region Members
|
||||
|
||||
@@ -52,11 +52,6 @@ namespace CampusAppWP8.Pages.StudentCouncil
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
|
||||
if (this.feed == null)
|
||||
{
|
||||
this.InitializeFeed();
|
||||
@@ -74,25 +69,6 @@ namespace CampusAppWP8.Pages.StudentCouncil
|
||||
this.feed.SaveData();
|
||||
}
|
||||
|
||||
/// <summary> Override the OnOrientationChanged method. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="M:Microsoft.Phone.Controls.PhoneApplicationPage.OnOrientationChanged(OrientationChangedEventArgs)"/>
|
||||
protected override void OnOrientationChanged(OrientationChangedEventArgs e)
|
||||
{
|
||||
if (e.Orientation == PageOrientation.Landscape
|
||||
|| e.Orientation == PageOrientation.LandscapeLeft
|
||||
|| e.Orientation == PageOrientation.LandscapeRight)
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Minimized;
|
||||
}
|
||||
|
||||
base.OnOrientationChanged(e);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region private
|
||||
|
||||
|
||||
72
CampusAppWP8/CampusAppWP8/Utility/FrameworkAnimator.cs
Normal file
72
CampusAppWP8/CampusAppWP8/Utility/FrameworkAnimator.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="FrameworkAnimator.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Fiedler</author>
|
||||
// <date>17.10.2013</date>
|
||||
// <summary>Implements the framework animator class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility
|
||||
{
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Threading;
|
||||
|
||||
|
||||
/// <summary> A framework animator. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
public class FrameworkAnimator
|
||||
{
|
||||
/// <summary> An animator parameters. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
private struct AnimatorParams
|
||||
{
|
||||
/// <summary> The element. </summary>
|
||||
public FrameworkElement elem;
|
||||
/// <summary> Duration of the step. </summary>
|
||||
public TimeSpan stepDuration;
|
||||
/// <summary> The step to step. </summary>
|
||||
public TimeSpan stepToStep;
|
||||
/// <summary> The start delay. </summary>
|
||||
public Duration startDelay;
|
||||
}
|
||||
|
||||
/// <summary> Animates the given element. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <param name="elem"> The element. </param>
|
||||
public static void Animate(FrameworkElement elem)
|
||||
{
|
||||
Duration dur = new Duration(TimeSpan.Zero);
|
||||
Animate(elem, dur);
|
||||
}
|
||||
|
||||
/// <summary> Animates the given element. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <param name="elem"> The element. </param>
|
||||
/// <param name="startIn"> The start in. </param>
|
||||
public static void Animate(FrameworkElement elem, Duration startIn)
|
||||
{
|
||||
AnimatorParams param = new AnimatorParams();
|
||||
param.elem = elem;
|
||||
param.startDelay = startIn;
|
||||
param.stepDuration = new TimeSpan(0,0,2);
|
||||
param.stepToStep = new TimeSpan(0,0,1);
|
||||
|
||||
Thread newThread = new Thread(FrameworkAnimator.RealAnimator);
|
||||
|
||||
newThread.Start(param);
|
||||
}
|
||||
|
||||
/// <summary> Real animator. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <param name="param"> The parameter. </param>
|
||||
private static void RealAnimator(object param)
|
||||
{
|
||||
AnimatorParams theParam = (AnimatorParams)param;
|
||||
|
||||
Thread.Sleep(Convert.ToInt32(theParam.startDelay.TimeSpan.TotalMilliseconds));
|
||||
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
}
|
||||
113
CampusAppWP8/CampusAppWP8/Utility/ListFiller.cs
Normal file
113
CampusAppWP8/CampusAppWP8/Utility/ListFiller.cs
Normal file
@@ -0,0 +1,113 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="ListFiller.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Fiedler</author>
|
||||
// <date>18.10.2013</date>
|
||||
// <summary>Implements the list filler class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility
|
||||
{
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows;
|
||||
using System.Threading;
|
||||
|
||||
/// <summary> A list filler. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <typeparam name="T"> Generic type parameter. </typeparam>
|
||||
public class ListFiller<T>
|
||||
{
|
||||
/// <summary> A fill structure. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
private struct FillStruct
|
||||
{
|
||||
/// <summary> Source for the. </summary>
|
||||
public ObservableCollection<T> src;
|
||||
/// <summary> Destination for the. </summary>
|
||||
public ObservableCollection<T> dest;
|
||||
/// <summary> Amount to increment by. </summary>
|
||||
public TimeSpan step;
|
||||
/// <summary> The delay. </summary>
|
||||
public TimeSpan delay;
|
||||
/// <summary> The callback. </summary>
|
||||
public FillCallback callback;
|
||||
}
|
||||
|
||||
/// <summary> Callback, called when the fill. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
public delegate void FillCallback();
|
||||
|
||||
/// <summary> Fills. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <param name="srcList"> List of sources. </param>
|
||||
/// <param name="destList"> List of destinations. </param>
|
||||
public static void Fill(ObservableCollection<T> srcList, ObservableCollection<T> destList)
|
||||
{
|
||||
TimeSpan timeZero = TimeSpan.Zero;
|
||||
|
||||
Fill(srcList, destList, timeZero, timeZero, null);
|
||||
}
|
||||
|
||||
/// <summary> Fills. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <param name="srcList"> List of sources. </param>
|
||||
/// <param name="destList"> List of destinations. </param>
|
||||
/// <param name="stepDelay"> The step delay. </param>
|
||||
public static void Fill(ObservableCollection<T> srcList, ObservableCollection<T> destList, TimeSpan stepDelay)
|
||||
{
|
||||
TimeSpan timeZero = TimeSpan.Zero;
|
||||
|
||||
Fill(srcList, destList, stepDelay, timeZero, null);
|
||||
}
|
||||
|
||||
/// <summary> Fills. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <param name="srcList"> List of sources. </param>
|
||||
/// <param name="destList"> List of destinations. </param>
|
||||
/// <param name="stepDelay"> The step delay. </param>
|
||||
/// <param name="startDelay"> The start delay. </param>
|
||||
/// <param name="callback"> The callback. </param>
|
||||
public static void Fill(ObservableCollection<T> srcList, ObservableCollection<T> destList, TimeSpan stepDelay, TimeSpan startDelay, FillCallback callback)
|
||||
{
|
||||
FillStruct param = new FillStruct();
|
||||
param.src = srcList;
|
||||
param.dest = destList;
|
||||
param.step = stepDelay;
|
||||
param.delay = startDelay;
|
||||
param.callback = callback;
|
||||
|
||||
Thread newThread = new Thread(ListFiller<T>.FillThread);
|
||||
|
||||
newThread.Start(param);
|
||||
}
|
||||
|
||||
/// <summary> Fill thread. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <param name="paramObj"> The parameter object. </param>
|
||||
private static void FillThread(object paramObj)
|
||||
{
|
||||
FillStruct param = (FillStruct)paramObj;
|
||||
|
||||
Thread.Sleep(Convert.ToInt32(param.delay.TotalMilliseconds));
|
||||
|
||||
foreach (T elem in param.src)
|
||||
{
|
||||
Deployment.Current.Dispatcher.BeginInvoke(() =>
|
||||
{
|
||||
param.dest.Add(elem);
|
||||
});
|
||||
|
||||
Thread.Sleep(Convert.ToInt32(param.step.TotalMilliseconds));
|
||||
}
|
||||
|
||||
if (param.callback != null)
|
||||
{
|
||||
Deployment.Current.Dispatcher.BeginInvoke(() =>
|
||||
{
|
||||
param.callback();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
59
CampusAppWP8/CampusAppWP8/Utility/Lui/Button/AddButton.cs
Normal file
59
CampusAppWP8/CampusAppWP8/Utility/Lui/Button/AddButton.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="AddButton.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Fiedler</author>
|
||||
// <date>16.10.2013</date>
|
||||
// <summary>Implements the add button class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.Lui.Button
|
||||
{
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media.Imaging;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary> An add button. </summary>
|
||||
/// <remarks> Fiedler, 16.10.2013. </remarks>
|
||||
/// <seealso cref="T:System.Windows.Controls.Button"/>
|
||||
public class AddButton : System.Windows.Controls.Button
|
||||
{
|
||||
#region Member
|
||||
|
||||
/// <summary> The value property. </summary>
|
||||
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(object), typeof(AddButton), new PropertyMetadata(false));
|
||||
|
||||
/// <summary> The icon. </summary>
|
||||
private static BitmapImage icon = new BitmapImage(new Uri(Icons.Add, UriKind.Relative));
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary> Initializes a new instance of the AddButton class. </summary>
|
||||
/// <remarks> Fiedler, 16.10.2013. </remarks>
|
||||
public AddButton()
|
||||
: base()
|
||||
{
|
||||
this.Content = new Image
|
||||
{
|
||||
Source = icon
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Property
|
||||
|
||||
/// <summary> Gets or sets the value. </summary>
|
||||
/// <value> The value. </value>
|
||||
public object Value
|
||||
{
|
||||
get { return (object)this.GetValue(ValueProperty); }
|
||||
set { this.SetValue(ValueProperty, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
59
CampusAppWP8/CampusAppWP8/Utility/Lui/Button/DelButton.cs
Normal file
59
CampusAppWP8/CampusAppWP8/Utility/Lui/Button/DelButton.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="DelButton.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Fiedler</author>
|
||||
// <date>18.10.2013</date>
|
||||
// <summary>Implements the delete button class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.Lui.Button
|
||||
{
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media.Imaging;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary> A delete button. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <seealso cref="T:System.Windows.Controls.Button"/>
|
||||
public class DelButton : System.Windows.Controls.Button
|
||||
{
|
||||
#region Member
|
||||
|
||||
/// <summary> The value property. </summary>
|
||||
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(object), typeof(DelButton), new PropertyMetadata(false));
|
||||
|
||||
/// <summary> The icon. </summary>
|
||||
private static BitmapImage icon = new BitmapImage(new Uri(Icons.Delete, UriKind.Relative));
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary> Initializes a new instance of the DelButton class. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
public DelButton()
|
||||
: base()
|
||||
{
|
||||
this.Content = new Image
|
||||
{
|
||||
Source = icon
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Property
|
||||
|
||||
/// <summary> Gets or sets the value. </summary>
|
||||
/// <value> The value. </value>
|
||||
public object Value
|
||||
{
|
||||
get { return (object)this.GetValue(ValueProperty); }
|
||||
set { this.SetValue(ValueProperty, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
92
CampusAppWP8/CampusAppWP8/Utility/PortraitLandscapePage.cs
Normal file
92
CampusAppWP8/CampusAppWP8/Utility/PortraitLandscapePage.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="PortraitLandscapePage.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Fiedler</author>
|
||||
// <date>21.10.2013</date>
|
||||
// <summary>Implements the portrait landscape page class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility
|
||||
{
|
||||
using System.Windows;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Shell;
|
||||
|
||||
/// <summary> A portrait landscape page. </summary>
|
||||
/// <remarks> Fiedler, 21.10.2013. </remarks>
|
||||
/// <seealso cref="T:Microsoft.Phone.Controls.PhoneApplicationPage"/>
|
||||
public class PortraitLandscapePage : PhoneApplicationPage
|
||||
{
|
||||
/// <summary> The default application bar mode. </summary>
|
||||
private ApplicationBarMode defaultApplicationBarMode;
|
||||
private bool isDefaultModeSet = false;
|
||||
|
||||
/// <summary> Initializes a new instance of the PortraitLandscapePage class. </summary>
|
||||
/// <remarks> Fiedler, 21.10.2013. </remarks>
|
||||
protected PortraitLandscapePage() : base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary> Wird aufgerufen, wenn eine Seite die aktive Seite in einem Frame wird. </summary>
|
||||
/// <remarks> Fiedler, 21.10.2013. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Page.OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs)"/>
|
||||
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
|
||||
{
|
||||
if(this.ApplicationBar != null && this.isDefaultModeSet == false)
|
||||
{
|
||||
this.defaultApplicationBarMode = this.ApplicationBar.Mode;
|
||||
this.isDefaultModeSet = true;
|
||||
}
|
||||
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (this.ApplicationBar != null)
|
||||
{
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
this.ApplicationBar.Mode = ApplicationBarMode.Default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Wird aufgerufen, nachdem die Orientation-Eigenschaft geändert wurde. </summary>
|
||||
/// <remarks> Fiedler, 21.10.2013. </remarks>
|
||||
/// <seealso cref="M:Microsoft.Phone.Controls.PhoneApplicationPage.OnOrientationChanged(OrientationChangedEventArgs)"/>
|
||||
protected override void OnOrientationChanged(OrientationChangedEventArgs e)
|
||||
{
|
||||
if (this.ApplicationBar != null)
|
||||
{
|
||||
if (this.defaultApplicationBarMode.Equals(ApplicationBarMode.Minimized))
|
||||
{
|
||||
if (e.Orientation.Equals(PageOrientation.Landscape) || e.Orientation.Equals(PageOrientation.LandscapeLeft) || e.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
this.ApplicationBar.Mode = ApplicationBarMode.Default;
|
||||
this.OnSwitchedToLandscape(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ApplicationBar.Mode = ApplicationBarMode.Minimized;
|
||||
this.OnSwitchedToPortrait(e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
base.OnOrientationChanged(e);
|
||||
}
|
||||
|
||||
/// <summary> Raises the orientation changed event. </summary>
|
||||
/// <remarks> Fiedler, 21.10.2013. </remarks>
|
||||
/// <param name="e"> Event information to send to registered event handlers. </param>
|
||||
protected virtual void OnSwitchedToLandscape(OrientationChangedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary> Raises the orientation changed event. </summary>
|
||||
/// <remarks> Fiedler, 21.10.2013. </remarks>
|
||||
/// <param name="e"> Event information to send to registered event handlers. </param>
|
||||
protected virtual void OnSwitchedToPortrait(OrientationChangedEventArgs e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,12 +8,13 @@
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWPortalLib8.Model.Departments
|
||||
{
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
/// <summary> Class to hold information about a professorship chair. </summary>
|
||||
/// <remarks> fiedlchr, 15.10.2013. </remarks>
|
||||
public class ChairModel
|
||||
public class ChairModel : INotifyPropertyChanged
|
||||
{
|
||||
#region Member
|
||||
|
||||
@@ -27,7 +28,7 @@ namespace CampusAppWPortalLib8.Model.Departments
|
||||
private string nameEN = string.Empty;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary> Initializes a new instance of the <see cref="ChairModel" /> class. </summary>
|
||||
@@ -36,10 +37,6 @@ namespace CampusAppWPortalLib8.Model.Departments
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Property
|
||||
|
||||
/// <summary> Initializes a new instance of the <see cref="ChairModel" /> class. </summary>
|
||||
/// <remarks> fiedlchr, 15.10.2013. </remarks>
|
||||
/// <param name="name"> name of the chair. </param>
|
||||
@@ -49,6 +46,17 @@ namespace CampusAppWPortalLib8.Model.Departments
|
||||
this.nameEN = name;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region event
|
||||
|
||||
/// <summary> Occurs when Property Changed. </summary>
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Property
|
||||
|
||||
/// <summary> Gets or sets the german name of the chair. </summary>
|
||||
/// <value> The name de. </value>
|
||||
[XmlAttribute("name_de")]
|
||||
@@ -124,5 +132,16 @@ namespace CampusAppWPortalLib8.Model.Departments
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary> Notifies a property changed. </summary>
|
||||
/// <remarks> fiedlchr, 15.10.2013. </remarks>
|
||||
/// <param name="info"> The information. </param>
|
||||
private void NotifyPropertyChanged(string info)
|
||||
{
|
||||
if (this.PropertyChanged != null)
|
||||
{
|
||||
this.PropertyChanged(this, new PropertyChangedEventArgs(info));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,25 @@ namespace CampusAppWPortalLib8.Model.Departments
|
||||
|
||||
#region Method
|
||||
|
||||
/// <summary> Gets faculty model. </summary>
|
||||
/// <remarks> Fiedler, 18.10.2013. </remarks>
|
||||
/// <param name="id"> The identifier. </param>
|
||||
/// <returns> The faculty model. </returns>
|
||||
public FacultyModel GetFacultyModel(string id)
|
||||
{
|
||||
FacultyModel retValue = null;
|
||||
|
||||
foreach (FacultyModel m in this.faculties)
|
||||
{
|
||||
if (m.Id.Equals(id))
|
||||
{
|
||||
retValue = m;
|
||||
}
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the content of the faculty lists hast changed since the last call of this
|
||||
/// function.
|
||||
|
||||
Reference in New Issue
Block a user