« first day (2045 days earlier)      last day (2886 days later) » 
00:00 - 19:0019:00 - 23:00

7:08 PM
so i need to do a 'basic data entry form'... but i dunno what type of things to enter data on :/
 
@Bardicer be more vague pls
 
"... create a basic data entry form using free Microsoft software utilizing ASP.net MVC. ..." "...Think of this as more of a science fair project...."
 
Is this an assignment?
Interview question?
 
it's an interview thing
the technical assessment part
it's creativity i have issues with
if i were a creative person i'd already have my own business running
 
Just pick something
New customer, name address bank details
 
7:12 PM
i've thought about that. but that's such a mundane thing
i wanna wow them with my (lack of) creativity!
 
7:23 PM
I'd assume that the technical aspects are more important than the content
Don't want a novel subject area to be a distraction
+ it should be obvious what 'correct' input behaviour should be
 
Use the text of lorem ipsum as form fields
 
IMHO that's more difficult to demonstrate when the domain is an unusual one
 
8:21 PM
@Bardicer imho I'd say you'd be better off picking a boring domain but absolutely nailing down all the little quirks of UI behaviour, go the extra mile in getting it technically right rather than in the content
 
I'm facing a bit of a weird issue. I'm trying to send a key with C# using SendKeys.SendWait("k"); but it results in: "The name SendKeys does not exist in the current context".
It's not like I'm missing a library or something. That's what makes it so weird
 
It looks like the compiler is interpreting an unknown symbol as a local variable, and telling you that's not there. If it's an unrecognised class from a library that's not referenced the compiler can't possibly know what you mean so it wouldn't tell you that it's a missing class definition
 
@TomW That's what I'm doing....
A basic people search - First name, Last name, Hair color, Eye color, Birthdate and Hobbies
with hair and eye colors being in separate tables and using a dropdown list for the options
 
@icecub you're referencing System.Windows.Forms and importing that namespace?
 
The type or namespace "Forms" does not exist in the namespace "System.Windows"
 
8:34 PM
So that's a no then.
 
Hey guys. Happy to see some people online.
Im currently fighting the topic "data binding" for wpf.
 
@TomW Ah ok. I'm still learning so that's probebly it. Could you tell me how to fix it or is that to much to explain here in chat?
 
@icecub Do you understand the difference between referencing an assembly and importing a namespace?
 
@TomW I'm afraid not. I've already learned about importing namespaces, but haven't come to that yet.
 
8:39 PM
@icecub Assuming you're using Visual Studio, right-click on References under the project item and choose 'Add Reference'. Pick System.Windows.Forms
 
I cant even form a question...
 
@TomW Ok I've done that
 
@C4ud3x, just a try
 
Is it possible setting up the dataContext inside xaml for the window TO the window itself?
Like declaring a global one from the beginning?
 
@TomW Ah, now it works! Thanks a lot for the help! ^^
 
8:42 PM
@C4ud3x erm. You want to use the instance of window as its own datacontext?
@C4ud3x or do you mean defining the type that the datacontext should be, in XAML?
The latter, this question explains stackoverflow.com/questions/23713898/…
or rather the top answer
 
Well, Im just desperately trying to get a single listView working. As I've seen when binding in xaml VS is giving suggestions.
When I setup the binding DataContext = this in code, Im not getting any suggestions according my global variables.
 
That doesn't answer the question but I think I'm safe in assuming what you mean
 
Im trying since hours.... no success so far.
 
Oh, you want to set the datacontext to a global variable?.... why?
DataContext = this makes no sense, what are you trying to do here?
 
Nah to my mainWindow and use its global variables for binding then.
 
8:45 PM
Oh darn. Er, I have no idea if that could ever work. I doubt it
Why are you doing this in such an unusual way?
 
For testing purposes I just want to setup some global variables inside my mainForm that are later used as binded variables.
 
but why?
 
How is that useful for testing?
 
Does I really have to define new classes to set them up as the datacontext?
 
Why would you not?
 
8:47 PM
I can tell you how: I would REALLY love to see some items in my shitty listview because Im not doing so since 3 days.
Because sometimes im just going for a single value.
 
It's pretty easy really if you just use it the way it's designed to be used rather than backing yourself into a hole trying to do things in a weird way
 
Creating a new class just for one value seems to be a bit too much.
As I've said im new to it. Point me the right way.
 
That's not the first time I've seen a weird notion of 'economising' on classes from a beginner
 
1 textbox -> one binded value. Nothing else. I have to create a new class for that?
 
@C4ud3x can you just show some code ?
 
8:49 PM
To be honest though I'd say the globals are more likely to be the problem
 
