[REL] [C#] [WPF] Simple Program

Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24
  1. #16
    • ♠️​ ♦️ ♣️ ​♥️ • שเ๒єtгเ๒є is offline
    MemberRank
    Mar 2012 Join Date
    917Posts

    Re: [REL] [C#] [WPF] Simple Program

    Go ahead and program hangman for 2 players, C# newbies. :D

  2. #17
    Developer iGalaxy is offline
    MemberRank
    Jul 2013 Join Date
    C:/xampp/htdocsLocation
    488Posts

    Re: [REL] [C#] [WPF] Simple Program

    Quote Originally Posted by שเ๒єtгเ๒є View Post
    Go ahead and program hangman for 2 players, C# newbies. :D
    Omgg thxx i will do it!

  3. #18
    It won't fit Supicioso is offline
    MemberRank
    May 2007 Join Date
    LouisianaLocation
    2,385Posts

    Re: [REL] [C#] [WPF] Simple Program

    Get out of the habit of writing code in the UI's code behind. Look up MVVM when working with WPF.
    It'll save you a lot of headache in the future.

  4. #19
    Developer iGalaxy is offline
    MemberRank
    Jul 2013 Join Date
    C:/xampp/htdocsLocation
    488Posts

    Re: [REL] [C#] [WPF] Simple Program

    Quote Originally Posted by Supicioso View Post
    Get out of the habit of writing code in the UI's code behind. Look up MVVM when working with WPF.
    It'll save you a lot of headache in the future.
    Thanks! I will when I get to my laptop.

  5. #20
    It won't fit Supicioso is offline
    MemberRank
    May 2007 Join Date
    LouisianaLocation
    2,385Posts

    Re: [REL] [C#] [WPF] Simple Program

    Quote Originally Posted by iGalaxy View Post
    Thanks! I will when I get to my laptop.
    If you need some in-use examples feel free to look around this.

    https://github.com/Tsume/Uguu/tree/master/Client

    The folder Models is where majority of your code goes.
    ViewModels is where ui updates go (more or less).

  6. #21
    Developer iGalaxy is offline
    MemberRank
    Jul 2013 Join Date
    C:/xampp/htdocsLocation
    488Posts

    Re: [REL] [C#] [WPF] Simple Program

    Quote Originally Posted by Supicioso View Post
    If you need some in-use examples feel free to look around this.

    https://github.com/Tsume/Uguu/tree/master/Client

    The folder Models is where majority of your code goes.
    ViewModels is where ui updates go (more or less).
    Thanks alot!

  7. #22
    • ♠️​ ♦️ ♣️ ​♥️ • שเ๒єtгเ๒є is offline
    MemberRank
    Mar 2012 Join Date
    917Posts

    Re: [REL] [C#] [WPF] Simple Program

    Quote Originally Posted by Supicioso View Post
    Get out of the habit of writing code in the UI's code behind. Look up MVVM when working with WPF.
    It'll save you a lot of headache in the future.
    Well writing code that controls the UI itself has to be placed there, but the only thing. No matter you use WPF, Windows.Forms, ASPX, whatever. Always code with a more tier architecture. Split managing logic off the UI. And split data access logic off the managing login.

  8. #23
    It won't fit Supicioso is offline
    MemberRank
    May 2007 Join Date
    LouisianaLocation
    2,385Posts

    Re: [REL] [C#] [WPF] Simple Program

    Quote Originally Posted by שเ๒єtгเ๒є View Post
    Well writing code that controls the UI itself has to be placed there, but the only thing. No matter you use WPF, Windows.Forms, ASPX, whatever. Always code with a more tier architecture. Split managing logic off the UI. And split data access logic off the managing login.
    No, it doesn't. I've halfway through with the program I linked to above, and I haven't written anything at all in the UI's code behind.

    Done correctly, you shouldn't have anything at all in that file. If you're altering the ui from that file, you're doing it wrong and you're also opening yourself up to some headaches down the road.
    Mostly UI blocking/locked threads.

  9. #24
    • ♠️​ ♦️ ♣️ ​♥️ • שเ๒єtгเ๒є is offline
    MemberRank
    Mar 2012 Join Date
    917Posts

    Re: [REL] [C#] [WPF] Simple Program

    Quote Originally Posted by Supicioso View Post
    No, it doesn't. I've halfway through with the program I linked to above, and I haven't written anything at all in the UI's code behind.

    Done correctly, you shouldn't have anything at all in that file. If you're altering the ui from that file, you're doing it wrong and you're also opening yourself up to some headaches down the road.
    Mostly UI blocking/locked threads.
    I see what you are doing there, but I wonder for what you got your MainWindow.xaml.cs then? Microsoft made it this way by clicking on events in the designer it adds the subscription method in the xaml.cs file automatically, for a good reason.
    Now you just go out and write your own View controller/Model or what ever it is ... I can clearly see you mix UI events with business logic that does not belong there inside of the MainViewModel.cs. But about that there is always a grey zone between right and wrong.



Page 2 of 2 FirstFirst 12

Advertisement