AvaloniaUI / Avalonia.Samples

Avalonia.Samples aims to provide some minimal samples focusing on a particular issue at a time. This should help getting new users started.
https://www.avaloniaui.net
606 stars 103 forks source link

Reflection-free ViewLocator #48

Open timunie opened 1 year ago

timunie commented 1 year ago

Topics to cover

Add reflection free ViewLocator sample

Ideas for a sample

Add:

            return data switch
            {
                FirstPageViewModel => new FirstPageView(),
                SecondPageViewModel => new SecondPageView(),
                _ => new TextBlock {Text = "Not Found: " + data.GetType().Name}
            };

Additional context