« first day (1439 days earlier)      last day (2710 days later) » 

04:52
Hello Guys
Good Morning
Need one help
Can anyone here ?
I want to call api in windows phone C#, but in that i will getting the space in uri.. So, its getting an exception like targetinvocationexception.
Ex.
string apiUrl = "http://demoDomain.com/GetUsers?Name=nikhil prajapati"
Now it's showing me that exception like target incocation exception
 
3 hours later…
07:47
morning
morning
morning
 
3 hours later…
10:55
updated analyzers
writing shit code, relying on tests
11:55
Hi all
12:05
hi
@NikhilPrajapati Two things to try: %20 to replace the space or +
But don't replace it manually. Use Uri.EscapeUriString on your username before building the UI from it.
^ Important
Because the string might change, so automate it
12:21
hardcode it
When writing properties, is it necessary to define a private member for a public property?
Or can you just go with what are called auto properties?
nope auto
Morning!
Hey Maverik
So no need for the private members?
I've seen both ways in examples
when needing to choose a direction - i use one golden principle: Energy is precious - must conserve
And I've gone both ways in my code
12:32
so take the side that conserves most energy for you ;)
So there's nothing gained by having private members?
unless you actually do some processing - nope
What's an example of processing?
anything that goes inside a property get/set
since auto properties can't have any body
Ohhh
12:34
if you have r# it should already tell you that you're doing redundant work and it can be reduced to auto
So this will require a private member...
this.. i haz no context
public DialogSession DialogSessionObject
{
	get { return _dialogSessionObject; }
	set
	{
		if (Equals(value, _dialogSessionObject)) return;
		_dialogSessionObject = value;
		RaisePropertyChanged();
	}
}
yea that'll need private
Now it makes sense. Thanks, Maverik :)
For much of my VMs I'll need private stuff, because I have logic in the getter/setters
12:36
as soon as you have code to put in getter/setter (other than _private = value), you need to go explicit
Makes sense now
Just noticed the official terminology... property with a backing field
And R# makes it easy to switch to that
o7
anybody reads Discord changelogs?
they're so fun to read! - they usually have something along the lines of "spit polished" joke line at the end
this time around its: We're completely out of spit. We've resorted to piss polishing things. It's sterile though, so no worries.
12:55
@Alex Auto-properties have existed only since C# 3.0, so examples written before that won't have them, naturally.
@Chandni Sirwani, Hello
@AvnerShahar-Kashtan Yeah, my main issue was telling the diff b/w auto prop and those with backing fields -- when to use one over the other. Now it makes sense :)
@Alex Yes @alex
I have already checked it but its not working
Hmm
I have replaced it with %20, also updated it with Uri.EscapeURI
but its not working
13:03
@Alex Yeah, @Alex and @Maverik covered it well. Use auto when you can, private members when you have to.
Can anyone please let me know how to resolve my issue ?
no Nikhil
your question is too vague and we don't have enough information
from the sound of your question it really feels like you're cargo culting it.
I think it needs more jQuery ™
Okay. I will update you again.
I am working on windows phone development and i want to call an api.
That API url contains the spaces in parameter.
Like ex. "http://demodomain.com/getusers?name=nikhil prajapati"
So, when i am going to call api it will raise an exception like The Remote server not found.
and I'll give you the same answer again
no Nikhil
your question is too vague and we don't have enough information
from the sound of your question it really feels like you're cargo culting it.
I think it needs more jQuery ™
My code will looks like this,

