« first day (650 days earlier)      last day (3499 days later) » 

user3010322
5:41 AM
Please tell me someone here is alive. ;~:
 
Well, "alive" might be a bit of stretch.
 
user3010322
So you're dead, then?
 
user3010322
Or perhaps we're both in Limbo?
 
What is a chat room, if you think about it, but disembodied voices floating in a featureless white plain?
 
user3010322
Hmm... it's also a place where individuals often come to bemoan their losses, confusion, or misunderstanding at the complexities of life.
 
user3010322
5:51 AM
And also voice their regrets.
 
I think we're on to something here.
"Stack Overflow Chat: Where you can experience purgatory without all the hassle of dying"
 
6:06 AM
Were you actually here to ask about something, or only to relieve some existential, solipsistic dread?
 
user3010322
I was going to ask about something, but I figured it out.
 
Glad I could sort-of-but-not-really-help.
 
user3010322
:D
 
6:51 AM
@ReedCopsey thank you
 
Dammit, I see WinRT added a PlaceholderText property to ComboBoxes in Windows 8.1. But WPF's ComboBox is still a sad little thing.
 
user3010322
7:12 AM
@AvnerShahar-Kashtan Why so?
 
@ThePhD Because it doesn't easily support adding - and styling - default placeholder text for a ComboBox.
 
user3010322
7:23 AM
@AvnerShahar-Kashtan I don't know what default placeholder text for a combobox is. :D
 
The default text displayed before an option is selected. "Please choose category...", and such.
 
user3010322
Ah.
 
user3010322
Why isn't that just a plain ComboBoxItem or ListItem?
 
user3010322
It should just be an item like any other.
 
No, that's a bad solution. My ComboBoxItems come from my data. I don't need to add "not a category" to my categories list.
It's purely a UI feature, and shouldn't affect my data.
Also, I want to see it in the Selection box, but not in the list of options.
 
user3010322
7:32 AM
<ComboBox Placeholder=true> vOv
 
user3010322
It should just, on-the-fly, generate another ComboBoxItem
 
user3010322
And set its DataContext to a special PlaceholderComboboxItem or something.
 
7:46 AM
But I don't actually want it as a ComboBoxItem. I don't want it in the list and I don't want it selectable. I just want the SelectionBox to display a default text.
There actually is a SelectionBoxItemTemplate, but it's read-only and not easily customized.
 
 
3 hours later…
10:32 AM
Morning/Afternoon peeps
 
hi good afternoon
 
Hello.
 
@Denver How can we make
private DropDownModel _mySelectedItem_All;
public DropDownModel MySelectedItem_All
{
get { return _mySelectedItem_All; }
set
{
if (_mySelectedItem_All != value)
{
_mySelectedItem_All = value;

OnNotifyPropertyChanged("MySelectedItem_All");
}
}
}

generic for all dropdowns?
 
You rather ask someone more qualified.
 
Learn to use IsSelected in xaml
 
10:43 AM
I didnt find any IsSelected property for ComboBox
 
perhaps google?
Selector.IsSelected
Yup, attached properties are a thing too!
you can also search this transcript for multiple references of IsSelected - it must have been discussed at least 2 dozen times in here
 
well actually WHat I was trying to do is set the selectedItem of a combobox to a default value.
 
I am going to make an application to create and manage D&D characters. D&D is table game with many sets of rules. D&D character is similar to all kind of RPG characters. It has main stats (strength, dexterity and so on), defensive stats (armor, dodge), skills, inventory, money and so on. All these stats are somehow connected with different formulas according to the rules of the game.
So I need an application, which will be capable of:
1) generating character by setting main stats and calculating remaining stats;
 
11:00 AM
while MVVM is a concept - you generally need to figure what your starting point should be
I normally build from Model side to view side
and i do it iteratively - that may help you too
i.e. create a simple model, create a view and figure out the VM needed to join the two
repeat cycle adding complexity everytime until your application is done
but this is just how I do things - you'll need see if this works for you or your brain works better with a different approach
 
yes that's how I started and
its working fine
but After this I was just trying to remove the redundant code, that's where ZI thought of doing it in generic way.
 
Yea this agile method works for most - but still, people are different and may need differnet methods :)
umm the answer was for Denver
for you the answer remains: learn to use IsSelected
 
Well, I like the iterations method. Usually every next iteration will be better than previous one.
 
usually.. yes :)
 
I guess I read that in McConnell's book. He said something like
Iterate, iterate and iterate.
 
11:04 AM
@Denver, maybe try a simple iteration of one screen using MVVM concepts. Then once you get the gist of MVVM look at the frameworks already out there. I personally swear by caliburn.micro
but, caliburn will do you no good unless you understand the underlying MVVM concepts
 
If you would like I can show some code as well.
 
