C
C#11mo ago
Cam

✅ Adding XAML code from a seperate file into the MainWindow

Is it possible to add XAML code into a file from own other. These are files that I will regularly need to edit and update so having them in a seperate file from the MainWindow is important. E.g “Panel1.xaml” needs to have its code “injected” into MainWindow
13 Replies
Denis
Denis11mo ago
You create your own usercontrols Or custom controls And you'd use them like your regular wpf controls in the main window
Cam
CamOP11mo ago
Sorry can you expand on this a little bit?
Cam
CamOP11mo ago
Here’s what the project is. I just don’t want to overload the main window
No description
No description
Denis
Denis11mo ago
$code
MODiX
MODiX11mo ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat For longer snippets, use: https://paste.mod.gg/
Denis
Denis11mo ago
$codegif
Denis
Denis11mo ago
Denis
Denis11mo ago
UserControl | Avalonia Docs
UserControl control is a ContentControl that represents a reusable collection of controls in a predefined layout.
Cam
CamOP11mo ago
Appreciate it. I’ll have to do a bit of playing around with it but at least I now know the answer on how to do it 😁 Do you know if this works with tools such as
<Canvas> Some Code </Canvas>
<Canvas> Some Code </Canvas>
No worries I’ve made it work. Legendary bro. You’ve been a big help
Denis
Denis11mo ago
$close
MODiX
MODiX11mo ago
Use the /close command to mark a forum thread as answered
Want results from more Discord servers?
Add your server