CountChar
This commit is contained in:
@@ -243,6 +243,9 @@
|
||||
<Compile Include="Utility\Lui\Header\DefaultHeader.xaml.cs">
|
||||
<DependentUpon>DefaultHeader.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utility\Lui\Header\WeekViewPivotHeader.xaml.cs">
|
||||
<DependentUpon>WeekViewPivotHeader.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utility\Lui\ListBoxFixed.cs" />
|
||||
<Compile Include="Utility\Lui\Templates\WeekView.xaml.cs">
|
||||
<DependentUpon>WeekView.xaml</DependentUpon>
|
||||
@@ -526,6 +529,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Utility\Lui\Header\WeekViewPivotHeader.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Utility\Lui\Templates\WeekView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -16,67 +16,16 @@
|
||||
|
||||
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<phone:Pivot x:Name="ThePivot" SelectionChanged="OnPivotSelectionChanged">
|
||||
<phone:Pivot x:Name="ThePivot" SelectionChanged="OnPivotSelectionChanged" LoadedPivotItem="ThePivot_LoadedPivotItem">
|
||||
<phone:Pivot.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Background="DarkBlue" Width="700">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--row_0-->
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0" Text="{Binding DateFrom, Mode=OneWay, StringFormat='dd.MM.yyyy'}" HorizontalAlignment="Right" FontSize="24"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding WeekChar, Mode=OneWay}" HorizontalAlignment="Center" FontSize="24"/>
|
||||
<TextBlock Grid.Column="2" Text="{Binding DateTo, Mode=OneWay, StringFormat='dd.MM.yyyy'}" HorizontalAlignment="Left" FontSize="24"/>
|
||||
</Grid>
|
||||
<!--row_1-->
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="40"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--col_0 stay empty-->
|
||||
<!--col_1_monday-->
|
||||
<Border Grid.Column="1" BorderThickness="1">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Time_Day_Monday_Short, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Center" FontSize="16"/>
|
||||
</Border>
|
||||
<!--col_2_tuesday-->
|
||||
<Border Grid.Column="2" BorderThickness="1">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Time_Day_Tuesday_Short, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Center" FontSize="16"/>
|
||||
</Border>
|
||||
<!--col_3_wednesday-->
|
||||
<Border Grid.Column="3" BorderThickness="1">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Time_Day_Wednesday_Short, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Center" FontSize="16"/>
|
||||
</Border>
|
||||
<!--col_4_thursday-->
|
||||
<Border Grid.Column="4" BorderThickness="1">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Time_Day_Thursday_Short, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Center" FontSize="16"/>
|
||||
</Border>
|
||||
<!--col_5_friday-->
|
||||
<Border Grid.Column="5" BorderThickness="1">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Time_Day_Friday_Short, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Center" FontSize="16"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.HeaderTemplate>
|
||||
<phone:Pivot.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Visible" Loaded="ScrollViewer_Loaded">
|
||||
<templ:WeekView x:Name="TheWeekView" Loaded="TheWeekView_Loaded"/>
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Visible" Loaded="ScrollViewer_Loaded" Background="LightGoldenrodYellow">
|
||||
<templ:WeekView x:Name="TheWeekView" Loaded="TheWeekView_Loaded" StartDate="{Binding DateFrom, Mode=OneTime}"/>
|
||||
</ScrollViewer>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.ItemTemplate>
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
public WeekView weekView { get; set; }
|
||||
//???
|
||||
public List<Appointment> appointmentList { get; set; }
|
||||
public PivotItem pItemPtr { get; set; }
|
||||
}
|
||||
|
||||
private static readonly int PIVOT_PAGES = 3;
|
||||
@@ -64,8 +65,6 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
firstDay = firstDay.AddDays(7);
|
||||
}
|
||||
|
||||
this.ThePivot.ItemsSource = this.itemPages;
|
||||
|
||||
ApplicationBarIconButton dayViewBtn = new ApplicationBarIconButton();
|
||||
dayViewBtn.Text = AppResources.DayView;
|
||||
dayViewBtn.IconUri = new Uri(Icons.Info, UriKind.Relative);
|
||||
@@ -101,6 +100,7 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ThePivot.ItemsSource = this.itemPages;
|
||||
this.lastSelectedIndex = PIVOT_PAGES_HALF_DOWN;
|
||||
this.ThePivot.SelectedIndex = PIVOT_PAGES_HALF_DOWN;
|
||||
}
|
||||
@@ -143,7 +143,7 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
Page page = App.RootFrame.Content as Page;
|
||||
page.NavigationService.Navigate(url);
|
||||
*/
|
||||
this.itemPages[this.ThePivot.SelectedIndex].weekView.SetColumnBackground(0, new SolidColorBrush(Colors.Red));
|
||||
// this.itemPages[this.ThePivot.SelectedIndex].weekView.SetColumnBackground(0, new SolidColorBrush(Colors.Red));
|
||||
}
|
||||
|
||||
private void OnClickToday(object sender, EventArgs e)
|
||||
@@ -167,7 +167,7 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
this.SetupPage(i);
|
||||
}
|
||||
*/
|
||||
this.itemPages[this.ThePivot.SelectedIndex].weekView.SetColumnBackground(0);
|
||||
//this.itemPages[this.ThePivot.SelectedIndex].weekView.SetColumnBackground(0);
|
||||
}
|
||||
|
||||
private void OnClickProperties(object sender, EventArgs e)
|
||||
@@ -206,13 +206,13 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
}
|
||||
|
||||
//this.itemPages[index].Content.Children.Clear();
|
||||
this.itemPages[index].WeekNumber = System.Globalization.DateTimeFormatInfo.CurrentInfo.Calendar.GetWeekOfYear(
|
||||
this.itemPages[index].DateFrom,
|
||||
System.Globalization.CalendarWeekRule.FirstDay,
|
||||
DayOfWeek.Monday);
|
||||
this.itemPages[index].WeekChar = ((this.itemPages[index].WeekNumber % 2) == 0) ? 'B' : 'A';
|
||||
// this.itemPages[index].WeekNumber = System.Globalization.DateTimeFormatInfo.CurrentInfo.Calendar.GetWeekOfYear(
|
||||
// this.itemPages[index].DateFrom,
|
||||
// System.Globalization.CalendarWeekRule.FirstDay,
|
||||
// DayOfWeek.Monday);
|
||||
// this.itemPages[index].WeekChar = ((this.itemPages[index].WeekNumber % 2) == 0) ? 'B' : 'A';
|
||||
|
||||
this.SetupPage(index);
|
||||
//this.SetupPage(index);
|
||||
|
||||
this.lastSelectedIndex = this.ThePivot.SelectedIndex;
|
||||
}
|
||||
@@ -330,6 +330,7 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
|
||||
private void OnCanvasSizeChanged(object sender, SizeChangedEventArgs e)
|
||||
{
|
||||
/*
|
||||
if (e.NewSize.Width.Equals(e.PreviousSize.Width) == false)
|
||||
{
|
||||
Canvas tempContainer = (sender as Canvas);
|
||||
@@ -348,15 +349,16 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
|
||||
this.SetupPage(index);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
private void SetupPage(int index)
|
||||
{
|
||||
// Header
|
||||
|
||||
((this.ThePivot.Items[index] as PivotItem).Header as Grid).Children.Clear();
|
||||
//((this.ThePivot.Items[index] as PivotItem).Header as Grid).Children.Clear();
|
||||
|
||||
this.DrawHeader(index);
|
||||
//this.DrawHeader(index);
|
||||
|
||||
// Items
|
||||
|
||||
@@ -628,17 +630,17 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
// 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';
|
||||
// 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;
|
||||
//PivotItem pvItem = new PivotItem();
|
||||
//Grid headGrid = new Grid();
|
||||
//pvItem.Header = headGrid;
|
||||
|
||||
this.ThePivot.Items.Add(pvItem);
|
||||
//this.ThePivot.Items.Add(pvItem);
|
||||
}
|
||||
|
||||
private void RemoveContentUIElement(int index, UIElement elem)
|
||||
@@ -814,8 +816,18 @@ namespace CampusAppWP8.Pages.TimeTable
|
||||
|
||||
private void TheWeekView_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.itemPages[this.loadedWeekView].weekView = sender as WeekView;
|
||||
// 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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<UserControl x:Class="CampusAppWP8.Utility.Lui.Header.WeekViewPivotHeader"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
>
|
||||
|
||||
<Grid x:Name="LayoutRoot" Background="DarkBlue" Margin="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.Row="0" Text="{Binding DateFrom, Mode=OneWay, StringFormat='dd.MM.yyyy'}" HorizontalAlignment="Right" FontSize="24"/>
|
||||
<TextBlock Grid.Column="1" Grid.Row="0" Text="<" HorizontalAlignment="Center" FontSize="24"/>
|
||||
<TextBlock Grid.Column="2" Grid.Row="0" Text="{Binding WeekChar, Mode=OneWay}" HorizontalAlignment="Center" FontSize="24"/>
|
||||
<TextBlock Grid.Column="3" Grid.Row="0" Text=">" HorizontalAlignment="Center" FontSize="24"/>
|
||||
<TextBlock Grid.Column="4" Grid.Row="0" Text="{Binding DateTo, Mode=OneWay, StringFormat='dd.MM.yyyy'}" HorizontalAlignment="Left" FontSize="24"/>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Grid.Column="0" Grid.Row="0" BorderThickness="0" Width="40">
|
||||
</Border>
|
||||
|
||||
<Border Grid.Column="1" Grid.Row="0" BorderThickness="1" BorderBrush="White">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Time_Day_Monday_Short, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Center" FontSize="16"/>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Column="2" Grid.Row="0" BorderThickness="1" BorderBrush="White">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Time_Day_Tuesday_Short, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Center" FontSize="16"/>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Column="3" Grid.Row="0" BorderThickness="1" BorderBrush="White">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Time_Day_Wednesday_Short, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Center" FontSize="16"/>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Column="4" Grid.Row="0" BorderThickness="1" BorderBrush="White">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Time_Day_Thursday_Short, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Center" FontSize="16"/>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Column="5" Grid.Row="0" BorderThickness="1" BorderBrush="White">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Time_Day_Friday_Short, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Center" FontSize="16"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace CampusAppWP8.Utility.Lui.Header
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Navigation;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Shell;
|
||||
|
||||
public partial class WeekViewPivotHeader : UserControl
|
||||
{
|
||||
|
||||
|
||||
public WeekViewPivotHeader()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,8 @@ namespace CampusAppWP8.Utility.Lui.Templates
|
||||
|
||||
public partial class WeekView : UserControl
|
||||
{
|
||||
public static readonly DependencyProperty StartDateProperty = DependencyProperty.Register("StartDate", typeof(DateTime), typeof(WeekView), new PropertyMetadata(null));
|
||||
|
||||
private List<Border> borderList = new List<Border>();
|
||||
|
||||
private string[] timeStrings = new string[24];
|
||||
@@ -32,6 +34,19 @@ namespace CampusAppWP8.Utility.Lui.Templates
|
||||
this.InitLayout();
|
||||
}
|
||||
|
||||
public DateTime StartDate
|
||||
{
|
||||
get
|
||||
{
|
||||
return (DateTime)this.GetValue(StartDateProperty);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.SetValue(StartDateProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetColumnBackground(int column, Brush brush = null)
|
||||
{
|
||||
if (column < this.borderList.Count())
|
||||
|
||||
@@ -206,9 +206,9 @@ namespace CampusAppWPortalLib8.Utility
|
||||
{
|
||||
int retValue = 0;
|
||||
|
||||
for (int i = 0; i < str.Length; i++)
|
||||
foreach(char tc in str)
|
||||
{
|
||||
if (str[i].Equals(c))
|
||||
if(tc.Equals(c) == true)
|
||||
{
|
||||
retValue++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user