C
C#2y ago
Jelles

❔ WPF Use of multiple item controls

Hello! I am trying to display a bunch of planets on the canvas with itemscontrol. This has been a success but now I have to add lines between some planets because they are neighbours. I can't seem to get two item controls working (I don't really know how to implement the second list). And secondly I can't seem to add a second tag for the ellipse (planet)
18 Replies
Jelles
JellesOP2y ago
Here is my view
Jelles
JellesOP2y ago
Jelles
JellesOP2y ago
I added the X1="{Binding GameViewModel.GetPlanet(neighbour).X}" X2="..."></Line> as a place holder but it should give a rough idea for what I am trying to do
Jelles
JellesOP2y ago
Jelles
JellesOP2y ago
I also want to add the elipse in the itemscontrol but I don't know where because it only accepts one child. If anyone knows anything that will help me don't forget to tell me! Thanks :)
Alexicon
Alexicon2y ago
What is it you want the end result here to look like? I am confused just looking at your xaml what you want to achieve.
Jelles
JellesOP2y ago
Jelles
JellesOP2y ago
Currently looks like that But there should be lines between some planets
Jelles
JellesOP2y ago
This seemed to work
Jelles
JellesOP2y ago
But now I ran into another problem cause I can't bind to the planet now that i bind to an array of items inside the planet object
Jelles
JellesOP2y ago
Jelles
JellesOP2y ago
🥳
Alexicon
Alexicon2y ago
I also figured out how to make it work, but its probably fairly different to how you solved it I would guess. https://github.com/AlexLexicon/Discord.Example.Planets
GitHub
GitHub - AlexLexicon/Discord.Example.Planets
Contribute to AlexLexicon/Discord.Example.Planets development by creating an account on GitHub.
Jelles
JellesOP2y ago
Actually pretty close to what I did
Jelles
JellesOP2y ago
Alexicon
Alexicon2y ago
ah, thats funny
Jelles
JellesOP2y ago
Thanks anyway! WPF is a bit different compared to what I am used to 😆
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity. 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