TimeTable done
This commit is contained in:
@@ -24,14 +24,6 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
|
||||
public partial class TimeTableDay : PhoneApplicationPage
|
||||
{
|
||||
private readonly double DAY_TABLE_HEAD_WIDTH = 48;// * (1 + (TimeTable.VisualScale / 4));
|
||||
private readonly double DAY_TABLE_HEAD_HALF = 8;// * (1 + (TimeTable.VisualScale / 4));
|
||||
private readonly double DAY_TABLE_CELL_HEIGHT = 72;// * (1 + (TimeTable.VisualScale / 2));
|
||||
private readonly double DAY_TABLE_HEAD_THICKNESS = 2;
|
||||
private readonly double DAY_TABLE_INNER_THICKNESS = 1;
|
||||
private readonly double DAY_TABLE_ZINDEX_SHIFT = 10;
|
||||
private readonly int DAY_TABLE_ZINDEX_MAX = 10;
|
||||
|
||||
private static readonly int PIVOT_ITEM_PAGES = 5;
|
||||
private static readonly int PIVOT_ITEM_PAGES_HALF_DOWN = 2;
|
||||
|
||||
@@ -136,7 +128,7 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
TimeTable.Feed.Model.Appointments.CollectionChanged += new NotifyCollectionChangedEventHandler(this.OnListChanged);
|
||||
TimeTable.Feed.Model.Appointments.CollectionChanged += this.OnListChanged;
|
||||
|
||||
string urlString = Constants.PathTimeTable_Appointment + "?" + Constants.Param_Appointment_Index + "=" + index;
|
||||
|
||||
@@ -146,107 +138,102 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
}
|
||||
}
|
||||
|
||||
private void EventOnMultiBubbleClick(object sender, System.Windows.Input.GestureEventArgs e)
|
||||
{
|
||||
/*
|
||||
int indexVal = (int)(sender as Canvas).Tag;
|
||||
int index = indexVal >> 12;
|
||||
int listIndex = indexVal & 0x00000FFF;
|
||||
|
||||
AppointmentModel tempModelCan = this.itemPages[index].Stacks[listIndex].First();
|
||||
this.itemPages[index].Stacks[listIndex].Remove(tempModelCan);
|
||||
this.itemPages[index].Stacks[listIndex].Add(tempModelCan);
|
||||
|
||||
for (int i = 0; i < this.itemPages[index].Stacks[listIndex].Count(); i++)
|
||||
{
|
||||
this.RemoveContentUIElement(index, this.itemPages[index].Stacks[listIndex][i]);
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
this.DrawAppointmentModel(this.itemPages[index].Stacks[listIndex][i], index, 0.5, i, this.itemPages[index].Stacks[listIndex].Count() - 1 - i);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.DrawAppointmentModel(this.itemPages[index].Stacks[listIndex][i], index, 1.0, i, this.itemPages[index].Stacks[listIndex].Count() - 1 - i);
|
||||
}
|
||||
}
|
||||
|
||||
this.RemoveContentUIElement(index, sender as Canvas);
|
||||
|
||||
Canvas tempCan = this.GetModelCanvasFromContent(index, this.itemPages[index].Stacks[listIndex][0]);
|
||||
|
||||
this.DrawMultiBubble(
|
||||
index,
|
||||
listIndex,
|
||||
this.itemPages[index].Stacks[listIndex].Count(),
|
||||
tempCan.Width + tempCan.Margin.Left,
|
||||
tempCan.Margin.Top);
|
||||
*/
|
||||
}
|
||||
|
||||
private void OnClickWeek(object sender, EventArgs e)
|
||||
{
|
||||
Uri url = new Uri("/Pages/TimeTable/TimeTableWeek.xaml", UriKind.Relative);
|
||||
Uri url = new Uri(Constants.PathTimeTable_Week, UriKind.Relative);
|
||||
Page page = App.RootFrame.Content as Page;
|
||||
page.NavigationService.Navigate(url);
|
||||
}
|
||||
|
||||
private void OnClickToDay(object sender, EventArgs e)
|
||||
{
|
||||
/*
|
||||
DateTime firstDay = DateTime.Now.Date.AddDays(PIVOT_ITEM_PAGES_HALF_DOWN * -1);
|
||||
this.ThePivot.SelectedIndex = PIVOT_ITEM_PAGES_HALF_DOWN;
|
||||
int index = -1;
|
||||
|
||||
for (int i = 0; i < PIVOT_ITEM_PAGES; i++)
|
||||
for (int i = 0; i < this.itemList.Count; i++)
|
||||
{
|
||||
this.itemPages[i].Date = firstDay.AddDays(i);
|
||||
|
||||
this.SetupPage(i);
|
||||
if (this.itemList[i].Day.Date.Equals(DateTime.Today.Date))
|
||||
{
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (index < 0)
|
||||
{
|
||||
DateTime firstDay = DateTime.Now;
|
||||
this.ThePivot.SelectedIndex = PIVOT_ITEM_PAGES_HALF_DOWN;
|
||||
firstDay = firstDay.AddDays(-1 * PIVOT_ITEM_PAGES_HALF_DOWN);
|
||||
|
||||
for (int i = 0; i < PIVOT_ITEM_PAGES; i++)
|
||||
{
|
||||
this.itemList[i].Day = firstDay;
|
||||
this.itemList[i].AppointmentList.Clear();
|
||||
|
||||
this.CheckAppointments(i);
|
||||
|
||||
firstDay = firstDay.AddDays(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ThePivot.SelectedIndex = index;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
private void OnClickProperties(object sender, EventArgs e)
|
||||
{
|
||||
Uri url = new Uri("/Pages/TimeTable/TimeTableProperties.xaml", UriKind.Relative);
|
||||
Uri url = new Uri(Constants.PathTimeTable_Properties, UriKind.Relative);
|
||||
Page page = App.RootFrame.Content as Page;
|
||||
page.NavigationService.Navigate(url);
|
||||
}
|
||||
|
||||
private void OnClickAdd(object sender, EventArgs e)
|
||||
{
|
||||
TimeTable.Feed.Model.Appointments.CollectionChanged += new NotifyCollectionChangedEventHandler(this.OnListChanged);
|
||||
TimeTable.Feed.Model.Appointments.CollectionChanged += this.OnListChanged;
|
||||
|
||||
Uri url = new Uri("/Pages/TimeTable/AppointmentEdit.xaml", UriKind.Relative);
|
||||
Uri url = new Uri(Constants.PathTimeTable_AppointmentEdit, UriKind.Relative);
|
||||
Page page = App.RootFrame.Content as Page;
|
||||
page.NavigationService.Navigate(url);
|
||||
}
|
||||
|
||||
private void OnListChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
/*
|
||||
AppointmentModel tempModel = null;
|
||||
|
||||
if (e.Action == NotifyCollectionChangedAction.Add)
|
||||
{
|
||||
tempModel = e.NewItems[0] as AppointmentModel;
|
||||
}
|
||||
else if (e.Action == NotifyCollectionChangedAction.Remove)
|
||||
{
|
||||
tempModel = e.OldItems[0] as AppointmentModel;
|
||||
}
|
||||
|
||||
if (tempModel != null)
|
||||
{
|
||||
for (int i = 0; i < PIVOT_ITEM_PAGES; i++)
|
||||
for(int i = 0; i < e.NewItems.Count; i++)
|
||||
{
|
||||
if (tempModel.IsDate(this.itemPages[i].Date.Date) > -1)
|
||||
AppointmentModel m = e.NewItems[i] as AppointmentModel;
|
||||
|
||||
for(int a = 0; a < PIVOT_ITEM_PAGES; a++)
|
||||
{
|
||||
this.SetupPage(i);
|
||||
if(m.IsDate(this.itemList[a].Day) == 0)
|
||||
{
|
||||
this.itemList[a].AppointmentList.Add(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
else if (e.Action == NotifyCollectionChangedAction.Remove)
|
||||
{
|
||||
for (int i = 0; i < e.OldItems.Count; i++)
|
||||
{
|
||||
AppointmentModel m = e.OldItems[i] as AppointmentModel;
|
||||
|
||||
for (int a = 0; a < PIVOT_ITEM_PAGES; a++)
|
||||
{
|
||||
if (m.IsDate(this.itemList[a].Day) == 0)
|
||||
{
|
||||
this.itemList[a].AppointmentList.Remove(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (e.Action == NotifyCollectionChangedAction.Reset)
|
||||
{
|
||||
for (int i = 0; i < PIVOT_ITEM_PAGES; i++)
|
||||
{
|
||||
this.itemList[i].AppointmentList.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckAppointments(int index = -1)
|
||||
@@ -281,39 +268,5 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawMultiBubble(int stackIndex, int listIndex, int number, double xOffset, double yOffset)
|
||||
{
|
||||
Canvas can = new Canvas();
|
||||
|
||||
Rectangle rect = new Rectangle();
|
||||
rect.Width = DAY_TABLE_CELL_HEIGHT / 2;
|
||||
rect.Height = DAY_TABLE_CELL_HEIGHT / 2;
|
||||
rect.RadiusX = DAY_TABLE_CELL_HEIGHT / 4;
|
||||
rect.RadiusY = DAY_TABLE_CELL_HEIGHT / 4;
|
||||
rect.StrokeThickness = 1;
|
||||
rect.Stroke = new SolidColorBrush(Colors.DarkGray);
|
||||
rect.Fill = new SolidColorBrush(Colors.Black);
|
||||
|
||||
TextBlock block = new TextBlock();
|
||||
block.Height = DAY_TABLE_CELL_HEIGHT / 2;
|
||||
block.Width = DAY_TABLE_CELL_HEIGHT / 2;
|
||||
block.Text = "" + number;
|
||||
block.HorizontalAlignment = HorizontalAlignment.Center;
|
||||
block.VerticalAlignment = VerticalAlignment.Center;
|
||||
block.FontWeight = FontWeights.Bold;
|
||||
block.FontSize = DAY_TABLE_CELL_HEIGHT / 3;
|
||||
block.Padding = new Thickness(DAY_TABLE_CELL_HEIGHT / 6.5, 0, 0, 0);
|
||||
|
||||
can.Children.Add(rect);
|
||||
can.Children.Add(block);
|
||||
can.Tap += new EventHandler<System.Windows.Input.GestureEventArgs>(this.EventOnMultiBubbleClick);
|
||||
can.Tag = (stackIndex << 12) | (listIndex & 0x00000FFF);
|
||||
can.SetValue(Canvas.LeftProperty, xOffset - rect.Width);
|
||||
can.SetValue(Canvas.TopProperty, yOffset);
|
||||
can.SetValue(Canvas.ZIndexProperty, DAY_TABLE_ZINDEX_MAX + 1);
|
||||
|
||||
//this.AddContentUIElement(stackIndex, can);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,9 +22,6 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
|
||||
public partial class TimeTableWeek : PhoneApplicationPage
|
||||
{
|
||||
private static readonly double WEEK_TABLE_CELL_HEIGHT = 40;
|
||||
private static readonly int WEEK_TABLE_ZINDEX_MAX = 10;
|
||||
|
||||
private static readonly int PIVOT_PAGES = 3;
|
||||
private static readonly int PIVOT_PAGES_HALF_DOWN = 1;
|
||||
|
||||
@@ -244,68 +241,6 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
}
|
||||
}
|
||||
|
||||
private void OnMultiBubbleClick(object sender, System.Windows.Input.GestureEventArgs e)
|
||||
{
|
||||
int indexVal = (int)(sender as Canvas).Tag;
|
||||
int dayIndex = (indexVal >> 24) & 0xF;
|
||||
int index = (indexVal >> 12) & 0xFFF;
|
||||
int listIndex = (indexVal) & 0xFFF;
|
||||
/*
|
||||
//AppointmentModel tempModel = this.itemPages[index].Stacks[dayIndex][listIndex].First();
|
||||
//this.itemPages[index].Stacks[dayIndex][listIndex].Remove(tempModel);
|
||||
//this.itemPages[index].Stacks[dayIndex][listIndex].Add(tempModel);
|
||||
AppointmentModel tempModel = this.itemPages[index].Stacks[listIndex].First();
|
||||
this.itemPages[index].Stacks[listIndex].Remove(tempModel);
|
||||
this.itemPages[index].Stacks[listIndex].Add(tempModel);
|
||||
|
||||
//for (int i = 0; i < this.itemPages[index].Stacks[dayIndex][listIndex].Count(); i++)
|
||||
for (int i = 0; i < this.itemPages[index].Stacks[listIndex].Count(); i++)
|
||||
{
|
||||
//tempModel = this.itemPages[index].Stacks[dayIndex][listIndex][i];
|
||||
tempModel = this.itemPages[index].Stacks[listIndex][i];
|
||||
|
||||
this.RemoveContentUIElement(index, tempModel);
|
||||
|
||||
for (int day = 0; day < 5; day++)
|
||||
{
|
||||
if (tempModel.IsDate(this.itemPages[index].DateFrom.Date.AddDays(day)) > -1)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
//this.DrawAppointment(this.itemPages[index].Stacks[dayIndex][listIndex][i], index, day, 0.5, i, this.itemPages[index].Stacks[dayIndex][listIndex].Count - 1 - i);
|
||||
this.DrawAppointment(this.itemPages[index].Stacks[listIndex][i], index, day, 0.5, i, this.itemPages[index].Stacks[listIndex].Count - 1 - i);
|
||||
}
|
||||
else
|
||||
{
|
||||
//this.DrawAppointment(this.itemPages[index].Stacks[dayIndex][listIndex][i], index, day, 1.0, i, this.itemPages[index].Stacks[dayIndex][listIndex].Count - 1 - i);
|
||||
this.DrawAppointment(this.itemPages[index].Stacks[listIndex][i], index, day, 1.0, i, this.itemPages[index].Stacks[listIndex].Count - 1 - i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
// this.RemoveContentUIElement(index, sender as Canvas);
|
||||
|
||||
//bool bubbleDrawn = false;
|
||||
/*
|
||||
for (int day = 0; day < 5; day++)
|
||||
{
|
||||
if (this.itemPages[index].Stacks[listIndex][0].IsDate(this.itemPages[index].DateFrom.Date.AddDays(day)) > -1 && bubbleDrawn == false)
|
||||
{
|
||||
bubbleDrawn = true;
|
||||
Canvas[] tempCan = this.GetModelCanvasFromContent(index, this.itemPages[index].Stacks[listIndex][0]);
|
||||
this.DrawMultiBubble(
|
||||
index,
|
||||
day,
|
||||
listIndex,
|
||||
this.itemPages[index].Stacks[listIndex].Count(),
|
||||
tempCan[0].Width + tempCan[0].Margin.Left,
|
||||
tempCan[0].Margin.Top);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
private void OnListChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
AppointmentModel tempModel = null;
|
||||
@@ -383,48 +318,5 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawMultiBubble(int index, int dayIndex, int listIndex, int number, double xOffset, double yOffset)
|
||||
{
|
||||
Canvas can = new Canvas();
|
||||
|
||||
can.Width = WEEK_TABLE_CELL_HEIGHT * 2;
|
||||
can.Height = WEEK_TABLE_CELL_HEIGHT * 2;
|
||||
|
||||
Rectangle rect = new Rectangle();
|
||||
rect.Width = WEEK_TABLE_CELL_HEIGHT / 2;
|
||||
rect.Height = WEEK_TABLE_CELL_HEIGHT / 2;
|
||||
rect.RadiusX = WEEK_TABLE_CELL_HEIGHT / 4;
|
||||
rect.RadiusY = WEEK_TABLE_CELL_HEIGHT / 4;
|
||||
rect.StrokeThickness = 1;
|
||||
rect.Stroke = new SolidColorBrush(Colors.DarkGray);
|
||||
rect.Fill = new SolidColorBrush(Colors.Black);
|
||||
|
||||
TextBlock block = new TextBlock();
|
||||
block.Height = WEEK_TABLE_CELL_HEIGHT / 2;
|
||||
block.Width = WEEK_TABLE_CELL_HEIGHT / 2;
|
||||
block.Text = "" + number;
|
||||
block.HorizontalAlignment = HorizontalAlignment.Center;
|
||||
block.VerticalAlignment = VerticalAlignment.Center;
|
||||
block.FontWeight = FontWeights.Bold;
|
||||
block.FontSize = WEEK_TABLE_CELL_HEIGHT / 3;
|
||||
block.Padding = new Thickness(WEEK_TABLE_CELL_HEIGHT / 6.5, 0, 0, 0);
|
||||
|
||||
can.Children.Add(rect);
|
||||
rect.SetValue(Canvas.TopProperty, WEEK_TABLE_CELL_HEIGHT / 2);
|
||||
rect.SetValue(Canvas.LeftProperty, WEEK_TABLE_CELL_HEIGHT / 2);
|
||||
|
||||
can.Children.Add(block);
|
||||
block.SetValue(Canvas.TopProperty, WEEK_TABLE_CELL_HEIGHT / 2);
|
||||
block.SetValue(Canvas.LeftProperty, WEEK_TABLE_CELL_HEIGHT / 2);
|
||||
|
||||
can.Tap += new EventHandler<System.Windows.Input.GestureEventArgs>(this.OnMultiBubbleClick);
|
||||
can.Tag = ((dayIndex & 0xF) << 24) | ((index & 0xFFF) << 12) | (listIndex & 0xFFF);
|
||||
can.SetValue(Canvas.LeftProperty, xOffset - rect.Width - (WEEK_TABLE_CELL_HEIGHT / 2));
|
||||
can.SetValue(Canvas.TopProperty, yOffset - (WEEK_TABLE_CELL_HEIGHT / 2));
|
||||
can.SetValue(Canvas.ZIndexProperty, WEEK_TABLE_ZINDEX_MAX + 1);
|
||||
|
||||
// this.itemPages[index].Content.Children.Add(can);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
<UserControl.Resources>
|
||||
<conv:BoolToVisibilityConverter x:Key="VisConverter"/>
|
||||
<conv:DoubleNaNConverter x:Key="NaNConverter"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid x:Name="ContentRoot" Loaded="AutoScroll">
|
||||
@@ -128,80 +129,83 @@
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Time_Day_Sunday_Short, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<ScrollViewer x:Name="TheScrollView" Grid.Row="2">
|
||||
<Grid x:Name="TheGrid" Background="Transparent" Height="{Binding Path=TimeTable.Setting_View_Height}">
|
||||
<Grid.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
|
||||
<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"/>
|
||||
<!--saturday-->
|
||||
<ColumnDefinition Width="*" x:Name="Col_6"/>
|
||||
<!--sunday-->
|
||||
<ColumnDefinition Width="*" x:Name="Col_7"/>
|
||||
</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">
|
||||
<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="{StaticResource PhoneForegroundBrush}"/>
|
||||
<Line X1="0" Y1="0" X2="39" Y2="0" StrokeThickness="2" Stroke="{StaticResource PhoneForegroundBrush}"/>
|
||||
</Canvas>
|
||||
</DataTemplate>
|
||||
</lui:ListBoxFixed.ItemTemplate>
|
||||
</lui:ListBoxFixed>
|
||||
</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"/>
|
||||
</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" />
|
||||
</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" />
|
||||
</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" />
|
||||
</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" />
|
||||
</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"/>
|
||||
</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"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<ScrollViewer x:Name="TheScrollView" Grid.Row="2">
|
||||
<!--<Canvas x:Name="MainCanvas">-->
|
||||
<!--<Canvas x:Name="UserCanvas" Canvas.ZIndex="12" Width="{Binding ActualWidth, ElementName=MainCanvas, Mode=OneWay, Converter={StaticResource NaNConverter}}"/>-->
|
||||
<Grid x:Name="TheGrid"> <!-- Width="{Binding ActualWidth, ElementName=MainCanvas, Mode=OneWay, Converter={StaticResource NaNConverter}}"> -->
|
||||
<Grid.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
|
||||
<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"/>
|
||||
<!--saturday-->
|
||||
<ColumnDefinition Width="*" x:Name="Col_6"/>
|
||||
<!--sunday-->
|
||||
<ColumnDefinition Width="*" x:Name="Col_7"/>
|
||||
</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">
|
||||
<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="{StaticResource PhoneForegroundBrush}"/>
|
||||
<Line X1="0" Y1="0" X2="39" Y2="0" StrokeThickness="2" Stroke="{StaticResource PhoneForegroundBrush}"/>
|
||||
</Canvas>
|
||||
</DataTemplate>
|
||||
</lui:ListBoxFixed.ItemTemplate>
|
||||
</lui:ListBoxFixed>
|
||||
</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"/>
|
||||
</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" />
|
||||
</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" />
|
||||
</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" />
|
||||
</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" />
|
||||
</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"/>
|
||||
</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"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<!-- </Canvas> -->
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -15,6 +15,7 @@ namespace CampusAppWP8.Utility.Lui.Templates
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Shapes;
|
||||
using CampusAppWP8.Model.TimeTable;
|
||||
using CampusAppWP8.Pages.TimeTable;
|
||||
|
||||
@@ -446,5 +447,17 @@ namespace CampusAppWP8.Utility.Lui.Templates
|
||||
{
|
||||
this.TheScrollView.ScrollToVerticalOffset((TimeTable.Setting_Hour_Spacing * 7) + 2);
|
||||
}
|
||||
|
||||
private void DrawMultiBubble()
|
||||
{
|
||||
Rectangle circle = new Rectangle();
|
||||
|
||||
circle.RadiusX = 10;
|
||||
circle.RadiusY = 10;
|
||||
circle.Width = 20;
|
||||
circle.Height = 20;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user