WebClient wc = new WebClient();
wc.DownloadStringAsync("http://demodomain.com/getusers?name=nikhil prajapati", UriKind.Absolute);
wc.DownloadStringCompleted += wc_DownloadStringCompleted;
Now, make sense ?
13:12
hey, I have problem with user control. I do TimeSpan editor control, it has 3 textboxes for hours, minutes and seconds. I want to be able to bind to TimeSpan object. What should be my dependency properties?
all it tells me is that you're trying to download a string from some url
i'm not seeing how is that relevant to wpf
its for C# actually
And that is the base of any functionality i.e WPF, MVC etc.
well that's certainly enlightening
thank you for sharing
@Jacek three for the textboxes you have in your usercontrol?
thanks @Maverik
Now can anyone is here who will help it out in this situation
?]
I think the remote server was not found
13:15
hmm that sounds plausible too
@Maverik I want to get whole TimeSpan object, not minutes, hours, seconds separately. I would like to join them together in my usercontrol and notify that TimeSpan property was changed.
use a MultiBinding Jacek
oh, and converter?
yes
i dont think multibinding works without one :D
13:16
okay, thank you :) I forgot about this
no problem
is it okay to bind like this in usercontrol?
public static DependencyProperty HoursProperty;
public int Hours
{
get { return (int)GetValue(HoursProperty); }
private set { SetValue(HoursProperty, value); }
}

<TextBox Text="{Binding Hours}" />

