To sum up comments. Because Content
is an Object
you compare it by reference. Use Equals
method, which is overridden by String
, to compare values:
CountTime.Content.Equals(TriggerTime.Content)
or cast both values to String
and then compare them:
(string)CountTime.Content == (string)TriggerTime.Content