❔ WPF (Avalonia) Tab Pages

What do you use to separate the main view into multiple sub-views in Avalonia/WPF? Thinking about Tab Controls, like the image below But that doesnt split the view and would result in everything being written into the same view .xaml and all being cramped into the same viewmodel
10 Replies
Trinitek
Trinitek2y ago
why can't you move the page contents to a UserControl for each, and then specify the UserControl in the main xaml
Monsieur Wholesome
Wouldn't I be making my own tab control thing, when writing each individual control myself? In a reinventing the wheel sense
Trinitek
Trinitek2y ago
does Avalonia not have a TabControl I'm saying you could have
<TabControl>
<TabItem Header="Hello">
<local:MyHelloTab/>
</TabItem>
</TabControl>
<TabControl>
<TabItem Header="Hello">
<local:MyHelloTab/>
</TabItem>
</TabControl>
where MyHelloTab is a UserControl in a separate XAML file
Monsieur Wholesome
I am not well-versed in Desktop GUI dev Are Controls pure classes, or also "views" (.xaml designed files)?
Trinitek
Trinitek2y ago
a "UserControl" as it exists in WPF is a control with a XAML file and a "Control" is a pure class without an associated XAML file
Monsieur Wholesome
Hmmm Lemme try that out
Trinitek
Trinitek2y ago
you need to declare a local xmlns at the top of your file similar to how you have one for vm
Monsieur Wholesome
I see I see
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server