One sec.
 
Binding may well just be written so that it doesn't work like that. Globals are unusual in C#
 
public MainWindow()
{
    InitializeComponent();

    col1 = new ObservableCollection<string>();
    DataContext = this;

    col1.Add("test");
}

public ObservableCollection<string> col1 { get; set; }

----------------------------------------------------------------------

<ListView x:Name="listView" Margin="10">
    <ListView.View>
        <GridView>
            <GridViewColumn Width="100" Header="1" DisplayMemberBinding="{Binding col1}"/>
        </GridView>
    </ListView.View>
</ListView>
No error raised. Also no item visible.
 
Yeah that's not what DisplayMemberBinding means
That's not what that answer shows
 
Can say how hard im looking forward being corrected...
 
8:54 PM
DisplayMemberBinding is the name of the property of an object to use as the display value. You're not doing that
The context of GridViewColumn here would be string
 
Isnt the string-item a object I want to show?
 
So DisplayMemberBinding would reference a property of string
 
Oh what...
 
I wasn't sure if you can even do that with binding
 
...the name of the property on an object. Alright. And for objects that are types already? Just writing down the type "string" ?
 
8:57 PM
try {Binding .}
Yeah, I don't know. It's an uncommon use case
An answer to this question stackoverflow.com/questions/6943726/wpf-binding-to-string seems to suggest that it's possible
 
Well the usage in here is easy: Have a list and use its items inside a listview.
No rocket science.
 
What kind of topics in programming are generally considered advanced topics?
 
@C4ud3x Binding is meant for use with objects that describe your domain, making everything just a string isn't really sophisticated enough to express your intent clearly
 
Hah thats awesome. BUT. Filling this listView from code behind isnt possible either.
What about a listview with only 1 column?
 
What about it?
 
9:02 PM
Am I not allowed to use a list which fits perfectly from logic?
A list with strings -> listview with 1 column!?
Why do I need to create new classes just to fill one single control with items?
 
You don't, you could just write them in XAML
 
Tell me thats what wpf is about and Ill be quiet. ^^
 
But if you're writing a DAL that returns strings...well, that isn't a very good domain model
 
@C4ud3x <ListView Margin="10" ItemsSource="{Binding}" />
DataContext = col1;
 
Nah stop it. Your trying to find solutions for (in your eyes) weird questions of mine.
Rather correct myself how it is done the right way. Im still a big noob in wpf.
 
9:07 PM
or:
ItemsSource="{Binding col1}"
DataContext = this;
 
@FoggyFinder we've already established that doesn't work
 
why is not working?
 
Wait.
Strange.
 
what?
 
Sooo... my experience with API type stuff is using WCF services. What's the difference in WebAPI and just calling a controller method?
outside of "/api/ApiController/ApiMethod" vs "/Controller/Method"?
 
9:10 PM
@Foggy I've picked the second one. Now it is working. Yesterday the same approach ended in having multiple items in the first row of the listview.
Like 3 rows in 1 row in the listview.
Anyway, thanks so far. This is working.
 
@Bardicer WebAPI formats as an API format (XML or JSON) by default. MVC controllers are meant to serve HTML primarily but can be frigged to do XML/JSON instead
@Bardicer in aspnet core they've been unified, it wasn't a distinction worth keeping
 
@FoggyFinder But if this is set to the listview itself, how could I bind a second column?
 
controllers are controllers
 
2 dimensional ObservableCollection?
 
So basically WebAPI used to be a thing, but is pretty much obsolete for a while?
err... "for a while now"
 
9:12 PM
@Bardicer I wouldn't say that. It's more that MVC and WebAPI now use most of the same classes
 
ok
 
