-
-
Save NoobInTraining/d43650fc49036960a565c3f3e4ca06e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Globalization; | |
using DatafoxTSLibrary.Terminals; | |
using System.Windows.Data; | |
namespace AdminClientv03.Converters | |
{ | |
class DtTermToTimeDiffernce : IValueConverter | |
{ | |
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | |
{ | |
var term = value as DatafoxTerminal; | |
if (value == null) | |
return 0; | |
if (term.AskedAt.HasValue && term.CurrentTimeOnTerminal.HasValue) | |
return (term.AskedAt.Value - term.CurrentTimeOnTerminal.Value).TotalSeconds; | |
else | |
return 0; | |
} | |
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | |
{ | |
throw new NotImplementedException("Only one way conversion supported"); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<conv:DtTermToTimeDiffernce x:Key="DtConv"/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment