This commit is contained in:
Christian Fiedler
2013-11-22 21:24:21 +01:00
parent f2c32ce2db
commit ea717fcef0
2 changed files with 44 additions and 1 deletions

View File

@@ -19,7 +19,9 @@
<phone:Pivot x:Name="ThePivot" Title="{Binding Path=LocalizedResources.TimeTableApp_Title, Source={StaticResource LocalizedStrings}}">
<phone:Pivot.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Day, Mode=OneWay, StringFormat='ddd dd.MM.yy'}"/>
<Border BorderThickness="0" Width="440">
<TextBlock Text="{Binding Path=Day, Mode=OneWay, StringFormat='ddd dd.MM.yy'}"/>
</Border>
</DataTemplate>
</phone:Pivot.HeaderTemplate>
<phone:Pivot.ItemTemplate>

View File

@@ -0,0 +1,41 @@
//-----------------------------------------------------------------------
// <copyright file="DoubleNaNConverter.cs" company="BTU/IIT">
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>Fiedler</author>
// <date>22.11.2013</date>
// <summary>Implements the double na n converter class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Utility.Converter
{
using System;
using System.Windows;
using System.Windows.Data;
/// <summary> A double na n converter. </summary>
/// <remarks> Fiedler, 22.11.2013. </remarks>
/// <seealso cref="T:System.Windows.Data.IValueConverter"/>
public sealed class DoubleNaNConverter : IValueConverter
{
/// <summary>
/// Ändert die Quelldaten vor der Übergabe an das Ziel zur Anzeige in der Benutzeroberfläche.
/// </summary>
/// <remarks> Fiedler, 22.11.2013. </remarks>
/// <seealso cref="M:System.Windows.Data.IValueConverter.Convert(object,Type,object,System.Globalization.CultureInfo)"/>
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo language)
{
return (value is double && value.Equals(double.NaN) == false) ? value : 0.0;
}
/// <summary>
/// Ändert die Zieldaten vor der Übergabe an das Quellobjekt. Diese Methode wird nur in
/// <see cref="F:System.Windows.Data.BindingMode.TwoWay" />-Bindungen aufgerufen.
/// </summary>
/// <remarks> Fiedler, 22.11.2013. </remarks>
/// <seealso cref="M:System.Windows.Data.IValueConverter.ConvertBack(object,Type,object,System.Globalization.CultureInfo)"/>
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo language)
{
return (value is double && value.Equals(double.NaN) == false) ? value : 0.0;
}
}
}