Note that there are some explanatory texts on larger screens.

plurals
  1. POIs there a way to set textblocks to static on a UserControl in C# before compile?
    text
    copied!<p><strong>EDIT: Apparently I was a little confusing. The original post will remain below, but the main thing I'm asking is if there is a way to make a textblock on a usercontrol static, so that when I try to set it's value with a static method, it doesn't whine and say "An object reference is required for the non-static field, method, or property 'WpfApplication10.ProfileControl.blkFirst'".</strong></p> <p>I'm not sure if I designed my entire database class wrong, but I essentially have a project right now that connects to a remote database. Everything works when I add things to the database. I can add new users (with SHA512 encrypted passwords using salt :D), add "events" that include the title of and event and a date/time, and even basic user information like email address, first name, last name, etc.</p> <p>Everything works when I'm <em>adding</em> to the database. However, I have a usercontrol called Profile and it is supposed to display all of the basic user information, such as the username, email, etc.</p> <p>The problem, unfortunately, is that the textblocks I'm trying to set values to are not static, but the way all of my other stuff is set up in my database, login, etc controls, it is static. This isn't an issue when I'm adding things to the database, because I'm not directly altering things already on the usercontrol. </p> <p>It is very possible that I am doing something in my overall design wrong, but I'm hoping that there is a way to make objects static on a usercontrol when you add them in the design view, otherwise I'm going to have to probably go back and change my entire program.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload