This is a school assignment I have, just so you know.
A quick overview of my assignment is, that I create a UML class diagram for a game, and from those classes create a class library in C#.
That class library has to be imported into a WPF project where I use those classes and create a functioning game.
The point of the assignment is for the students to practice object oriented programming, so everything has to be in classes that we create ourselves.
The problem is, I'm am not too well-versed in WPF. I know that if I doubleclick on a button-control, code will automatically be generated where I can manipulate with different controls and data etc, but I don't know how a method in an instantiated object (or a static one) from a class library can get called when I click on a button-control, and then use that method to change text content in fx. a label.
I was thinking of creating a "UIManager" class that updates the WPF controls depending on the game state, but I have no idea how to create methods that will take WPF controls as parameters, in a class that is in a class library. For some reason I can't use the "using" statement to use the WPF specific namespaces in my class library project, but I don't even know if that is the solution to my problem.
I emphasize the class library because it is a requirement that it is done that way.
Any help, hint or guidance is very much appreciated.
If you want to create a WPF class library that can also include WPF "windows" XAML and code-behind, then just add references to the dll's that are normally "missing" versus a straight WPF "exe" (like Framework.dll, etc.)
Same goes for the "user controls" included in said class library.
I don't think you're being asked to actually "manipulate" the XAML.
Study one of the WPF Toolkits: that illustrates the type of architecture you're going after.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
Are you actually using VS Installer to deploy your application?
Mycroft Holmes wrote:
I would think the Configuration Manager would be the appropriate tool to deploy an application (never used VS Installer).
How would that hepl? The problem isn't the configurataion. When I do a release build, the correct app.config is in Bin\Release. The proble is that the installer isn't getting the right App.Config. it's somehow getting the app.config from bin\debug.
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
That was what I was talking about, they are supported for WPF projects as well.
It is called Configuration Manager, you automatically get the debug config and need to set up a release config. The release config holds only the section that apply to the release with a replace directive and the deployment operation replaces the relevant sections and creates a config file.
Never underestimate the power of human stupidity -
I'm old. I know stuff - JSOP
I'm trying to get the AForge VideoSourcePlayer to work in a WPF app. It's a WinForms control hosted in a WindowsFormsHost. I can't get this to work ina WinForms app either, but I'm targeting WPF in the end.
NB: The built-in DataGrid control used to be provided as part of the "community toolkit". There may be some minor differences, but most articles that apply to the old community toolkit version will still apply to the built-in version.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
I have set up the calculation program for the program, but now the problem is that I want to integrate the two classes together but it still is not compatible so you can help me! Textblock caculator not show Only one class can be implemented! code see here :