namespace PizzaSoftware.UI
{
/// <summary>
/// Interaction logic for LoginForm.xaml
/// </summary>
public partial class LoginForm : Window
{
public LoginForm()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
Timer timer = new Timer(1000);
timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
timer.Enabled = true;
}
void timer_Elapsed(object sender, ElapsedEventArgs e)
{
lblCurrentTime.Content = DateTime.Now.ToShortTimeString();
}
}
}
Basically, I'm just trying to have a label on my form that displays the current time. I'm using a Timer as suggested in another of my SO question.
I'm receiving the error in title. What can I do to solve this?