daily commit
This commit is contained in:
@@ -8,12 +8,18 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
|
||||
xmlns:page="clr-namespace:CampusAppWP8.Utility.Lui.Page"
|
||||
xmlns:conv="clr-namespace:CampusAppWP8.Utility.Converter"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
|
||||
shell:SystemTray.IsVisible="True">
|
||||
|
||||
<page:PortraitLandscapePage.Resources>
|
||||
<conv:BoolToVisibilityConverter x:Key="VisConverter"/>
|
||||
</page:PortraitLandscapePage.Resources>
|
||||
|
||||
<!-- LayoutRoot -->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -40,7 +46,7 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid x:Name="EventTextGrid" Grid.Row="0" Visibility="{Binding Path=TextVisibility, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<Grid x:Name="EventTextGrid" Grid.Row="0" Visibility="{Binding Path=TextVisibility, Mode=OneWay, Converter={StaticResource VisConverter}}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" MaxHeight="300"/>
|
||||
<RowDefinition Height="*" />
|
||||
@@ -52,7 +58,7 @@
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
|
||||
<phone:WebBrowser x:Name="EventWebBrowser" Source="{Binding Path=Link, Mode=OneWay}" Grid.Row="0" IsScriptEnabled="True" Visibility="{Binding Path=BrowserVisibility, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||
<phone:WebBrowser x:Name="EventWebBrowser" Source="{Binding Path=Link, Mode=OneWay}" Grid.Row="0" IsScriptEnabled="True" Visibility="{Binding Path=BrowserVisibility, Mode=OneWay, Converter={StaticResource VisConverter}}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.ItemTemplate>
|
||||
|
||||
@@ -8,12 +8,18 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
|
||||
xmlns:page="clr-namespace:CampusAppWP8.Utility.Lui.Page"
|
||||
xmlns:conv="clr-namespace:CampusAppWP8.Utility.Converter"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
|
||||
shell:SystemTray.IsVisible="True">
|
||||
|
||||
<page:PortraitLandscapePage.Resources>
|
||||
<conv:BoolToVisibilityConverter x:Key="VisConverter"/>
|
||||
</page:PortraitLandscapePage.Resources>
|
||||
|
||||
<!-- LayoutRoot -->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -39,7 +45,7 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid x:Name="NewsTextGrid" Grid.Row="0" Visibility="{Binding Path=TextVisibility, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<Grid x:Name="NewsTextGrid" Grid.Row="0" Visibility="{Binding Path=TextVisibility, Mode=OneWay, Converter={StaticResource VisConverter}}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" MaxHeight="300"/>
|
||||
<RowDefinition Height="*" />
|
||||
@@ -51,7 +57,7 @@
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
|
||||
<phone:WebBrowser x:Name="NewsWebBrowser" Source="{Binding Path=Link, Mode=OneWay}" Grid.Row="0" IsScriptEnabled="True" Visibility="{Binding Path=BrowserVisibility, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||
<phone:WebBrowser x:Name="NewsWebBrowser" Source="{Binding Path=Link, Mode=OneWay}" Grid.Row="0" IsScriptEnabled="True" Visibility="{Binding Path=BrowserVisibility, Mode=OneWay, Converter={StaticResource VisConverter}}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.ItemTemplate>
|
||||
|
||||
@@ -345,25 +345,29 @@ namespace CampusAppWP8.Pages
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary> Event handler. Called by TimeTable for click events. </summary>
|
||||
/// <remarks> Fiedler, 26.11.2013. </remarks>
|
||||
/// <param name="sender"> Caller of the function. </param>
|
||||
/// <param name="e"> Routed event information. </param>
|
||||
private void TimeTable_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(this.Orientation.Equals(PageOrientation.Landscape)
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape)
|
||||
|| this.Orientation.Equals(PageOrientation.LandscapeLeft)
|
||||
|| this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
this.TimeTableAppButton.Url = Constants.PathTimeTable_Week;
|
||||
}
|
||||
else
|
||||
if(this.Orientation.Equals(PageOrientation.Portrait)
|
||||
|| this.Orientation.Equals(PageOrientation.PortraitDown)
|
||||
|| this.Orientation.Equals(PageOrientation.PortraitUp))
|
||||
{
|
||||
this.TimeTableAppButton.Url = Constants.PathTimeTable_Day;
|
||||
}
|
||||
if (this.Orientation.Equals(PageOrientation.Portrait)
|
||||
|| this.Orientation.Equals(PageOrientation.PortraitDown)
|
||||
|| this.Orientation.Equals(PageOrientation.PortraitUp))
|
||||
{
|
||||
this.TimeTableAppButton.Url = Constants.PathTimeTable_Day;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -95,6 +95,14 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
}
|
||||
else
|
||||
{
|
||||
string dayStr = string.Empty;
|
||||
|
||||
if (NavigationContext.QueryString.TryGetValue(Constants.ParamDay, out dayStr))
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
this.ThePivot.ItemsSource = this.itemList;
|
||||
this.lastSelectedIndex = PIVOT_ITEM_PAGES_HALF_DOWN;
|
||||
this.ThePivot.SelectedIndex = PIVOT_ITEM_PAGES_HALF_DOWN;
|
||||
|
||||
@@ -34,7 +34,8 @@
|
||||
Appointments="{Binding Path=AppointmentList, Mode=OneWay}"
|
||||
WeekNumber="{Binding Path=WeekNr, Mode=OneWay}"
|
||||
Days="5"
|
||||
ToDayColoring="True"/>
|
||||
ToDayColoring="True"
|
||||
SelectedDay="{Binding Path=SelectedDay, Mode=TwoWay}"/>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.ItemTemplate>
|
||||
</phone:Pivot>
|
||||
|
||||
@@ -398,7 +398,15 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
|| e.Orientation.Equals(PageOrientation.PortraitDown)
|
||||
|| e.Orientation.Equals(PageOrientation.PortraitUp))
|
||||
{
|
||||
NavigationService.Navigate(new Uri(Constants.PathTimeTable_Day, UriKind.Relative));
|
||||
string url = Constants.PathTimeTable_Day;
|
||||
|
||||
if ((this.ThePivot.SelectedItem as WeekViewPageItem).SelectedDay.Date.Equals(DateTime.MinValue.Date) == false)
|
||||
{
|
||||
url += "?" + Constants.ParamDay + "=" + (this.ThePivot.SelectedItem as WeekViewPageItem).SelectedDay.ToLongDateString();
|
||||
}
|
||||
|
||||
Uri newUri = new Uri(url , UriKind.Relative);
|
||||
NavigationService.Navigate(newUri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
/// <summary> List of appointments. </summary>
|
||||
private ObservableCollection<AppointmentModel> appointmentList = null;
|
||||
|
||||
/// <summary> The selected day. </summary>
|
||||
private DateTime selectedDay = DateTime.MinValue;
|
||||
|
||||
/// <summary> Tritt ein, wenn sich ein Eigenschaftswert ändert. </summary>
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
@@ -149,6 +152,21 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the selected day. </summary>
|
||||
/// <value> The selected day. </value>
|
||||
public DateTime SelectedDay
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.selectedDay;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.selectedDay = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Notifies a property changed. </summary>
|
||||
/// <remarks> Fiedler, 06.11.2013. </remarks>
|
||||
/// <param name="info"> The information. </param>
|
||||
|
||||
@@ -678,4 +678,7 @@
|
||||
<data name="Setting_Mensa_DefaultCampus" xml:space="preserve">
|
||||
<value>MensaDefaultCampus</value>
|
||||
</data>
|
||||
<data name="ParamDay" xml:space="preserve">
|
||||
<value>paramday</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -717,6 +717,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die paramday ähnelt.
|
||||
/// </summary>
|
||||
public static string ParamDay {
|
||||
get {
|
||||
return ResourceManager.GetString("ParamDay", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Studiengang ähnelt.
|
||||
/// </summary>
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
x:Name="root">
|
||||
x:Name="root"
|
||||
>
|
||||
|
||||
<UserControl.Resources>
|
||||
<conv:BoolToVisibilityConverter x:Key="VisConverter"/>
|
||||
@@ -178,31 +179,31 @@
|
||||
</Border>
|
||||
<!--monday-->
|
||||
<Border x:Name="MonBorder" Grid.Row="0" Grid.Column="1" Visibility="{Binding Day_1_Visibility, ElementName=root, Converter={StaticResource VisConverter}}">
|
||||
<weekView:WeekViewDay x:Name="MonList" BgListElements="24" BgListElementHeight="40"/>
|
||||
<weekView:WeekViewDay x:Name="MonList" BgListElements="24" BgListElementHeight="40" SelectedDate="{Binding SelectedDay, ElementName=root, Mode=TwoWay}"/>
|
||||
</Border>
|
||||
<!--tuesday-->
|
||||
<Border x:Name="TueBorder" Grid.Row="0" Grid.Column="2" Visibility="{Binding Day_2_Visibility, ElementName=root, Converter={StaticResource VisConverter}}">
|
||||
<weekView:WeekViewDay x:Name="TueList" BgListElements="24" BgListElementHeight="40" />
|
||||
<weekView:WeekViewDay x:Name="TueList" BgListElements="24" BgListElementHeight="40" SelectedDate="{Binding SelectedDay, ElementName=root, Mode=TwoWay}"/>
|
||||
</Border>
|
||||
<!--wednesday-->
|
||||
<Border x:Name="WedBorder" Grid.Row="0" Grid.Column="3" Visibility="{Binding Day_3_Visibility, ElementName=root, Converter={StaticResource VisConverter}}">
|
||||
<weekView:WeekViewDay x:Name="WedList" BgListElements="24" BgListElementHeight="40" />
|
||||
<weekView:WeekViewDay x:Name="WedList" BgListElements="24" BgListElementHeight="40" SelectedDate="{Binding SelectedDay, ElementName=root, Mode=TwoWay}"/>
|
||||
</Border>
|
||||
<!--thursday-->
|
||||
<Border x:Name="ThuBorder" Grid.Row="0" Grid.Column="4" Visibility="{Binding Day_4_Visibility, ElementName=root, Converter={StaticResource VisConverter}}">
|
||||
<weekView:WeekViewDay x:Name="ThuList" BgListElements="24" BgListElementHeight="40" />
|
||||
<weekView:WeekViewDay x:Name="ThuList" BgListElements="24" BgListElementHeight="40" SelectedDate="{Binding SelectedDay, ElementName=root, Mode=TwoWay}"/>
|
||||
</Border>
|
||||
<!--friday-->
|
||||
<Border x:Name="FriBorder" Grid.Row="0" Grid.Column="5" Visibility="{Binding Day_5_Visibility, ElementName=root, Converter={StaticResource VisConverter}}">
|
||||
<weekView:WeekViewDay x:Name="FriList" BgListElements="24" BgListElementHeight="40" />
|
||||
<weekView:WeekViewDay x:Name="FriList" BgListElements="24" BgListElementHeight="40" SelectedDate="{Binding SelectedDay, ElementName=root, Mode=TwoWay}"/>
|
||||
</Border>
|
||||
<!--saturday-->
|
||||
<Border x:Name="SatBorder" Grid.Row="0" Grid.Column="6" Visibility="{Binding Day_6_Visibility, ElementName=root, Converter={StaticResource VisConverter}}">
|
||||
<weekView:WeekViewDay x:Name="SatList" BgListElements="24" BgListElementHeight="40"/>
|
||||
<weekView:WeekViewDay x:Name="SatList" BgListElements="24" BgListElementHeight="40" SelectedDate="{Binding SelectedDay, ElementName=root, Mode=TwoWay}"/>
|
||||
</Border>
|
||||
<!--sunday-->
|
||||
<Border x:Name="SunBorder" Grid.Row="0" Grid.Column="7" Visibility="{Binding Day_7_Visibility, ElementName=root, Converter={StaticResource VisConverter}}">
|
||||
<weekView:WeekViewDay x:Name="SunList" BgListElements="24" BgListElementHeight="40"/>
|
||||
<weekView:WeekViewDay x:Name="SunList" BgListElements="24" BgListElementHeight="40" SelectedDate="{Binding SelectedDay, ElementName=root, Mode=TwoWay}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<!-- </Canvas> -->
|
||||
|
||||
@@ -37,10 +37,15 @@ namespace CampusAppWP8.Utility.Lui.Templates
|
||||
/// <summary> The week number property. </summary>
|
||||
public static readonly DependencyProperty WeekNumberProperty = DependencyProperty.Register("WeekNumber", typeof(int), typeof(WeekView), new PropertyMetadata(-1));
|
||||
|
||||
/// <summary> The head visible property. </summary>
|
||||
public static readonly DependencyProperty HeadVisibleProperty = DependencyProperty.Register("HeadVisible", typeof(bool), typeof(WeekView), new PropertyMetadata(true));
|
||||
|
||||
/// <summary> to day coloring property. </summary>
|
||||
public static readonly DependencyProperty ToDayColoringProperty = DependencyProperty.Register("ToDayColoring", typeof(bool), typeof(WeekView), new PropertyMetadata(false));
|
||||
|
||||
|
||||
/// <summary> The selected day property. </summary>
|
||||
public static readonly DependencyProperty SelectedDayProperty = DependencyProperty.Register("SelectedDay", typeof(DateTime), typeof(WeekView), new PropertyMetadata(null));
|
||||
|
||||
/// <summary> List of borders. </summary>
|
||||
private List<Border> borderList = new List<Border>();
|
||||
/// <summary> List of days. </summary>
|
||||
@@ -390,6 +395,19 @@ namespace CampusAppWP8.Utility.Lui.Templates
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime SelectedDay
|
||||
{
|
||||
get
|
||||
{
|
||||
return (DateTime)this.GetValue(SelectedDayProperty);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.SetValue(SelectedDayProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Sets column background. </summary>
|
||||
/// <remarks> Fiedler, 06.11.2013. </remarks>
|
||||
/// <param name="column"> The column. </param>
|
||||
|
||||
@@ -33,7 +33,8 @@
|
||||
Canvas.ZIndex="1"
|
||||
Height="{Binding Path=ActualHeight, ElementName=MainCanvas, Mode=OneWay}"
|
||||
Width="{Binding Path=Width, ElementName=MainCanvas, Mode=OneWay, Converter={StaticResource NaNConverter}}"
|
||||
/>
|
||||
Tap="BGCanvas_Tap"
|
||||
Background="Transparent"/>
|
||||
<Canvas
|
||||
x:Name="UserCanvas"
|
||||
Canvas.ZIndex="2"
|
||||
|
||||
@@ -43,6 +43,12 @@ namespace CampusAppWP8.Utility.Lui.Templates
|
||||
/// <summary> The appointments property. </summary>
|
||||
public static readonly DependencyProperty AppointmentsProperty = DependencyProperty.Register("Appointments", typeof(ObservableCollection<AppointmentModel>), typeof(WeekViewDay), new PropertyMetadata(null, OnAppointmentsChanged));
|
||||
|
||||
/// <summary> The selected date property. </summary>
|
||||
public static readonly DependencyProperty SelectedDateProperty = DependencyProperty.Register("SelectedDate", typeof(DateTime), typeof(WeekViewDay), new PropertyMetadata(DateTime.MinValue, OnSelectedDateChanged));
|
||||
|
||||
/// <summary> The selected property. </summary>
|
||||
public static readonly DependencyProperty SelectedProperty = DependencyProperty.Register("Selected", typeof(bool), typeof(WeekViewDay), new PropertyMetadata(false));
|
||||
|
||||
/// <summary> The stacks. </summary>
|
||||
private List<List<AppointmentModel>> stacks = new List<List<AppointmentModel>>();
|
||||
|
||||
@@ -79,6 +85,43 @@ namespace CampusAppWP8.Utility.Lui.Templates
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Raises the dependency property changed event. </summary>
|
||||
/// <remarks> Fiedler, 26.11.2013. </remarks>
|
||||
/// <param name="o"> The DependencyObject to process. </param>
|
||||
/// <param name="e"> Event information to send to registered event handlers. </param>
|
||||
private static void OnSelectedDateChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.NewValue != null && e.OldValue != null)
|
||||
{
|
||||
if (((DateTime)e.NewValue).Date.Equals((o as WeekViewDay).Date.Date)
|
||||
&& ((DateTime)e.OldValue).Date.Equals((o as WeekViewDay).Date.Date))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (e.NewValue != null)
|
||||
{
|
||||
if (((DateTime)e.NewValue).Date.Equals((o as WeekViewDay).Date.Date))
|
||||
{
|
||||
SolidColorBrush newBG = new SolidColorBrush(Colors.LightGray);
|
||||
newBG.Opacity = 0.5;
|
||||
|
||||
(o as WeekViewDay).BGCanvas.Background = newBG;
|
||||
}
|
||||
}
|
||||
|
||||
if (e.OldValue != null)
|
||||
{
|
||||
if (((DateTime)e.OldValue).Date.Equals((o as WeekViewDay).Date.Date))
|
||||
{
|
||||
SolidColorBrush newBG = new SolidColorBrush(Colors.Transparent);
|
||||
|
||||
(o as WeekViewDay).BGCanvas.Background = newBG;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Raises the notify collection changed event. </summary>
|
||||
/// <remarks> Fiedler, 06.11.2013. </remarks>
|
||||
/// <param name="s"> The object to process. </param>
|
||||
@@ -178,6 +221,43 @@ namespace CampusAppWP8.Utility.Lui.Templates
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the selected date. </summary>
|
||||
/// <value> The selected date. </value>
|
||||
public DateTime SelectedDate
|
||||
{
|
||||
get
|
||||
{
|
||||
return (DateTime)this.GetValue(SelectedDateProperty);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.SetValue(SelectedDateProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets a value indicating whether the selected. </summary>
|
||||
/// <value> true if selected, false if not. </value>
|
||||
public bool Selected
|
||||
{
|
||||
get
|
||||
{
|
||||
return (this.Date.Date.Equals(this.SelectedDate.Date));
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value == true)
|
||||
{
|
||||
this.SelectedDate = this.Date;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.SelectedDate = DateTime.MinValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Check stack add. </summary>
|
||||
/// <remarks> Fiedler, 06.11.2013. </remarks>
|
||||
/// <param name="model"> The model. </param>
|
||||
@@ -422,13 +502,6 @@ namespace CampusAppWP8.Utility.Lui.Templates
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
protected override void OnDoubleTap(System.Windows.Input.GestureEventArgs e)
|
||||
{
|
||||
base.OnDoubleTap(e);
|
||||
}
|
||||
*/
|
||||
|
||||
/// <summary> Draw lines. </summary>
|
||||
/// <remarks> Fiedler, 22.10.2013. </remarks>
|
||||
private void DrawLines()
|
||||
@@ -465,5 +538,10 @@ namespace CampusAppWP8.Utility.Lui.Templates
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void BGCanvas_Tap(object sender, System.Windows.Input.GestureEventArgs e)
|
||||
{
|
||||
this.Selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user