?
or controls like this should use events and named controls?
13:38
depends on what you are trying to achieve
but chances are it's neither of those
you usually bind to properties of the object set as the datacontext of your control
my control is going to be used like TextBox or other .net controls
it's just timepicker and I want it to be bindable to timespan object
then you're good
otherwise can always throw some jQuery to help :)
13:57
Morning
jQuery? Anyone needs help with javascript ?
the remote server was not found :(
and good morning
Andre jQuery is answer to everything
if it wasn't for jQuery, we wouldn't even be alive today
Well... we would, with less functions and a lot faster
@Maverik should I do another dependencyproperty for timespan? Where should I apply multibinding?
14:12
@AndréSilva blasphemy - i'm tempted to kick ban you for such sinful language!
asks chanserv for help
chanserv quits: timeout
@Jacek sorry can't answer that - i dont know how your app is structured
timespan should have been in your VM
i'd expose DPs for usercontrols textboxes
I don't have app yet, I just do control for handling time D:
when you place usercontrol in main datatemplate / view - thats where multibinding will take usercontrol dps and bind it to viewmodels timespan
ahh ok, but I have to bind to some property
14:15
thats kinda how mvvm works
like <local:MyTimeControl Time={MultiBinding Hours, Minutes, Seconds, converter=conv}
if you don't know it well - you should sort that out first
@Maverik this is gonna be an error.
and you say you wouldn't do Time property
sorry Johan, i dont know what that is - i haven't fiddled that much with DPs
14:16
so I can't see the place where to bind those
sorry jacek, can't help you more
Johan: never used DPK - how does it work?
@Maverik repro, order of fields matter when they call each other.
You use dpk for readonly dependency properties like IsMouseOver
Then you can set the value using the key and you can restrict access on the key
I updated the analyzer package, has a couple of useful ones now.
OH!!!!
jezuz - you're right .. i was being blind - ORDER of fields .. of course! totally error
It was not easy to spot
Not common but more relevant analyzer than notifying struct
yea this is a good one - but your issues copy pastes are really hard to decipher
14:22
A headscratcher
because as somebody looking at it first time, i just see text that doesn't immediately jump out as wrong
Yeah I guess I could write some descriptive text
no just simple bold on keywords will help
Plan is to close most of them fast now
like if you could bold BarPropertyKey in first line and in second line - it could draw immediate attention to what you're trying to say with title
DPs has so much text that if you don't know what you're looking for, it appears like a wall of text
doesn't help that there's no syntax highlighting
if you could just surround it with c# & it'll be a good start
though then you can't bold it i guess - so perhaps use empty line for ^^^^ kinda soft underline
and is that error/warning?
I wrote a comment
MUCH!
you can skip the usings :)
yea i'd say so
14:27
The usings are needed when I paste the code in a test later, so keeping 'em
oh sure - i just wanted to save you some code if possible :)
on key thing i've noticed as a user that i never noticed before: i don't actually notice title - the eyes go straight on the code section itself
so perhaps copy pasting title to comment is a good idea
I would (try) to write better issues for someone else's repo
my workflow is a series of huge copy pastes shrug
A job question... how do you guys handle applying to a higher paying job in the same organization? Do you tell your boss?
Well, they'll probably contact him/her if they're interested in hiring you. Better to hear about it from you, or is that true?
are you working as an extern ?
consulting ?
Nope. Full time employee
14:40
so who is "they"
My manager/boss over my current team
So if the other position works out, I'd move to a different unit in the same org
yes you certainly have to tell your boss
Oh, sorry, "they" would contact my current manager -- they being the other unit's manager
don't you ask for raises every year ?
Hah! Are you kidding me? I do, they laugh. It's a state job, so no money, or so they say
One person said I should let them know and see what can be done in my current unit
14:43
well, no money no Alex
:/
Hehehe
i didn't know asking for raises ever gets you anywhere
i always rely on my employer to know and acknowledge that i deserve a raise and if they don't feel that way then the 3 strike rule goes into motion
on third i'd start looking around
That's what I've noticed. In IT, I've had to switch jobs to get better pay/more interesting tech to work with. This except one job, where the big boss stepped in and overruled my manager. Forced her to give me a raise
well I don't wait for them to know and acknowledge that I deserve one, I ask directly and honestly
Hmm. I've already asked once. And I've also applied for the positions elsewhere in the org. Not sure what to tell boss
14:47
no reason not to do so IMO if they're happy with you
I like my bosses here. Don't want to jeopardize my standing with them
Should I cancel the other job applications?
not too sure :/
Yeah, it's one of those things you have to meditate on and then go with it.
i would have told my boss before i posted the application
but it depends a lot on size of your organisation.. how close you are to your boss - how things work and such
@Alex I can offer you a lower paying job if you are interested
14:54
:)
in my case, the organisation is too small and I'm close to my boss
I did that for a quite some time, Johan
I'm kinda close to my boss here, but org is huge
when i have explicit annual review.. they know where I stand so obviously i expect them to know the market value that I stand at as well
@Alex I was thinking writing docs PRs for the analyzer package :)
If I write them they will be annoying with grammar bugs etc.
When I'm done with this job, at the end of the day, I'm ready to be taken out on a gurney! That's how wiped out I am :)
14:58
ok, np, I'll nag :D
But if I could find full time, don't mind moving
well once you're done with that alex, then you can do stuff on my theme too :P
Hehehe
If I could get you all in a room, I'd buy you all lunch. You guys are all right :)
heh
I'm be down in... 3.5 hours.
Come on over!
@JohanLarsson But please post stuff here and I'll look them over as time allows. No charge :)
15:08
I'm thinking something like this
probably not as much text, def not to start with
Then we would link to it like this
So that it is really easy to check what an analyzer is about.
I need a bit of advice with how to design a good VM.
Minor thing... You could change This most frequently occurs when the project is configured to not produce an XML documentation file during the build. --> This usually occurs when the project is configured to not produce an XML documentation file during the build.
Those are not my docs, just a pattern I found that looks nice
Oh
Sorry ;)
Hehehe
item { enum type; string name }

