I have a question about the Title'Bar sample from Microsoft's GitHub repository(https://github.com/JustinXinLiu/FullScreenTitleBarRepo/tree/master/FullScreenTitleBarRepo): In the AddCustomTitleBar function,there has a line:
customTitleBar.EnableControlsInTitleBar(areControlsInTitleBar);
EnableControlsInTitleBar is here:
public void EnableControlsInTitleBar(bool enable)
{
if (enable)
{
TitleBarControl.Visibility = Visibility.Visible;
// Clicks on the BackgroundElement will be treated as clicks on the title bar.
Window.Current.SetTitleBar(BackgroundElement);
}
else
{
TitleBarControl.Visibility = Visibility.Collapsed;
Window.Current.SetTitleBar(null);
}
}
but if I don't call the fuction(EnableControlsInTitleBar),the sample still work well
In Justin XL sample(https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/TitleBar) there indeed have use this:
Window.Current.SetTitleBar(BackgroundElement);
that puzzled me,hope somebody can give me a explain,thanks.