I am a bit new in programming C#. I would like to know if there is a way for my wpf to run as i want it to run.
I am creating a timer for a desktop application. What I would like it to do is that if it reached 5 minutes, the buttons for editing will be disabled and the buttons left are just for saving.
for example, When i open the microsoft word application on my desktop, i only have 5 minutes to access it, if i reached the time limit what i can only do is save it and other buttons will be disabled.
here is a clip of my code.
//-----------------------------------------------------------------------------------------------------
ticker.DispatcherTimerInstance.Tick += (ev, EV) =>
{
TimeCount.Text = ticker.currentResult.ToString();
};
dp.AddValueChanged(TimeCount, (object a, EventArgs b) =>
{
if (TimeCount.Text == "00:00:10")
{
dt_TimeStart_PW.Stop();
}
if (TimeCount.Text == "00:00:10")
{
win2.ShowDialog();
}
if (TimeCount.Text == "00:05:00")
{
win3.ShowDialog();
//the buttons on the app should be disabled except for save and close
}
});
dt_TimeStart_PW = new DispatcherTimer();
dt_TimeStart_PW.Start();
dt_TimeStart_TC = new DispatcherTimer();
dt_TimeStart_TC.Start();
dt_TimeStart_PW.Tick += (a, b) =>
{
GetTaskNameWindows("Please wait...");
//GetTaskNameWindows("Task Completed");
};
dt_TimeStart_TC.Tick += (a, b) =>
{
GetTaskNameWindows("Task Completed");
};
Thank you. I hope you can help me.