Wooo I got an invite for Bleep!! :)
 
@ArijitMukherjee Nah, no need, thanks.
And thanks for the answers.
I will check it, Peter, the Dread Pirate.
 
@Denver I was talking about my query :) lolz :p
 
And thanks for input, Maverik. I guess I got something in my mind to start from.
@ArijitMukherjee :D
 
11:11 AM
We're not a debug service Arijit, and I doubt anybody here likes to repeat themselves
we've given you the pointer, its your job to explore and learn
 
11:48 AM
Morning. I've been here for hours. You all saw me.
 
Well, yes, you did not hide.
Hello.
 
Hi :)
 
ohai!
 
12:04 PM
So this is fun... while(reader.Read()) is apparently an infinite loop on this particular file.
typeof(reader)==FileStreamReader
 
Is it a file of infinite size, by any chance?
 
Doesn't seem to be.
 
Wait, why shouldn't it?
Read() returns -1 if no characters are left to read.
 
Okay, a quick google doesn't confirm while(-1) exits, so let me do a quick mockup.
it did eventually exit, just took forever. It is a 29meg text file, so perhaps that's to be expected.
 
How long did it take?
29MB isn't that much.
 
12:11 PM
I dunno, 5 minutes or so. The problem has to be deeper, somehwere.
 
Seems a lot. Are you reading one character at a time?
 
I lied. var reader = new XmlTextReader(file);
so I'm reading an attribute at a time. There are a lot of attributes on each element
I can't cast serialize this to a class because it is invalid xml.
 
Ah, that's different. That does return bool.
How about loading it into a DOM, is it as slow?
 
not sure how I'd go about that.
 
XDocument.Load(file);
 
12:20 PM
investigating.
25 seconds to do one complete object (contains 56 sub objects). I can't imagine how it could get slower.
 
Is the file on a network drive?
 
Yes.
 
12:35 PM
Might be the issue. Reading node by node over a slow collection might be multiplying the network overheads.
Maybe you can copy it locally and read it from there.
 
12:46 PM
That's a thought. I'm narrowing down the problem still
last week I had this taking a few minutes.... it became super slow while bug fixxing.
(a couple of minutes for the overall data set is totally acceptable)
 
Or maybe suck it all in using File.ReadAllText, then do all your manipulations on the in-memory data.
 
I think this is an unusually large data set that doesn't have as many previously known objects as smaller samples. If I let it run a bit I think it'll speed up. Maybe.
 
Am I right, thinking that View is XAML, Model is property storage, ViewModel is sort of controller? Well, describing it shortly.
 
That's sort of how I treat it.
But I am not a wpf guy.
 
@Denver Not really a controller, since it usually doesn't coordinate processes between several views.
The ViewModel is in charge of translating. It lets the View be a simple view without business logic, and the model be simply data without UI logic.
Similar to MVC's controller, but not entirely the same.
 
12:57 PM
Bill did you get my invite from Bleep? :)
 
Well, yes, that is quite how I understood it.
 
I'll check spam.
 
It takes the business logic (which is probably a bunch of service calls that take/return Model objects) and exposes it in a way which WPF can bind to easily. MVVM really was tailored to WPF's needs.
 
Not seeing it @Maverik
 
mm.. may be it effed up somewhere
 
1:01 PM
I see. Well, now when I understood the basic concept, I need to learn how to work with XAML. TO THE XAMLMOBILE!
 
There's quite a learning curve for XAML, but once you're over it... well... it only occasionally hurts you.
 