@C4ud3x I do not understand what you want to :(
 
2 Columns.
1 column is working with your example.
 
easier to just create a class
 
it looks like the biggest difference is WebAPI will determine XML or JSON format on its own, whereas controller methods have to be explicitly declared as JsonResult
 
9:13 PM
Alright.
And create a ObservableCollection for every column?
 
no
ObservableCollection<SomeClass>
 
@Bardicer sounds about right. But when you start thinking about REST, content is content
Strictness about content negotiation etc etc
 
ok
thanks :D
 
Ah lol ok.
Just the other way.
So the ObservableCollection is holding full rows as classes.
And the props of the classes are binded as items/columns
 
When I try this: SendKeys.Send("{TAB}EnableCheats test{ENTER}"); I get an InvalidOperationException was unhandled error in System.Windows.Forms.dll. Am I doing something wrong again?
From what I understood, SendKeys.Send supports sending multiple keys. So I don't really understand what's going on.
 
9:22 PM
public class SomeClass
{
    public int Id { get; set; }
    public string Name { get; set; }
}
        public ObservableCollection<SomeClass> col1 { get; set; }

        public MainWindow()
        {
            InitializeComponent();
            col1 = new ObservableCollection<SomeClass>();
            DataContext = this;

            col1.Add(new SomeClass { Id = 0, Name = "test0" });
            col1.Add(new SomeClass { Id = 1, Name = "test1" });
            col1.Add(new SomeClass { Id = 2, Name = "test2" });
        }
<ListView  Margin="10" ItemsSource="{Binding col1}" >
    <ListView.View>
        <GridView>
            <GridViewColumn Width="Auto" Header="1" DisplayMemberBinding="{Binding Id}"/>
            <GridViewColumn Width="Auto" Header="2" DisplayMemberBinding="{Binding Name}"/>
        </GridView>
    </ListView.View>
</ListView>
 
Wow. Need to save that.
Thanks a lot.
Im really sorry for my next question...
But what if I wanna add a new column :/
 
)
that should display the 3rd column?
 
For example, yes.
Just like when I wanna bring the ability, that the user can add new columns.
I guess thats the point where things are getting complicated...
 
It is quite difficult. Perhaps you can do without it. What you want to do?
 
Never mind. I forgot that you can't send keys to a background process without putting it on the forground first. Not like this anyway
 
9:28 PM
My full goal is a bit advanced. In general the user can save a csv-file. My tool should provide a lot of properties. Like 10 or 20 of them. The user should get the abiliy to fully decide how the csv-file is formatted.

I thought about creating a listView where the columns can be reordnened. Each column should hold a comboBox with the available properties.

So in detail: I just need one single row.
But my questions here were facing my general problems with binding because Im new to wpf.
There is no fixed count of columns the user has to output. Maybe hes in need of just 3 properties he want to save.
So my listView could start with lets say 3 columns and a button to add new ones.
 
hmm, maybe it makes sense to add rows, not columns?
 
In Winforms that would take maybe 30 minutes for me. WPF feels like there's the need of being a professor for that.
Then you havnt understood what Im talking about. Ill try another way:
The tool has 30.000 lines of data with properties like name, age, gender, state, phone and so on.
The Listview shows up 3 columns with comboBoxes.
Each comboBox is holding ALL properties (name, age, gender...).
The user could pick "name" for column1 and "age" for column2 and leave everthing.
I want to create a csv-file then with 30.000 lines just with name and age.
The 30k lines arnt displayed anywhere.
For sure not inside the listview.
Its just working as a "settings"-table for the csv-format.
With your example I would need to add new properties to my class. Cant even imagine if this can work in any way.
Maybe thats too much for a conversation.
 
I think I understand what you're saying
although I can't think of a normal way. Try asking here: chat.stackoverflow.com/rooms/18165/wpf
but on the weekends almost always quiet
 
9:44 PM
Oh lol. I've searched for the WPF-room.-
Couldnt find it. Thanks.
No problem, ill come back tomorrow in the morning. The "workers" will be online then. ^^
 
Thanks a lot anyway! With your example I can at least work with normal lists.
 
glad to help
 
Hey guys, I didn't want to flood this room, so I posted a separate question. Can anyone help please? stackoverflow.com/questions/37379975/…
 
9:47 PM
Hey there.
 
Hi.
 
So... anyone know why the 3 extremely similar methods have different results?
 
sorry, I've never used .Dispatcher.Invoke
maybe you can use 'Async'?
 
Just tried async on all 3. No difference :/
 
sorry, a little busy right now to reproduce the error yourrself
I mostly use F# with WPF, so the C# code a little bit strange for me =)
 
9:57 PM
I didn't know anybody actually did that :)
I'm glad it's possible/practical though
 
Damn. Ok it's kewl. I'll wait till morning to see if someone answered it. I'll just put it on hold for now
 
10:18 PM
@betarunex I think it's to do with where you sleep in each case
Although I'm not sure I can explain the initial delay on the first case
If the question is generally about 'why isn't this smooth?' then I guess the answer is that the Task library isn't designed to work like that. It's treating the work as computation and doing it in a way that is efficient, rather than timely
 
@TomW I tried it in different places. someone explained case 2 quite well to me now, but 1 and 3 still unkown. and it's more to avoid having a delay or lag. But I've been told how to fix it now. Still want to know why there's a lag with the first button press in case 1 though...
nevermind. I understand what the guy explained for case 3 now too
 
00:00 - 19:0019:00 - 23:00

« first day (2045 days earlier)      last day (2886 days later) »