❔ 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
More Posts
e different names during Serialize and Deserialize [Answered]Is there a way to use Text.json to make members use different names during Serialize and Deserialize❔ How to write Process name into XML file ?I try to write my Process name into xml file like this: ```csharp foreach(var process in Process.Get[CSS-HTML] Page Layout, annoying random lines [Answered]Hello everyone, i made another page on a project im working on, but some random grey horizontal line❔ [SOLVED] Reducing the size of an executablehello there what are my options to reduce the size of an executable? Here's how I publish it ```sh d❔ [SOLVED] PublishAot and PublishSingleFile at thesame timeI have a very simple app and I want to reduce its size and have a good start up time. Here's my curr❔ ASP.NET Core Middleware running only onceHello! I have a custom middleware that runs only once and isn't running on every request. When I pu❔ ❔ Upgrading my function app to .NET 7 - Could not load file or assembly System.ComponentModelI've tried to upgrade my Azure Function App to .NET 7. But `Microsoft.Azure.WebJobs.Extension.Stora❔ How to set a time interval in a timer ?This is the class: ```csharp public string ProcessName { get; set; } public int MaximumLifeTime { ge❔ EntityFramework does not track changes for the select projectionHey, With Select (), I only extracted the data I needed, which I want to update later. However, afte❔ Using concurrent collections to add or remove elements for in-memory collections (server)?Should we use concurrent collections to add/remove elements to/from in-memory collections in asp.net