list {
  item(type:"PALLET", name:"Chicken"),
  item(type:"CASE", name:null),
  item(type:"UNIT", name:"Chicken")
}
15:11
Ah, hack the site and improve them
:)
That's roughly the model I have.
@Alex It is open source, just make a PR, nothing is too small.
Now the VM should be able to show each item in the list. But I'd also like it to know about the other items. So if I change the name in one item and it's configured to synchronize them, it'll also update the names in the other items.
Designing the VM to browse each item is easy enough. It's the cross item communication that has me a bit stumped.
I could obviously bruteforce it by simply waiting for property changed events, but this will apply to a lot of fields in the model, so I would love an alternative if possible.
well pretty much all approaches basically operate on propertychanged event
they may just look fancy but i think at the end of the day its propertychanged thats at the heart of sync
15:25
Alright Maverik. :)
I love the concept, but I don't know how often I would actually end up using it. It's become second nature to do a quick regex replace with things like that if they're big. And if it's small like the sample, I'd probably just forget that I can do it like that. :P
appears to want a commercial license per developer at $9.99 if you're going to use it but can be "trialled unlimitedly"
I just did this sort of edit and replace in my c# code
granted its not often - but when it is, its very handy
at 9.99 per developer business license - i think its pretty cheap investment - there's no subscription
(though i haven't started using it yet - just found it and shared)
I need it
there was serious s*** happening in my neighbour's appartment last night
I should have called the police
What was going on, franssu?
can't say for sure
but penal things
I'll investigate
time to go home :/
bye
lucky franssu
bye o/
it was like a living nightmare yesterday so...
15:58
because of your neighbours ?
be safe man
and call the police
yep, cu
See you, franssu
16:09
wow i just discovered something new with r#
I don't know which version of r# introduced it - but you know the INPC code R# generates? if you remove the [CallerMemberName] from it -- r# will automatically start generating c# equivalent code of property changed using nameof
from:

public DateTime InvoiceDateBefore { get; set; }

to:

public DateTime InvoiceDateBefore
{
    get { return _invoiceDateBefore; }
    set
    {
        if (value.Equals(_invoiceDateBefore)) return;
        _invoiceDateBefore = value;
        OnPropertyChanged(nameof(InvoiceDateBefore));
    }
}
by using the code generation of Auto Property to Property with change notification
Interesting
16:43
didn't you get it to work @Alex?
It is one of the places where R# shines the most ime
It gets it right
Soon the analyzer will generate it
Yep, use it daily to auto generate chunks of code
It even goes from auto props to those with backing fields automagically :)
but did you get it to generate notifying props?
Yep... the trick was to add this to the bottom of my class:
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
Then the option appears to generate change notifying props
yea its the attirbute that triggers it
you can name the method anything you want and it'll still work
16:49
Ahh
Didn't know that
but remove that [CallerMemberName] to get c# 6 implementation
callermembername & = null part
so its back to vanilla implementation of c# 4 times
I'm using the MVVM Light Toolkit, which has its own implementation... RaisePropertyChanged()
@Maverik why do you remove it?
I drop that code in only to get R# to generate change notification props. Then I remove it and change all the OnPropertyChanged() calls to RaisePropertyChanged()
Probably overkill
as mav said you can name the raiser anything you want
also if you call a method in the base class you can do:
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
    RaisePropertyChanged(propertyName);
}
16:55
@JohanLarsson because if property doesn't "require" value - r# won't pass it in
sorry for double ping
I don't understand hwo you mean
by default r# uses the reflection method of passing property names in
unless you remove that, r# won't pass nameof() in by itself
or at least it wasn't doing that with me
I prefer to not have nameof when not needed for two reasons:
1) Correctness, OnPropertyChanged(); using [CallerMemberName] can never be out of sync
2) Less noise
ordered where 1 >> 2
i never go out of sync - i use Ctrl RR
less noise - mm i guess i dont mind - I simply prefer to avoid reflection wherever i can :)
wow i never knew SelectiveScrollingGrid is a thing!
SelectiveScrollingGrid is used as the panel for the DataGridRow to hold the header, cells, and details.
ok an actual wpf question - anybody knows how can i trigger a command off Loaded event?
there is event to command in blend
17:07
yea i was going to write exclusion: without using a behaviour
you can write a simple attached prop
otherwise i'd rather add a codebehind event - i only have this one off to trigger control focus
but I would subscribe to the command in xaml and do
I only need it once to start in the login textbox
hmm may be mahapps already has it
private void OnLoaded(object sender, EventArgs e)
{
    ((VmType)this.DataContext).SomeMethod();
}
17:09
yea thats what i'm gonna do if nothing lese
.Focus()
else*
I already have a command that does focusing on any random element based off a KeyBind gesture
only this one off instance when its the first time controls have loaded - there's nothing to tirgger that command
17:44
Is there a recursive notify property changed system in WPF? Something where I only subscribe to the root object and if anything inside is changed I get a notification? I'm fine if it means having to have a tree-like structure where everything knows their parent.
nothing baked in
Right, I completely forgot, sorry.
it handles reference cycles etc
no fun with third party stuff though
If I'm really bored I'll do this
It will remove the last traces of maintainability
thats going to be a hard task
you'll need a decent cookie cutter GetHashCode implementation
I'm going to give your State nuget a whirl - i was literally just writing some state tracking code
good timing on mention of nuget
(i wish i could remember that you've written most of this stuff already!)
17:58
hope it works
please write issues if not
Got a question... If I have the following code, why doesn't it ever reach the inner section?
// These are all async methods
var t1 = DrugTestViewModel.GetDrugTestTypes();
var t2 = TestViewModel.GetCollectionStatuses();
var t3 = TestViewModel.GetMroResults();
var t4 = TestViewModel.GetReasonsForTest();
var t5 = AlcoholTestViewModel.GetScreenFluids();
var continuation = Task.WhenAll(t1, t2, t3, t4, t5);

await continuation.ContinueWith(async task =>
{
	if (task.Status == TaskStatus.RanToCompletion)
	{
		// Do some async call here
	}
});
The part that says Do some async call here seems to never be called
> await continuation.ContinueWith( looks wrong
I know
Not sure what it's supposed to look like
No need for the await.
should be just:
var continuation = await Task.WhenAll(t1, t2, t3, t4, t5);
// Do some async call here
18:01
Yeah, that'd make more sense.
Johan: is there any way to say "only track changes for x property" ?
i know you have ignore property ctor on settings - but its going to be painful to exclude entire VM just to track one property on vm
maybe, can you elaborate some more
It doesn't like the await on the Task.WhenAll: Cannot assign 'void' to an implicitly typed local variable
you can ignore properties
Vm.IsChecked --- thats the only property i care to track
from my understanding - it seems i have to exclude all the other Vm properties to make it only track 1 property
18:04
yeah, maybe not a good fit for the lib if you just need to tarck one prop
yea i was getting that feeling
i basically want to read out a count of currently checked items
@Alex try:
await Task.WhenAll(t1, t2, t3, t4, t5);
// Do some async call here
Oh, so not bother with the var
are all the tasks returning Task not Task<T>?
They're running Task<T>
18:05
or maybe they return different types
They return different types... different OC's of VM's
That worked... onto more debugging of other code :)
Thanks, @JohanLarsson
So, as usual, I was overthinking the problem
Four arrows, only three properties. :P Looks like manufacturer got two.
:)
man everytime i end up doing something invovled with OC - i end up cursing the damn thing
so when OC is reset - you lose all items with no way back so I have no chance of removing event handlers
unless somebody can correct me?
18:22
yeah, no old items in the reset args
I guess I'm going to kill OC from my app and switch to SourceList from DynamicData
as a bonus i get to do: myList.Connect().Filter(person => person.Age > 65).AsObservableList();
18:35
Reflection is so great. But it always makes me feel so dirty.
public IEnumerable<object> Properties
{
    get
    {
        var type = this.GetType();

        var properties = type
            .GetProperties(BindingFlags.Public | BindingFlags.Instance)
            .Where(p =>
                typeof(XElementVM).IsAssignableFrom(p.PropertyType) ||
                typeof(XAttributeVM).IsAssignableFrom(p.PropertyType)
            );

        var values = properties
            .Select(p => p.GetValue(this))
            .Where(o => o != null); // Leave this to a value converter?
Automatically gives me a list of properties I can use with the HierarchicalDataTemplate.
19:03
Heading out early today. Have a good night, everyone
Something is wrong when you leave before I do.

« first day (1439 days earlier)      last day (2710 days later) »