I am trying to implement using a Focus but notice i a missing something, but if i am using it on xaml.cs its working fine. What approach must i use to accomplish this on the method on a class?
<code>`public void SaveTicket()
{
try
{
// Check if the compartment selected is "truck-empty" and the purpose is "Leaving-Finished Product"
if (View.comboCompartment.SelectedItem != null && Convert.ToInt32(View.comboCompartment.SelectedValue)== 6)
{
// Check if TopSeal is empty
if (string.IsNullOrEmpty(View.Topseal.Trim()))
{
System.Windows.MessageBox.Show("TopSeal cannot be empty", "Validation Error");
Topseal.Focus(); // problem is here. What can i use here in order for Focus to be recognised by intellisense?
return;
}
// Check if BottomSeal is empty
if (string.IsNullOrEmpty(View.BottomSeal.Trim()))
{
System.Windows.MessageBox.Show("BottomSeal cannot be empty", "Validation Error");
return;
}
}
}`
</code>
<code>`public void SaveTicket()
{
try
{
// Check if the compartment selected is "truck-empty" and the purpose is "Leaving-Finished Product"
if (View.comboCompartment.SelectedItem != null && Convert.ToInt32(View.comboCompartment.SelectedValue)== 6)
{
// Check if TopSeal is empty
if (string.IsNullOrEmpty(View.Topseal.Trim()))
{
System.Windows.MessageBox.Show("TopSeal cannot be empty", "Validation Error");
Topseal.Focus(); // problem is here. What can i use here in order for Focus to be recognised by intellisense?
return;
}
// Check if BottomSeal is empty
if (string.IsNullOrEmpty(View.BottomSeal.Trim()))
{
System.Windows.MessageBox.Show("BottomSeal cannot be empty", "Validation Error");
return;
}
}
}`
</code>
`public void SaveTicket()
{
try
{
// Check if the compartment selected is "truck-empty" and the purpose is "Leaving-Finished Product"
if (View.comboCompartment.SelectedItem != null && Convert.ToInt32(View.comboCompartment.SelectedValue)== 6)
{
// Check if TopSeal is empty
if (string.IsNullOrEmpty(View.Topseal.Trim()))
{
System.Windows.MessageBox.Show("TopSeal cannot be empty", "Validation Error");
Topseal.Focus(); // problem is here. What can i use here in order for Focus to be recognised by intellisense?
return;
}
// Check if BottomSeal is empty
if (string.IsNullOrEmpty(View.BottomSeal.Trim()))
{
System.Windows.MessageBox.Show("BottomSeal cannot be empty", "Validation Error");
return;
}
}
}`