i can see a weekview
This commit is contained in:
@@ -17,17 +17,21 @@
|
||||
|
||||
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<phone:Pivot x:Name="ThePivot" SelectionChanged="OnPivotSelectionChanged" LoadedPivotItem="ThePivot_LoadedPivotItem" LoadingPivotItem="ThePivot_LoadingPivotItem">
|
||||
<phone:Pivot x:Name="ThePivot" SelectionChanged="OnPivotSelectionChanged" LoadedPivotItem="ThePivot_LoadedPivotItem" LoadingPivotItem="ThePivot_LoadedPivotItem">
|
||||
<phone:Pivot.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<header:WeekViewPivotHeader />
|
||||
<TextBlock Text="header" Visibility="Collapsed"/>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.HeaderTemplate>
|
||||
<phone:Pivot.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Visible" Loaded="ScrollViewer_Loaded" Background="LightGoldenrodYellow">
|
||||
<templ:WeekView x:Name="TheWeekView" Loaded="TheWeekView_Loaded" StartDate="{Binding DateFrom, Mode=OneTime}"/>
|
||||
</ScrollViewer>
|
||||
<templ:WeekView
|
||||
x:Name="TheWeekView"
|
||||
Margin="0,-36,0,0"
|
||||
DateFrom="{Binding DateFrom, Mode=OneWay}"
|
||||
WeekName="{Binding WeekChar, Mode=OneWay}"
|
||||
Appointments="{Binding AppointmentList, Mode=OneWay}"
|
||||
WeekNumber="{Binding WeekNumber, Mode=OneWay}"/>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.ItemTemplate>
|
||||
</phone:Pivot>
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWP8.Utility.Lui.Templates;
|
||||
using CampusAppWP8.Utility.Lui.Header;
|
||||
using System.Windows.Data;
|
||||
|
||||
public partial class TimeTableWeek : PhoneApplicationPage
|
||||
{
|
||||
@@ -41,8 +42,7 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
public int WeekNumber { get; set; }
|
||||
public WeekView weekView { get; set; }
|
||||
//???
|
||||
public List<Appointment> appointmentList { get; set; }
|
||||
public PivotItem pItemPtr { get; set; }
|
||||
public List<Appointment> AppointmentList { get; set; }
|
||||
}
|
||||
|
||||
private static readonly int PIVOT_PAGES = 3;
|
||||
@@ -51,7 +51,6 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
|
||||
private PageItem[] itemPages = new PageItem[PIVOT_PAGES];
|
||||
private int lastSelectedIndex = 0;
|
||||
private int loadedWeekView = 0;
|
||||
|
||||
public TimeTableWeek()
|
||||
{
|
||||
@@ -63,6 +62,8 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
{
|
||||
this.itemPages[i].DateFrom = firstDay;
|
||||
this.itemPages[i].DateTo = firstDay.AddDays(6);
|
||||
this.itemPages[i].WeekNumber = this.GetWeekNumber(this.itemPages[i].DateFrom);
|
||||
this.itemPages[i].WeekChar = ((this.itemPages[i].WeekNumber % 2) != 0) ? 'A' : 'B';
|
||||
firstDay = firstDay.AddDays(7);
|
||||
}
|
||||
|
||||
@@ -119,6 +120,16 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
return retValue;
|
||||
}
|
||||
|
||||
private int GetWeekNumber(DateTime date)
|
||||
{
|
||||
int retValue = 0;
|
||||
|
||||
var cal = System.Globalization.DateTimeFormatInfo.CurrentInfo.Calendar;
|
||||
retValue = cal.GetWeekOfYear(date, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Monday);
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
private int GetDayOfWeekIndex(DateTime dayInWeek)
|
||||
{
|
||||
int retValue = -1;
|
||||
@@ -157,10 +168,7 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
{
|
||||
this.itemPages[i].DateFrom = firstDay;
|
||||
this.itemPages[i].DateTo = this.itemPages[i].DateFrom.AddDays(6);
|
||||
this.itemPages[i].WeekNumber = System.Globalization.DateTimeFormatInfo.CurrentInfo.Calendar.GetWeekOfYear(
|
||||
this.itemPages[i].DateFrom,
|
||||
System.Globalization.CalendarWeekRule.FirstDay,
|
||||
DayOfWeek.Monday);
|
||||
this.itemPages[i].WeekNumber = this.GetWeekNumber(this.itemPages[i].DateFrom);
|
||||
this.itemPages[i].WeekChar = ((this.itemPages[i].WeekNumber % 2) == 0) ? 'B' : 'A';
|
||||
|
||||
firstDay = firstDay.AddDays(7);
|
||||
@@ -625,25 +633,6 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
*/
|
||||
}
|
||||
|
||||
private void CreatePage(int itemIndex, DateTime weekStart)
|
||||
{
|
||||
// this.itemPages[itemIndex].Content = new Canvas();
|
||||
// this.itemPages[itemIndex].Content.Height = WEEK_TABLE_CELL_HEIGHT * 24;
|
||||
this.itemPages[itemIndex].DateFrom = weekStart;
|
||||
this.itemPages[itemIndex].DateTo = weekStart.AddDays(6);
|
||||
// this.itemPages[itemIndex].WeekNumber = System.Globalization.DateTimeFormatInfo.CurrentInfo.Calendar.GetWeekOfYear(
|
||||
// weekStart,
|
||||
// System.Globalization.CalendarWeekRule.FirstDay,
|
||||
// DayOfWeek.Monday);
|
||||
// this.itemPages[itemIndex].WeekChar = ((this.itemPages[itemIndex].WeekNumber % 2) == 0) ? 'B' : 'A';
|
||||
|
||||
//PivotItem pvItem = new PivotItem();
|
||||
//Grid headGrid = new Grid();
|
||||
//pvItem.Header = headGrid;
|
||||
|
||||
//this.ThePivot.Items.Add(pvItem);
|
||||
}
|
||||
|
||||
private void RemoveContentUIElement(int index, UIElement elem)
|
||||
{
|
||||
// if (this.itemPages[index].Content.Children.Remove(elem) == false)
|
||||
@@ -747,7 +736,46 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
|
||||
// this.itemPages[index].Content.Children.Add(can);
|
||||
}
|
||||
/*
|
||||
private PageItem CreatePivotItem(PageItem pItem)
|
||||
{
|
||||
pItem.pItemPtr = new PivotItem();
|
||||
pItem.pItemPtr.Header = new Grid();
|
||||
|
||||
pItem.weekView = new WeekView();
|
||||
pItem.weekView.Name = "TheWeekView";
|
||||
pItem.weekView.StartDate = pItem.DateFrom;
|
||||
|
||||
WeekViewPivotHeader wvpHeader = new WeekViewPivotHeader();
|
||||
wvpHeader.DateFrom = pItem.DateFrom;
|
||||
|
||||
Grid g = (pItem.pItemPtr.Header as Grid);
|
||||
|
||||
Binding colLineBind = new Binding();
|
||||
colLineBind.Path = new PropertyPath("ActualWidth");
|
||||
colLineBind.ElementName = "TheWeekView";
|
||||
colLineBind.Mode = BindingMode.OneWay;
|
||||
|
||||
g.SetBinding(WidthProperty, colLineBind);
|
||||
g.Children.Clear();
|
||||
//wvpHeader.Width = g.Width;
|
||||
//g.Children.Add(wvpHeader);
|
||||
|
||||
RowDefinition row = new RowDefinition();
|
||||
row.Height = GridLength.Auto;
|
||||
g.RowDefinitions.Add(row);
|
||||
|
||||
g.Background = new SolidColorBrush(Colors.Green);
|
||||
TextBlock tb = new TextBlock();
|
||||
tb.Text = "hallo";
|
||||
tb.SetValue(Grid.RowProperty, 0);
|
||||
g.Children.Add(tb);
|
||||
|
||||
pItem.pItemPtr.Content = pItem.weekView;
|
||||
|
||||
return pItem;
|
||||
}
|
||||
*/
|
||||
private void DrawHeader(int index)
|
||||
{
|
||||
Grid grid = ((this.ThePivot.Items[index] as PivotItem).Header as Grid);
|
||||
@@ -810,29 +838,9 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
grid.Children.Add(headCan);
|
||||
}
|
||||
|
||||
private void ScrollViewer_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void TheWeekView_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// this.itemPages[this.loadedWeekView].weekView = sender as WeekView;
|
||||
this.loadedWeekView++;
|
||||
}
|
||||
|
||||
private void ThePivot_LoadedPivotItem(object sender, PivotItemEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private void Grid_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void ThePivot_LoadingPivotItem(object sender, PivotItemEventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -204,6 +204,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die KW ähnelt.
|
||||
/// </summary>
|
||||
public static string Calendar_Week_Short {
|
||||
get {
|
||||
return ResourceManager.GetString("Calendar_Week_Short", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Gebäudeinfos ausblenden ähnelt.
|
||||
/// </summary>
|
||||
|
||||
@@ -596,4 +596,7 @@
|
||||
<data name="Time_Day_Wednesday_Short" xml:space="preserve">
|
||||
<value>Mi</value>
|
||||
</data>
|
||||
<data name="Calendar_Week_Short" xml:space="preserve">
|
||||
<value>KW</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -10,65 +10,123 @@
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
>
|
||||
|
||||
<Grid x:Name="TheGrid" Background="Transparent" Height="960">
|
||||
<Grid.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="BorderBrush" Value="White"/>
|
||||
<Setter Property="BorderThickness" Value="2"/>
|
||||
</Style>
|
||||
</Grid.Resources>
|
||||
|
||||
<Grid x:Name="ContentRoot">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<!--left time line-->
|
||||
<ColumnDefinition Width="40" x:Name="Col_0"/>
|
||||
<!--monday-->
|
||||
<ColumnDefinition Width="*" x:Name="Col_1"/>
|
||||
<!--tuesday-->
|
||||
<ColumnDefinition Width="*" x:Name="Col_2"/>
|
||||
<!--wednesday-->
|
||||
<ColumnDefinition Width="*" x:Name="Col_3"/>
|
||||
<!--thursday-->
|
||||
<ColumnDefinition Width="*" x:Name="Col_4"/>
|
||||
<!--friday-->
|
||||
<ColumnDefinition Width="*" x:Name="Col_5"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid x:Name="Head_Date" Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="40"/>
|
||||
<ColumnDefinition Width="40"/>
|
||||
<ColumnDefinition Width="40"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock x:Name="TB_KW" Grid.Column="0" Text="{Binding Path=LocalizedResources.Calendar_Week_Short, Source={StaticResource LocalizedStrings}}" FontStretch="SemiExpanded" FontSize="20"/>
|
||||
<TextBlock x:Name="TB_KW_NUM" Grid.Column="1" Text="{Binding WeekNumber, Mode=OneWay}" FontStretch="Expanded" FontSize="20"/>
|
||||
<TextBlock x:Name="TB_From" Grid.Column="2" Text="{Binding DateFrom, Mode=OneWay, StringFormat='dd.MM.yyyy'}" HorizontalAlignment="Center" FontSize="20"/>
|
||||
<TextBlock Grid.Column="3" Text="<" HorizontalAlignment="Center" FontSize="20"/>
|
||||
<TextBlock x:Name="TB_Week_Char" Grid.Column="4" Text="{Binding WeekName, Mode=OneWay}" HorizontalAlignment="Center" FontSize="20"/>
|
||||
<TextBlock Grid.Column="5" Text=">" HorizontalAlignment="Center" FontSize="20"/>
|
||||
<TextBlock x:Name="TB_To" Grid.Column="6" Text="{Binding DateTo, Mode=OneWay, StringFormat='dd.MM.yyyy'}" HorizontalAlignment="Center" FontSize="20"/>
|
||||
</Grid>
|
||||
|
||||
<!--time line-->
|
||||
<Border x:Name="TimeBorder" Grid.Row="0" Grid.Column="0">
|
||||
<lui:ListBoxFixed x:Name="TimeList" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled" SelectionMode="Single">
|
||||
<lui:ListBoxFixed.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Canvas Height="40" Width="40">
|
||||
<TextBlock Text="{Binding}" Canvas.Left="0" Canvas.Top="0" FontSize="12"/>
|
||||
<Line X1="29" Y1="19" X2="39" Y2="19" StrokeThickness="2" Stroke="White"/>
|
||||
<Line X1="0" Y1="0" X2="39" Y2="0" StrokeThickness="1" Stroke="Gray"/>
|
||||
</Canvas>
|
||||
</DataTemplate>
|
||||
</lui:ListBoxFixed.ItemTemplate>
|
||||
</lui:ListBoxFixed>
|
||||
</Border>
|
||||
<!--monday-->
|
||||
<Border x:Name="MonBorder" Grid.Row="0" Grid.Column="1">
|
||||
<weekView:WeekViewDay x:Name="MonList" BgListElements="24" BgListElementHeight="40"/>
|
||||
</Border>
|
||||
<!--tuesday-->
|
||||
<Border x:Name="TueBorder" Grid.Row="0" Grid.Column="2">
|
||||
<weekView:WeekViewDay x:Name="TueList" BgListElements="24" BgListElementHeight="40" />
|
||||
</Border>
|
||||
<!--wednesday-->
|
||||
<Border x:Name="WedBorder" Grid.Row="0" Grid.Column="3">
|
||||
<weekView:WeekViewDay x:Name="WedList" BgListElements="24" BgListElementHeight="40" />
|
||||
</Border>
|
||||
<!--thursday-->
|
||||
<Border x:Name="ThuBorder" Grid.Row="0" Grid.Column="4">
|
||||
<weekView:WeekViewDay x:Name="ThuList" BgListElements="24" BgListElementHeight="40" />
|
||||
</Border>
|
||||
<!--friday-->
|
||||
<Border x:Name="FriBorder" Grid.Row="0" Grid.Column="5">
|
||||
<weekView:WeekViewDay x:Name="FriList" BgListElements="24" BgListElementHeight="40" />
|
||||
</Border>
|
||||
<Grid x:Name="Head_Days" Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="40"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
<Border Grid.Column="1" BorderThickness="2" BorderBrush="White" Background="DarkGoldenrod">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Time_Day_Monday_Short, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<Border Grid.Column="2" BorderThickness="2" BorderBrush="White" Background="DarkGoldenrod">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Time_Day_Tuesday_Short, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<Border Grid.Column="3" BorderThickness="2" BorderBrush="White" Background="DarkGoldenrod">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Time_Day_Wednesday_Short, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<Border Grid.Column="4" BorderThickness="2" BorderBrush="White" Background="DarkGoldenrod">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Time_Day_Thursday_Short, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<Border Grid.Column="5" BorderThickness="2" BorderBrush="White" Background="DarkGoldenrod">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Time_Day_Friday_Short, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<ScrollViewer x:Name="TheScrollView" Grid.Row="2">
|
||||
<Grid x:Name="TheGrid" Background="Transparent" Height="960">
|
||||
<Grid.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="BorderBrush" Value="White"/>
|
||||
<Setter Property="BorderThickness" Value="2"/>
|
||||
</Style>
|
||||
</Grid.Resources>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<!--left time line-->
|
||||
<ColumnDefinition Width="40" x:Name="Col_0"/>
|
||||
<!--monday-->
|
||||
<ColumnDefinition Width="*" x:Name="Col_1"/>
|
||||
<!--tuesday-->
|
||||
<ColumnDefinition Width="*" x:Name="Col_2"/>
|
||||
<!--wednesday-->
|
||||
<ColumnDefinition Width="*" x:Name="Col_3"/>
|
||||
<!--thursday-->
|
||||
<ColumnDefinition Width="*" x:Name="Col_4"/>
|
||||
<!--friday-->
|
||||
<ColumnDefinition Width="*" x:Name="Col_5"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--time line-->
|
||||
<Border x:Name="TimeBorder" Grid.Row="0" Grid.Column="0">
|
||||
<lui:ListBoxFixed x:Name="TimeList" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled" SelectionMode="Single">
|
||||
<lui:ListBoxFixed.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Canvas Height="40" Width="40">
|
||||
<TextBlock Text="{Binding}" Canvas.Left="0" Canvas.Top="0" FontSize="12"/>
|
||||
<Line X1="29" Y1="19" X2="39" Y2="19" StrokeThickness="2" Stroke="White"/>
|
||||
<Line X1="0" Y1="0" X2="39" Y2="0" StrokeThickness="1" Stroke="Gray"/>
|
||||
</Canvas>
|
||||
</DataTemplate>
|
||||
</lui:ListBoxFixed.ItemTemplate>
|
||||
</lui:ListBoxFixed>
|
||||
</Border>
|
||||
<!--monday-->
|
||||
<Border x:Name="MonBorder" Grid.Row="0" Grid.Column="1">
|
||||
<weekView:WeekViewDay x:Name="MonList" BgListElements="24" BgListElementHeight="40"/>
|
||||
</Border>
|
||||
<!--tuesday-->
|
||||
<Border x:Name="TueBorder" Grid.Row="0" Grid.Column="2">
|
||||
<weekView:WeekViewDay x:Name="TueList" BgListElements="24" BgListElementHeight="40" />
|
||||
</Border>
|
||||
<!--wednesday-->
|
||||
<Border x:Name="WedBorder" Grid.Row="0" Grid.Column="3">
|
||||
<weekView:WeekViewDay x:Name="WedList" BgListElements="24" BgListElementHeight="40" />
|
||||
</Border>
|
||||
<!--thursday-->
|
||||
<Border x:Name="ThuBorder" Grid.Row="0" Grid.Column="4">
|
||||
<weekView:WeekViewDay x:Name="ThuList" BgListElements="24" BgListElementHeight="40" />
|
||||
</Border>
|
||||
<!--friday-->
|
||||
<Border x:Name="FriBorder" Grid.Row="0" Grid.Column="5">
|
||||
<weekView:WeekViewDay x:Name="FriList" BgListElements="24" BgListElementHeight="40" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -17,10 +17,16 @@ namespace CampusAppWP8.Utility.Lui.Templates
|
||||
using System.Windows.Media;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Shell;
|
||||
using CampusAppWP8.Model.TimeTable;
|
||||
|
||||
public partial class WeekView : UserControl
|
||||
{
|
||||
public static readonly DependencyProperty StartDateProperty = DependencyProperty.Register("StartDate", typeof(DateTime), typeof(WeekView), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty DateFromProperty = DependencyProperty.Register("DateFrom", typeof(DateTime), typeof(WeekView), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty DateToProperty = DependencyProperty.Register("DateTo", typeof(DateTime), typeof(WeekView), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty DaysProperty = DependencyProperty.Register("Days", typeof(int), typeof(WeekView), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty AppointmentsProperty = DependencyProperty.Register("Appointments", typeof(List<AppointmentModel>), typeof(WeekView), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty WeekNameProperty = DependencyProperty.Register("WeekName", typeof(string), typeof(WeekView), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty WeekNumberProperty = DependencyProperty.Register("WeekNumber", typeof(int), typeof(WeekView), new PropertyMetadata(null));
|
||||
|
||||
private List<Border> borderList = new List<Border>();
|
||||
|
||||
@@ -29,21 +35,76 @@ namespace CampusAppWP8.Utility.Lui.Templates
|
||||
|
||||
public WeekView()
|
||||
{
|
||||
this.Days = 5;
|
||||
|
||||
this.InitializeComponent();
|
||||
|
||||
this.InitLayout();
|
||||
}
|
||||
|
||||
public DateTime StartDate
|
||||
public DateTime DateFrom
|
||||
{
|
||||
get
|
||||
{
|
||||
return (DateTime)this.GetValue(StartDateProperty);
|
||||
return (DateTime)this.GetValue(DateFromProperty);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.SetValue(StartDateProperty, value);
|
||||
this.SetValue(DateFromProperty, value);
|
||||
this.SetValue(DateToProperty, value.AddDays(this.Days));
|
||||
}
|
||||
}
|
||||
|
||||
public int Days
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)this.GetValue(DaysProperty);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.SetValue(DaysProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
public List<AppointmentModel> Appointments
|
||||
{
|
||||
get
|
||||
{
|
||||
return (List<AppointmentModel>)this.GetValue(AppointmentsProperty);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.SetValue(AppointmentsProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
public string WeekName
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)this.GetValue(WeekNameProperty);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.SetValue(WeekNameProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
public int WeekNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)this.GetValue(WeekNumberProperty);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.SetValue(WeekNumberProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,12 +131,6 @@ namespace CampusAppWP8.Utility.Lui.Templates
|
||||
this.borderList.Add(this.FriBorder);
|
||||
|
||||
this.TimeList.ItemsSource = this.timeStrings;
|
||||
|
||||
//this.MonList.ItemsSource = this.monStrings;
|
||||
//this.TueList.ItemsSource = this.monStrings;
|
||||
//this.WedList.ItemsSource = this.monStrings;
|
||||
//this.ThuList.ItemsSource = this.monStrings;
|
||||
//this.FriList.ItemsSource = this.monStrings;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user