Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Why WPF sucks today

Why WPF sucks today

Scheduled Pinned Locked Moved The Lounge
csharpwpfvisual-studiowcfcom
14 Posts 7 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Enver Maroshi
    wrote on last edited by
    #1

    Because the damn stupid thing does not know what a reference is. If i send object by referance then it should keep a reference to that object, and what ever change one does to that object, change should be persisted on that object. You don't know what i am talking about? http://www.codeproject.com/answers/54805/ByRef-object-value-is-lost-between-methods.aspx[^] I'm so angry right now. I did review my code 10 times already, i did not write anything wrong, the damn thing does not work. And i know it's not actually WPF problem, but .Net. But somehow this is working in VS 2005. Oh, and the binding is even worse, you can't undo binded values, so, if you make edit window, and click on cancel (changes) you can't tell him undo my bindings, instead you have to clone object first, then copy new values when you want changes to apply. must... kill... steve... ballmer... argh...

    P D E W 4 Replies Last reply
    0
    • E Enver Maroshi

      Because the damn stupid thing does not know what a reference is. If i send object by referance then it should keep a reference to that object, and what ever change one does to that object, change should be persisted on that object. You don't know what i am talking about? http://www.codeproject.com/answers/54805/ByRef-object-value-is-lost-between-methods.aspx[^] I'm so angry right now. I did review my code 10 times already, i did not write anything wrong, the damn thing does not work. And i know it's not actually WPF problem, but .Net. But somehow this is working in VS 2005. Oh, and the binding is even worse, you can't undo binded values, so, if you make edit window, and click on cancel (changes) you can't tell him undo my bindings, instead you have to clone object first, then copy new values when you want changes to apply. must... kill... steve... ballmer... argh...

      P Offline
      P Offline
      Phil Martin
      wrote on last edited by
      #2

      Enver Maroshi wrote:

      If i send object by reference then it should keep a reference to that object, and what ever change one does to that object, change should be persisted on that object.

      Funnily enough that is how referencing works, but that is not how your code is written to work. Not the place for the lounge though, so I wrote a very quick answer over in your question. But no arguments in general though, I'm still not a fan of WPF :)

      E 1 Reply Last reply
      0
      • E Enver Maroshi

        Because the damn stupid thing does not know what a reference is. If i send object by referance then it should keep a reference to that object, and what ever change one does to that object, change should be persisted on that object. You don't know what i am talking about? http://www.codeproject.com/answers/54805/ByRef-object-value-is-lost-between-methods.aspx[^] I'm so angry right now. I did review my code 10 times already, i did not write anything wrong, the damn thing does not work. And i know it's not actually WPF problem, but .Net. But somehow this is working in VS 2005. Oh, and the binding is even worse, you can't undo binded values, so, if you make edit window, and click on cancel (changes) you can't tell him undo my bindings, instead you have to clone object first, then copy new values when you want changes to apply. must... kill... steve... ballmer... argh...

        D Offline
        D Offline
        Daniel Grunwald
        wrote on last edited by
        #3

        This has nothing to do with WPF. Your understanding of VB sucks. In a proper language like C#, your code would be a compile-time error (you cannot assign to 'this'). The VB compiler silently inserts a temporary variable that makes the code compile but produce incorrect results. You may want to read an explanation of what ByRef really is[^].

        E R 2 Replies Last reply
        0
        • P Phil Martin

          Enver Maroshi wrote:

          If i send object by reference then it should keep a reference to that object, and what ever change one does to that object, change should be persisted on that object.

          Funnily enough that is how referencing works, but that is not how your code is written to work. Not the place for the lounge though, so I wrote a very quick answer over in your question. But no arguments in general though, I'm still not a fan of WPF :)

          E Offline
          E Offline
          Enver Maroshi
          wrote on last edited by
          #4

          I think you did not get my question/problem correct. Oh, i did not write quesiton in lounge, i'm just complaining here. Doh, now i don't even know how to post a follow-up inside my question... i did not click on answer, instead on new forum message... Anyway, i wrote some more details....

          P 1 Reply Last reply
          0
          • D Daniel Grunwald

            This has nothing to do with WPF. Your understanding of VB sucks. In a proper language like C#, your code would be a compile-time error (you cannot assign to 'this'). The VB compiler silently inserts a temporary variable that makes the code compile but produce incorrect results. You may want to read an explanation of what ByRef really is[^].

            E Offline
            E Offline
            Enver Maroshi
            wrote on last edited by
            #5

            Where do you guys see in my code that i try to assign something to "Me"? I try to add values to a collection. VB compiler does nothing wrong, since the code is correct. Either i don't see something, or you guys did overlook that i nowhere try to set a value to "Me". Me is a collection, i just add items to collection, and items are lost. This same code works perfect in .Net 2.0. But, anyway, if you want to comment my code, please do so on my question. Or give me an answer. But please, first read my code. I don't say i don't have a bug, only i don't see one. And trust me i know what a ByRef is, i am programming for 10 years already. I think i understand what a ByRef is. :)

            D 1 Reply Last reply
            0
            • E Enver Maroshi

              Because the damn stupid thing does not know what a reference is. If i send object by referance then it should keep a reference to that object, and what ever change one does to that object, change should be persisted on that object. You don't know what i am talking about? http://www.codeproject.com/answers/54805/ByRef-object-value-is-lost-between-methods.aspx[^] I'm so angry right now. I did review my code 10 times already, i did not write anything wrong, the damn thing does not work. And i know it's not actually WPF problem, but .Net. But somehow this is working in VS 2005. Oh, and the binding is even worse, you can't undo binded values, so, if you make edit window, and click on cancel (changes) you can't tell him undo my bindings, instead you have to clone object first, then copy new values when you want changes to apply. must... kill... steve... ballmer... argh...

              E Offline
              E Offline
              Enver Maroshi
              wrote on last edited by
              #6

              Only now i understand what a piece of crap i wrote. I was doing copy-paste from previous project, and i really did what you wrote, only, i did not review the class where the problem was and i indeed did try to assing a value to "Me". I was debuging only methods in parent class and did not even look at what i actually try to do. Anyway, my mistake. Sorry once again. And thnx, i would not ever noticed it without you. :-O Oh, btw, WPF does suck, and WPF editor inside VS.

              P R 2 Replies Last reply
              0
              • E Enver Maroshi

                Because the damn stupid thing does not know what a reference is. If i send object by referance then it should keep a reference to that object, and what ever change one does to that object, change should be persisted on that object. You don't know what i am talking about? http://www.codeproject.com/answers/54805/ByRef-object-value-is-lost-between-methods.aspx[^] I'm so angry right now. I did review my code 10 times already, i did not write anything wrong, the damn thing does not work. And i know it's not actually WPF problem, but .Net. But somehow this is working in VS 2005. Oh, and the binding is even worse, you can't undo binded values, so, if you make edit window, and click on cancel (changes) you can't tell him undo my bindings, instead you have to clone object first, then copy new values when you want changes to apply. must... kill... steve... ballmer... argh...

                W Offline
                W Offline
                Wjousts
                wrote on last edited by
                #7

                Looks like a VB problem not a WPF problem. I don't see any WPF if your example.

                1 Reply Last reply
                0
                • D Daniel Grunwald

                  This has nothing to do with WPF. Your understanding of VB sucks. In a proper language like C#, your code would be a compile-time error (you cannot assign to 'this'). The VB compiler silently inserts a temporary variable that makes the code compile but produce incorrect results. You may want to read an explanation of what ByRef really is[^].

                  R Offline
                  R Offline
                  Roger Alsing 0
                  wrote on last edited by
                  #8

                  Actually, you can assign values to "this" in c# ;-) Try it inside the constructor of a struct.

                  My Blog

                  P 1 Reply Last reply
                  0
                  • E Enver Maroshi

                    I think you did not get my question/problem correct. Oh, i did not write quesiton in lounge, i'm just complaining here. Doh, now i don't even know how to post a follow-up inside my question... i did not click on answer, instead on new forum message... Anyway, i wrote some more details....

                    P Offline
                    P Offline
                    Phil Martin
                    wrote on last edited by
                    #9

                    Enver Maroshi wrote:

                    I think you did not get my question/problem correct.

                    Heh, I think I did, hence why you deleted the question :) And don't stress about it, we all have bad days, especially when staring at the same code for hours and hours crying "Why doesn't this work!!!". Always good to get another pair of eyes on it at that point.

                    E 1 Reply Last reply
                    0
                    • R Roger Alsing 0

                      Actually, you can assign values to "this" in c# ;-) Try it inside the constructor of a struct.

                      My Blog

                      P Offline
                      P Offline
                      Phil Martin
                      wrote on last edited by
                      #10

                      Heh, talk about a corner of a corner case :)

                      1 Reply Last reply
                      0
                      • P Phil Martin

                        Enver Maroshi wrote:

                        I think you did not get my question/problem correct.

                        Heh, I think I did, hence why you deleted the question :) And don't stress about it, we all have bad days, especially when staring at the same code for hours and hours crying "Why doesn't this work!!!". Always good to get another pair of eyes on it at that point.

                        E Offline
                        E Offline
                        Enver Maroshi
                        wrote on last edited by
                        #11

                        Yes you did. Well, mistakes do happen :-O I deleted the question since i thought this is the way you close a "ticket" or in this case, a question. But don't know, i think it's still there. As a reminder to me to give a better check of code next time :doh:

                        1 Reply Last reply
                        0
                        • E Enver Maroshi

                          Where do you guys see in my code that i try to assign something to "Me"? I try to add values to a collection. VB compiler does nothing wrong, since the code is correct. Either i don't see something, or you guys did overlook that i nowhere try to set a value to "Me". Me is a collection, i just add items to collection, and items are lost. This same code works perfect in .Net 2.0. But, anyway, if you want to comment my code, please do so on my question. Or give me an answer. But please, first read my code. I don't say i don't have a bug, only i don't see one. And trust me i know what a ByRef is, i am programming for 10 years already. I think i understand what a ByRef is. :)

                          D Offline
                          D Offline
                          Daniel Grunwald
                          wrote on last edited by
                          #12

                          ByRef in VB can mean: 1) pass-by-reference 2) pass-by-value 3) pass-by-value-result (aka copy-in, copy-out) Which of those the VB compiler chooses depends on the expression you are trying to pass to the method. You are passing "Me" ByRef. This is like trying to assign to "Me". What the VB compiler does in this case is that chooses 2), silently introduces a temporary variable and passes that instead. So in effect, the method gets called pass-by-value even though it is declared ByRef. The subtle difference between 1) and 3) can also lead to lots of hours wasted debugging. Debugging gets hard if the bug is in code the compiler silently inserted!

                          1 Reply Last reply
                          0
                          • E Enver Maroshi

                            Only now i understand what a piece of crap i wrote. I was doing copy-paste from previous project, and i really did what you wrote, only, i did not review the class where the problem was and i indeed did try to assing a value to "Me". I was debuging only methods in parent class and did not even look at what i actually try to do. Anyway, my mistake. Sorry once again. And thnx, i would not ever noticed it without you. :-O Oh, btw, WPF does suck, and WPF editor inside VS.

                            P Offline
                            P Offline
                            Pete OHanlon
                            wrote on last edited by
                            #13

                            Enver Maroshi wrote:

                            Oh, btw, WPF does suck, and WPF editor inside VS.

                            How do those grapes taste? Sour?

                            "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                            As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                            My blog | My articles | MoXAML PowerToys | Onyx

                            1 Reply Last reply
                            0
                            • E Enver Maroshi

                              Only now i understand what a piece of crap i wrote. I was doing copy-paste from previous project, and i really did what you wrote, only, i did not review the class where the problem was and i indeed did try to assing a value to "Me". I was debuging only methods in parent class and did not even look at what i actually try to do. Anyway, my mistake. Sorry once again. And thnx, i would not ever noticed it without you. :-O Oh, btw, WPF does suck, and WPF editor inside VS.

                              R Offline
                              R Offline
                              Rocky Moore
                              wrote on last edited by
                              #14

                              Enver Maroshi wrote:

                              Oh, btw, WPF does suck, and WPF editor inside VS.

                              Then don't use it! :)

                              Rocky <>< Recent Blog Post: Coca-Cola In Israel..

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • World
                              • Users
                              • Groups