Curtis Rutland's Profile User Rating: *****

Reputation: 4468 Guru
Group:
Moderators
Active Posts:
7,908 (5.12 per day)
Joined:
08-June 10
Profile Views:
70,879
Last Active:
User is online A minute ago
Currently:
Viewing Board Index

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Who Cares
Favorite Gaming Platform:
PC
Your Car:
Chevrolet
Dream Kudos:
1000
Expert In:
C#, LINQ, Dynamics CRM 2011

Latest Visitors

Icon   Curtis Rutland has been promoted!

Posts I've Made

  1. In Topic: Pass data from one window to another or to a user control

    Posted 29 Aug 2014

    Here's your problem:

    //Code required for getting the current user's name from the 'MainWindow'
    MainWindow MW = new MainWindow();
    


    That's not correct. You're creating a new MainWindow, never displaying it, and trying to listen to it's changes. Of course it will never change, because you've never displayed it.

    Instead, since you're creating your HomeWindow from inside an already existing MainWindow (and that's the one you want to listen to events for), you need to make sure you pass a reference of that main window to the home window.

    You can add a constructor to your HomeWindow class that takes a MainWindow parameter and saves it to a class-level variable. Then, when you want to subscribe to the event, use that saved instance, rather than creating a new one.

    The constructor would look like this:

    public HomeWindow(MainWindow mainWindow){
      InitializeComponent();
      MainWindow = mainWindow;
      //rest of subscribing code
    }
    
    The way you would pass it would be like this:
    
    [code]HomeWindow hw = new HomeWindow(this);
    
  2. In Topic: Pass data from one window to another or to a user control

    Posted 29 Aug 2014

    View Postdanbywinby, on 29 August 2014 - 11:30 AM, said:

    Yeah because it is declared in the 'MainWindow' but i don't understand why it is not working in the 'HomeWindow'.


    ...because it's declared in the MainWindow class. That's exactly why. Not the File, but inside the class itself. Move the class declaration outside the MainWindow class declaration. If you really want to make sure, create a new class file and move it there.

    And you don't have to name it NameUpdatedEventArgs, name it whatever makes sense to your program.
  3. In Topic: Pass data from one window to another or to a user control

    Posted 29 Aug 2014

    That's because you've defined it inside another class. FYI, it would be much easier for us to help if you posted updated code.

    But my guess is that you've defined the class inside the Homewindow class, which it shouldn't be. If you declare it outside the other class, as public or internal, it should be visible.
  4. In Topic: Entity Framework generate from database give me blank .edmx diagram

    Posted 28 Aug 2014

    This might take a while, but it should help you narrow down which object is the problem. Start by adding just one of your tables/views/procedures, then allowing it to be generated. Then update the model with another object. As soon as you add one and it goes blank, you know the problem is with that object.
  5. In Topic: Linq to XML, populate list with multiple values.

    Posted 27 Aug 2014

    View Postoptix212, on 27 August 2014 - 03:58 PM, said:

    i have, however, seen a few things that vb.net offers that C# doesn't, and I've always wondered why that is.. I mean, we're all using the same framework.. Why are there methods/classes in vb.net that we can't use in C#?


    It's probably because two different teams work on each language. I mean, there's obviously going to be a lot of crossover, since they both render to the same intermediate language, but that's the whole idea. "Here's a shared set of functionality that you can use to implement a language on top of." The different teams have prioritized different features.

    But there are features of C# that don't exist in VB.NET as well, like the unsafe keyword. Here's a wiki article detailing the differences:

    http://en.wikipedia....nguage_features

    VB.NET's seem more targeted to making your code easier to write, whereas C# seems to focus on being more like C++ in some small respects.

My Information

Member Title:
(╯□)╯︵ (~ .o.)~
Age:
30 years old
Birthday:
August 29, 1984
Gender:
Location:
San Antonio
Forum Leader:
C#
Full Name:
Curtis Rutland
Years Programming:
7
Programming Languages:
C# -- Forms, WPF, Silverlight, WCF

Contact Information

E-mail:
Click here to e-mail me
Website URL:
Website URL  http://curtisrutland.com
Skype:
Skype  insertAlias_bytes
Twitter:
curtisrutland

Comments

  • (2 Pages)
  • +
  • 1
  • 2
  1. Photo

    NewRandomUsername Icon

    06 Jun 2014 - 20:59
    Did you get my messages(emails) sir?
  2. Photo

    BenignDesign Icon

    03 May 2013 - 13:29
    I see you were staring at my profile. I also stare randomly at profiles. We have much in common. We should probably hook up sometime. Just sayin.
  3. Photo

    eric wallace Icon

    31 Jan 2013 - 02:53
    can you help for visual basic
  4. Photo

    no2pencil Icon

    06 Dec 2012 - 08:34
    It still isn't good enough.
  5. Photo

    ikram002p Icon

    27 Jun 2012 - 10:51
    "It Doesn't Work!" That's not good enough!
    It Still Doesn't Work!.
    I didnt undestand it ??
  6. Photo

    tlhIn`toq Icon

    18 Mar 2012 - 11:22
    Congrats on breaking 3000
  7. Photo

    Curtis Rutland Icon

    08 Sep 2011 - 14:13
    "Leveling up." I like that!
  8. Photo

    MATTtheSEAHAWK Icon

    08 Sep 2011 - 13:55
    Yar ya see, i remember when yee wer purple!
    Anyways congrats! It's weird seeing people who've been one way so long "leveling up" :P.
  9. Photo

    Curtis Rutland Icon

    08 Sep 2011 - 12:59
    Thanks!
  10. Photo

    Sergio Tapia Icon

    08 Sep 2011 - 12:29
    Congrats on becoming a mod. :D
  11. Photo

    Ace26 Icon

    15 Jun 2011 - 13:39
    Hi mate, interesting to see we are age mates. Nice work you do in the forums.
    Just dropped by to say hi, anyways.
    Cheers.
  12. Photo

    RetardedGenius Icon

    20 Apr 2011 - 18:56
    Excellent C# tutorials, they've taught me a lot I didn't know. Please keep more of the good stuff coming! :D
  13. Photo

    Curtis Rutland Icon

    24 Mar 2011 - 14:55
    Yeah, felt like "professionalizing".
  14. Photo

    Dogstopper Icon

    23 Mar 2011 - 17:08
    Woah. Name switch! I took a double take...
  15. Photo

    CodingSup3rnatur@l-360 Icon

    01 Mar 2011 - 14:35
    No problem at all. Glad I could contribute :)
  • (2 Pages)
  • +
  • 1
  • 2