I think I forgot to morns :(
Morns all :D
 
Present us the morns.
 
MORNS EV'BODY
 
Hurrah! Morns!
17:00 going home time.
 
1:03 PM
Welcome Andre!
Mav, poked you on hangouts.
 
@AvnerShahar-Kashtan Yeah, all the styles, templates and stuff seem to be quite twisted.
 
ah ma hangouts is offline
imma try that new hangouts based on WebRTC
 
What is Bleep?
Music downloader?
Who needs it when you have pandora?
 
Bleep is secure bittorrent powered chat client
this is being developed in response to the nsa peekings that happened a while ago
its invite only closed pre-alpha right now
 
ow
So there are few Bleeps.
Since google says it is something about music.
 
1:10 PM
probably but I'll need to use it to actually see them
 
I use one that supports PGP. Good enough for my purposes.
ChatSecure is the android app.
 
@Billdr Me? But my phone did not tell me anything about it ._.
And Mav is using social medias ?
 
@AndréSilva I tried making a place for me to blather off topic for a while. People had trouble figuring it out and/or don't care to hear me blather.
I'm bill.strait@gmail.com if you want to add me to hangouts.
 
Haha I got wifi with less proxy limitations, I think I can go on hangouts
 
surely your phone can.
 
1:28 PM
Just added you
 
2:08 PM
hi
 
heyyas
aaahhh, I used to drop a lot of things if they were similar. Now I'm commiting everything to the database, hence the exponential time increase.
 
> a language like C# in maybe about a year
 
3:07 PM
Need help with BackgroundWorker and Progress Bar: stackoverflow.com/questions/25021838/indeterminate-progress-bar
 
hi
i read your question
i think you should try to make a brand new app that consists of just a progress bar
to simplify your code all you need to do is perform a sleep on the main thread, and try to get the progress bar to tick
you can do this using a background worker
 
that so does not sound right!
 
3:39 PM
I think he means use sleeptimer to see the progress bar tick @Maverik and hi, thanks for not acknowledging me
-_-
 
hmm? Hi !
sorry i wasn't ignoring
 
I think juliens suggestion is valid
 
4:06 PM
yea valid, but taking that route means somethings really wrong at the core of problem
 
eh? he is essentially asking how to perform a task asynchronously
all you need to replicate that is a sleep on the main thread and a background worker that does something
if he can do that, i'm sure he could solve his apps issue
 
I just want an infinite progress bar
I don't want to report progress
and yeah, I want to learn/get better at performing the task asynchronously while another background task is running
I can start a new project to simplify the code and see if it works
but I wonder if I am using the backgroundWorker correctly
Also I'm running .NET 4.5, so I could use await/async but I was having problems with that, so I switched to BackgroundWorker
why do I need to use sleep?
The thing is I don't think I need sleep or timer or anything
 
an infinite progress bar? that defeats the purpose of a progress bar
 
I just need the progress bar (indeterminate/infinite) to run while the background task is running. When the task is complete, the progress bar should disappear instantaneously/not show anymore.
 
are you meaning a busy indicator?
 
4:14 PM
yeah
I wasn't sure what to call it
 
there are busy indicators out there, maybe go with that... that's simply a control with an animation
 
Just something to indicate to the user that the application is currently frozen and that they have to wait until the background task is done before continuing
I have a nice busy indicator on the front end using XAML that I found online
but I'm not sure how to use it asynchronously
with the task I have
 
so you will have a boolean that controls whether your progress bar is active or not
you will turn it on
fire up your background worker that sleeps for an arbitrary amount of time, and then turns the bool off
the sleep is just there to represent whatever actual work you are doing in your real app
the point of the background worker is that you dont actually want your application to freeze while it is working, you want the window to remain responsive
 
Yup I have the boolean already :D
yeah so the way I previously had it set up initially
I had a boolean for visibility
 
thats fine
 
4:22 PM
but the problem was the progress bar was frozen
so I looked into BackgroundWorker
 
you need to make sure you are doing your work inside the background worker
that way your UI is not affected
and the progress bar will continue to progress
 
Can you give me an example of how to do my work inside the background worker? That is, why my code is failing right now?
Do I still need sleep?
 
if you are making a little test app
 
because the background task is arbitrary in tme
 
the sleep is just my recommendation if you are making a little test app
 
4:23 PM
ah ok
 
it is there to represent whatever work you are doing that is taking a while
 
thanks
have a question
is it safe to set my boolean visibility to true/show when I call my method
 
you would set it to true
and then start the background worker
 
and boolean visibility to collapsed/false when the method is done
 
background workers have a completed event where you could reset the bool
 
4:25 PM
which event?
 
worker.RunWorkerCompleted
 
ok thanks
btw I found an example
and it uses this syntax
bgWorker.DoWork += (s, e) =>
Is s sender and e event?
Those symbols are not recognized on my compiler
 
i think that is just for an inline function
you can provide an actual function or do one inline
 
ok thanks.
for RunWorkerCompleted, I just put the visibility to collapsed in there
Also I tried again in my main project and I keep getting this error: The calling thread must be STA, because many UI components require this.
Might have to try on another project but what could be the issue?
Actually, I have one question
when should I do declare dialogService.ShowDialog("Progress", progressBarWindow); ?
Inside my DoWork Method or the method that has the background task or...?
 
inside the progressreported
you uhh, show the dialog before you start the backgroundworker
you can't do any UI related things on a non UI thread. that goes to say you can't change any properties bound to the UI on a non UI thread.
 
4:44 PM
posted on July 31, 2014 by ericlippert

A query expression in C# is, as you probably know, just a syntactic sugar for a bunch of method calls. For example, from customer in customers where customer.City == "London" select customer.LastName is a syntactic sugar for customers. Where(customer => … Continue reading →

 
hmm
I want to show the progress bar when a user clicks on a button
currently when the user clicks on a button, a command runs the method that carries out the background task
in this mess, where should I display the progress bar?
 

« first day (650 days earlier)      last day (3499 days later) »