/// <summary> /// initialise items collection /// add some changed listener /// </summary> public Wizard() { Items = new AvaloniaList <WizardPage>(); CurrentPageProperty.Changed.AddClassHandler((Action <Wizard, AvaloniaPropertyChangedEventArgs>)((o, e) => OnCurrentPageChanged(o, e))); ItemsPanelProperty.Changed.AddClassHandler((Action <Wizard, AvaloniaPropertyChangedEventArgs>)((o, e) => OnItemChanged(o, e))); ItemsProperty.Changed.AddClassHandler((Action <Wizard, AvaloniaPropertyChangedEventArgs>)((o, e) => OnItemSourceChanged(o, e))); Initialized += (o, e) => { if (Items.OfType <object>().Any() && CurrentPage == null) { CurrentPage = Items.OfType <WizardPage>().FirstOrDefault(); } }; }