C
C#ā€¢2mo ago
GuiMi

Developing a program

Hey everyone, I need help on developing a program. If you could help me, it would be greatful. Also, note that I'm not that good on C#.
21 Replies
ACiDCA7
ACiDCA7ā€¢2mo ago
$details
MODiX
MODiXā€¢2mo ago
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)
GuiMi
GuiMiOPā€¢2mo ago
oh yeah thanks šŸ™‚ $code
MODiX
MODiXā€¢2mo 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/
GuiMi
GuiMiOPā€¢2mo ago
https://paste.mod.gg/galwycfokdxt Here is the code for tha .xaml Window file
BlazeBin - galwycfokdxt
A tool for sharing your source code with the world!
Pobiega
Pobiegaā€¢2mo ago
Maybe start with actually describing your problem
GuiMi
GuiMiOPā€¢2mo ago
So I'm making a GUI program that will make use of cmd programs
Pobiega
Pobiegaā€¢2mo ago
- What are you trying to do? - What have you tried? - What is the expected result? Okay. I can already recommend https://github.com/Tyrrrz/CliWrap then its an excellent library for running cli tools programatically
GuiMi
GuiMiOPā€¢2mo ago
Nice. And also I need to show some info about the process
leowest
leowestā€¢2mo ago
also give this a read, it will avoid future issues with your current UI $rulesofwpf
MODiX
MODiXā€¢2mo ago
Rules of WPF:

āŒ Avoid the WPF Designer to eliminate a category of confusing bugs
āŒ Don't rely on Margin as the primary tool for layouts
āŒ Avoid writing UserControls or subclassing to extend a default control -- use Behaviors instead (Microsoft.Xaml.Behaviors.Wpf)

āœ… Write XAML by hand and autoformat with "Ctrl K,D" or XAML Styler
āœ… Rely upon XAML Hot Reload to design your app's UI at runtime
āœ… Use layout controls (Grid, DockPanel, etc) to support proper resizing
āœ… Use data binding to eliminate glue code and state synchronization issues
āœ… Use collection controls and DataTemplate to dynamically create lists of controls
āœ… Learn MVVM to create maintainable apps
āœ… Use the Dispatcher to update controls from non-UI threads
āœ… WPF's default controls can be easily modernized via $wpfuilibs
āœ… Include relevant XAML, code-behind, and ViewModel code for questions when possible
Rules of WPF:

āŒ Avoid the WPF Designer to eliminate a category of confusing bugs
āŒ Don't rely on Margin as the primary tool for layouts
āŒ Avoid writing UserControls or subclassing to extend a default control -- use Behaviors instead (Microsoft.Xaml.Behaviors.Wpf)

āœ… Write XAML by hand and autoformat with "Ctrl K,D" or XAML Styler
āœ… Rely upon XAML Hot Reload to design your app's UI at runtime
āœ… Use layout controls (Grid, DockPanel, etc) to support proper resizing
āœ… Use data binding to eliminate glue code and state synchronization issues
āœ… Use collection controls and DataTemplate to dynamically create lists of controls
āœ… Learn MVVM to create maintainable apps
āœ… Use the Dispatcher to update controls from non-UI threads
āœ… WPF's default controls can be easily modernized via $wpfuilibs
āœ… Include relevant XAML, code-behind, and ViewModel code for questions when possible
GuiMi
GuiMiOPā€¢2mo ago
Ok
leowest
leowestā€¢2mo ago
No description
leowest
leowestā€¢2mo ago
all these are bad
leowest
leowestā€¢2mo ago
No description
leowest
leowestā€¢2mo ago
all this means you're using the designer to move things around and adding things generating unecessary margins that will make things not work the way u expect them to work
GuiMi
GuiMiOPā€¢2mo ago
oh... That's where the text info is going Here goes problem number 2 It's about the list box I need it to show the image when I select an option. And the text will be changed too.
Pobiega
Pobiegaā€¢2mo ago
Thats usually handled with data bindings
GuiMi
GuiMiOPā€¢2mo ago
oh nice
leowest
leowestā€¢2mo ago
there really isn't much shortcut tbh, you need to learn how to use XAML and u need knowledge of the basics of c# to not fall prey of why this doesnt work type of issues. for wpf xaml you can use https://wpf-tutorial.com/wpf-application/introduction/ it covers several topics including databinding, how to use a listbox, how to customize it. in regards c# https://learn.microsoft.com/en-us/shows/csharp-fundamentals-for-absolute-beginners/ these are the main topics u need to know to not be so lost with things.
GuiMi
GuiMiOPā€¢2mo ago
I'm gonna need a combination of both Thank you, will give more updates when problems I'm scrapping this.
Want results from more Discord servers?
Add your server