Refactor TabPanel Heading Assignment Logic
- Simplified the logic for setting the Heading property in the TabPanel component. - Replaced the if-else statement with a ternary operator for improved readability and maintainability. - Ensured that the functionality remains unchanged and verified correct assignment of headings.
This commit is contained in:
parent
22e3161a9b
commit
d77e898929
|
@ -36,14 +36,7 @@ else
|
||||||
|
|
||||||
Parent.AddTabPanel((TabPanel)this);
|
Parent.AddTabPanel((TabPanel)this);
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(Heading))
|
Heading = string.IsNullOrEmpty(Heading) ? Localize(nameof(Name), Name) : Localize(nameof(Heading), Heading);
|
||||||
{
|
|
||||||
Heading = Localize(nameof(Name), Name);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Heading = Localize(nameof(Heading), Heading);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string DisplayHeading()
|
public string DisplayHeading()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user