Move bind `LoadComplete` code out of constructor

This commit is contained in:
Dean Herbert 2021-05-20 15:15:19 +09:00
parent 673ca4c2a1
commit 489caebf59
1 changed files with 7 additions and 2 deletions

View File

@ -19,13 +19,18 @@ public NewsHeader()
{
TabControl.AddItem(front_page_string);
article.BindValueChanged(onArticleChanged, true);
}
protected override void LoadComplete()
{
base.LoadComplete();
Current.BindValueChanged(e =>
{
if (e.NewValue == front_page_string)
ShowFrontPage?.Invoke();
});
article.BindValueChanged(onArticleChanged, true);
}
public void SetFrontPage() => article.Value = null;