AboutI do stuff with computers.
SkillsA little bit of everything
Joined devRant on 7/31/2019
Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Hey guys, any WPF developers here?
I'm having lotsa trouble getting WPF XAML data bindings to work. Disclaimer - I'm new to OOP and thhe syntax of OOP is so damn confusing I'm never sure anything is the "right" way.
The task is to create test data for certain classes and output it in WPF. The code I have is a public static class that generates test data for certain classes and stores these objects inside a static List<Object> depending on the object. I couldn't figure out any other way to store all these objects to later be able to output them.
Then I found out that you can use ObservableCollection to automate a lot of the CRUD stuff. So I tried to change the Lists to static ObservableCollections. It mostly works and I even got it to output the data in XAML by using DataGrid.ItemsSource = TestDataCreationClass.authors in the MainWindow.xaml.cs. However, I can not for the life of me figure out how to do the bind through XAML only using the ItemsSource property. No matter what I do, it cannot find the Collection.
I googled for quite a while and every example seems completely different from mine so I'm at a loss.
If you need any more info or code snippets I'd be glad to provide them.
Any kind of help is appreciated.
Thanks in advance!1
Can we have a separate -- option for spam? It feels kinda weird having to report something for being offensive if it's just another "php bad" post.20
Anyone else get quite burnt out even after, like, 4 hours of programming? I usually feel like a zombie and can't think properly. Will this eventually stop happening?17