✅ Help with wpf binding issues
Hey guys, im having issues with wpf binding again...
would be nice to get some help: code
GitHub
GitHub - JuanNotTheHuman/TileGame
Contribute to JuanNotTheHuman/TileGame development by creating an account on GitHub.
25 Replies
$details
When you ask a question, make sure you include as much detail as possible. Such as code, the issue you are facing, what you expect the result to be, what .NET version you are using and what platform/environment (if any) are relevant to your question. Upload code here https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code! (see $code for more information on how to paste your code)
the issue is inside
Views/GameCreationView.xaml
lines 220-247
i just don't have any idea on how to make the binding work.whats the actual goal here. you set the datacontext on that control, just so you can ignore it in your binding
its from a previous attempt, the goal is to display and edit the amount of drops from click

ok, so whats the issue here? you seem to know how to bind things
the issue is that i dont know how to bind this thing
what thing
the count and ModifyDropCommand
so you are saying the binding in line 220 is how its supposed to be and you are only worried about the binding in the DataTemplate?
because from my POV that binding is garbage
not sure anymore...
<ItemsControl ItemsSource="{Binding Source={StaticResource ItemTypeValues}}"> is to get all item types
and then for each itemType get the amount from foreground generation
not sure if im doing it right
does it work?
nope
then no
whats the correct way to do it then
i recommend taking a step back and design something thats bindable
and im not going to answer that
you clearly want a collection there, although not sure if you actually want one
by there u mean?
depends on how many "drops" there are and if that amount is going to change
im still talking about line 220
i want to be able to add a drop when i want to ig
wouldn't it be better to add all possible drops and set them to 0 and just read that? it would make the itemssource work better, right?
no need for wierd binding structure then ig?
no, that doesnt matter
if you bind a bindable collection, then the contents dont matter
or when you decide to add them
anyway, so it seems you want a collection
so go add a bindable collection to the viewmodel, then write another viewmodel that goes inside there
i want the game to be configurable so yeah
???
go use your words
im not interested in pulling them out of your head. either you work with me, or you dont (which is fine) and i go do something else
im just really tired and confused
need a sec
then there is no point to this right now anyway
go come back when you are not tired
ok, figured it out, made some junky code, but it works