« first day (1589 days earlier)      last day (2560 days later) » 

12:59 AM
                        <DataTrigger Binding="{Binding SelectedItems.Count}" Value="1">
                            <Setter Property="Text" Value="{Binding SelectedItems[0].Header}" />
                        </DataTrigger>
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
lol. HOW
it works but keeps throwing this annoying error in output
 
SelectedItems is often empty on load
so binding to SelectedItems[0] fails frequently
(which shouldn't matter given the count, but heh 😋 )
can probably use SelectedItem.Header and avoid it (which is stupid, but works in a lot of cases)
 
its based on a listbox on extended selectionmode, so i was trying to avoid having a singular selecteditem
 
 
7 hours later…
8:30 AM
Morning
 
morning
 
So I have started a new App for windows store :) An app to give near real-time notifications about your other apps on Windows store.
And I need properties on Window like transparency and Windows style that are not available in UWP.
I am using WPF for this one, then converting the WPF app to UWP with Desktop Bridge.
 
8:51 AM
Morning
 
hey @Markus
what's up ?
 
morning
 
Trying to fix my stupid car....
 
which one ? :)
 
Rangie
fuel line is rusty
 
9:02 AM
put ether in it
 
ether?
 
diethyl ether
 
is that rust remover?
problem with that is that if I remove all the rust, there will be NOTHING left...
 
it will take care of your problem with your engine
 
ahaa
blow it up?
 
9:15 AM
in a magnificent sound & light show
:)
 
I might try that
or just add fire and theft protection to the insurance and place it in one of the no-go zones in my town
 
theft protection's pricing depends on where you usually park the car
 
9:30 AM
nae, were I live, not usually park :)
 
because where you live is a good indicator of where you usually park your car
 
how does the yaris work? or what was it?
 
yaris yep
nicely so far
much better when the weather is soft
not too cold I mean
otherwise I have to burn fuel just to heat the car
and when the car's hot, I've arrived
 
 
3 hours later…
12:41 PM
@Julien Reeds right - you can bind to SelectedItem with SelectedItems mode.. in extended mode SelectedItem = SelectedItems[0]
 
0
Q: Generate report of the current page as PDF using itextsharp in WPF

user3610920I have some details in the wpf page, I want to generate report for that page. Say for example I am having a page with one image and some text boxes. If i click report button, that page should be popup in a window with Print and PDF options. How to achieve this?The links that i have found regardi...

 
Morning
 
good morning Alex
 
Hi Franssu
What's the best way to return a message from a SQL Server sproc? As an OUTPUT param? Or return code?
 
12:58 PM
no idea, sorry
 
my head hurts with MVVM. I have just done something that works but does not feel right, which usually means i have done something wrong. I have free access to PluralSight so I will be using the MVVM, XAML, EF and C# courses availble but this isn't right is it:
                    _currentJournal = JournalData.FetchJournal(_selectedItem.JournalEntryID, _selectedItem.JournalID );
                    Date = _currentJournal.Date;
                    Time = _currentJournal.Time;
                    Text = _currentJournal.Text;
I think I should have bound to the CurrentJournal items rather than local ones in the ViewModel
 
1:16 PM
@Alex, you recommended the Material Design toolkit for WPF. Have you ever used it yourself?
 
Yes, it's used in the project that went live last month
 
Nice
I'm in the process of use it for my application, currently making the login part: i.imgur.com/hom4rHo.png
 
It's not just the product itself, but the support: You can post questions on Gitter: gitter.im/ButchersBoy/MaterialDesignInXamlToolkit
 
I was thinking I'd rather have the CAPS lock warning like this: uxforthemasses.com/wordpress/wp-content/uploads/2015/03/…
 
And James Willock, who's the program's developer, will answer. Can you beat that?
 
1:19 PM
That's pretty handy :P
 
That looks great
 
The first or the second? :P
Because I'd prefer if I could do something like the second, but without affecting the size of the dialog. Like an overlay instead.
 
Missed the first. Both are good. First one is inside the dialog, but second is less intrusive somehow
 
That's exactly what I thought. :P
 
In the end, either is fine; which is easier to implement?
 
1:24 PM
First is already implemented, so that'd be the easiest :P
 
Then go for it. I only see that particular warning message once in a while on my machine anyway
 
That's of course true.
Do you think separate remember options is good or bad? It adds more choices which is bad, but it's more convenient which is good. I couldn't find any UX material that deals with it.
 
Hmm. I'd opt for one that remembers both values... somehow doesn't make sense to remember my username but not pw
Less is more
 
Yeah, and I recall plenty of places that just remember the username by default after successful login.
You weren't kidding about James Willock. Got an answer within minutes. :P
I usually find that Gitter is very unreliable.
 
James is one of the good guys out there. Shares his knowledge and answers questions all day
 
1:40 PM
 
I just learned today that you can do Ctrl+Shift+V to paste from history in Visual Studio. Never knew that before.
Very helpful because I have a habit of using Ctrl+X to delete, since it's easier with my right hand on the mouse. :P
 
Didn't know that. Kewl!
 
Nor did I :)
<- newb
:)
 
Might be an age thing :P I've grown up with the principle that a clipboard will hold one value, and to get anything else would require additional tools installed.
 
Pretty sure Alex and I have you beat, there ;)
(agree re: the one-value thing :)
 
2:00 PM
@TheresaFerguson yes should have bound to CurrentJournal.. anything you can dot into in code can also be done in xaml
@WilliamMariager neither did I, thanks :)
though for the same reason: clipboard is meant for the last item.. my brain is wired for it now :)
 
2:13 PM
ctrl-shift-v is great
so is ctrl-shift-t
 
As ctrl-z is undo, ctrl-shift-z needs to be redo. I hate it when they try to make it ctrl-y. I don't care if they are next to each other in the alphabet. They need to be connected in their placement on the keyboard.
 
you can remap it, but i doubt that is ever going to change
that is like windows 95 holdover
 
I recently installed PowerCommands and it remapped redo to ctrl-y. Annoyed the fuck out of me until I changed it back.
 
@Maverik Skype still out of commission?
 
If I have a property in the codebehind for a Visibility value, how can I bind it to the Visibility property of a control in the xaml?
 
2:24 PM
same way you bind anything
 
For us keyboard jockeys, here's a complete list of keyboard shortcuts in VS 2015
 
Visibility="{Binding MyVisibiltyProperty}"
 
But remember you need to convert true/false to Visible/Hidden/Collapse
 
there is a built in BoolVisibilityConverter i believe
 
Yep, it's quite handy
Usually, I go for "Collapse" so the element doesn't take any space in the layout when "false"
 
2:29 PM
The property isn't a bool, it's a Visibility
For some reason it isn't working
 
Visibility="{Binding testestestest}"
look for error in log
 
Are you using proper MVVM @Hypersapien? If it's a property on your view, you need to do it differently. We're assuming you're talking about a property on your view model.
The worst part about having a large resolution is I constantly break convention/code guidelines on line length. Why should I use 60-70 chars per line when I can do 120-180!!
 
Hehehe! William, I never have to worry about that here with these silly screens ;)
 
Oh man, you're still stuck on those tiny screens? :P
 
@WilliamMariager No, I don't think I am
 
2:37 PM
Yeah. Asked boss for a 24 inch. Might get it before we celebrate Year 3K :p
 
Just the fact that you only asked for one :P
 
If you only knew...
 
I recently had a look at this one: pcmag.com/slideshow/346070/…
Not 100% sure yet though.
 
drooling
OK, that's a nice display
 
Still undecided if I want multiple displays or one large one like that. Since it's 43" I get lots of screen real estate.
I feel like I'd have to try it. Maybe find a place that takes returns. :P
 
2:40 PM
Multiple of those!
 
And play Call of Duty
 
A nice feature about the display is that it also charges my laptop when connected, since it uses Thunderbolt.
Or USB3.1. I can't make heads or tails with those standards. :P
 
@Julien
System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=testtesttest; DataItem=null; target element is 'DataGridTemplateColumn' (HashCode=39627394); target property is 'Visibility' (type 'Visibility')
 
2:56 PM
It says I need a "governing FrameworkElement or FrameworkContentElement. Do I need to specify that it's coming from the class code somehow?
 
@WilliamMariager bad idea mate - its good only if you can have it at distance
 
You're probably right.
 
but at normal typing distance, it'll strain your eyes and you won't be able to contain the entire screen in your head.. you'll be doing mental page swap :)
so multi monitor is good idea -- I have this big screen high resolution issue with my 1440p 27" even!
though its certainly not too bad.. but if i'm actually focusing on something like code on this screen, i can't hold the entire resolution in my head without bobbing my head to swap partial view out and refresh with new partial view
(np in movies .. but slightly noticeable even in micromanagement games that run at 1440p natively)
i guess movies don't suffer from this because they just scale up and things just become bigger and overall impact of it being higher resolution gets negated
 
3:18 PM
Are you around @Julien? I found an old question of yours about custom authentication with Web API and I was wondering if you found a solution?
 
yeah. that was a fun question
i have a solution i am using now
been a while since i looked at this stuff
i use Basic Authentication on IIS
i decorate my API methods with [Authorize]
i have a BasicAuthHttpModule class that i can't remember how it works, but it intercepts all requests against [AUthorize] methods and runs my own custom user/pass validator
 
We're struggling to make sense of Windows authentication in MVC
 
yeah tbh i just poked at it until it worked
 
@Julien I get the same error in the Output whether it's the real property or not.
 
With this stuff, that's how you do it :)
 
3:24 PM
Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=testtesttest; DataItem=null; target element is 'DataGridTemplateColumn' (HashCode=39627394); target property is 'Visibility' (type 'Visibility')
 
@Hypersapien it looks like you are binding against view elements ?
 
I'll have to check that out Julien. I already have a system in place to generate sessions with tokens. I was just hoping to be able to use the builtin system rather than do checks manually in all my calls.
 
generally when people say binding they mean against a view model class
@WilliamMariager to use the built in system, you have to know how Identity Server (?) works
it involves building a database of users
 
Yeah, the class model. The backend code, not the xaml.
 
i already have my own, so it didnt make sense
@Hypersapien well for some reason your binding is using a view element as its target
i really hate data grids, i think they are terrible to work with, especially for beginner
do you need cell selection and column sorting?
 
3:26 PM
The view is the xaml, right?
 
I have the evil DG in one place in my app. Everywhere else, it's LVs and ItemsControl
 
yes
 
The view is whatever class that extends from Window/UserControl.
 
datagrid is the most complex and hardest to use of all the list controls
avoid if possible and use listbox or itemscontrol
 
Which includes both C# and XAML.
 
3:27 PM
And it's kinda buggy
 
No. I'm just trying to hide a given column depending on certain variables
Actually, I do need column sorting
 
Can you share your XAML and view model on Gist?
 
I have to thank you for the Postman recommendation @Mav :P It's so much easier to test things.
Especially when you need headers, body text and different methods.
 
here is an example of a headered, columned items control
also sortable by clicking column headers
 
pleasure william :)
 
you havent assigned a data context
i guess datagrids just assume the context is the parent column or something
in your datagrid.cs, add DataContext = this
see if your error changes
DataContext tells the binding engine where it should be looking for properties
all controls inherit the data context of their parent
 
Like, in the constructor?
 
thats where i usually do it
 
Same error
 
dunno 😒 not familiar with datagrids
 
3:37 PM
@Hypersapien I can't even see this bit of code in gist.. which line is it referring to?
also never seen that error before
 
3:49 PM
Mav, you recommended a website to use with SeriLog, so I could poke around the logs. What site was that?
So far I've only used SeriLog for file and console logging.
Seq!!
 
Been pretty impressed with Serilog. Used it for console logging and also writing to SQL Server using a sink
 
Same here. Mav is full of good tools.
 
4:07 PM
@Julien *and ItemsControl-derived controls cause the DataContext to automatically switch to the child DC for the ItemTemplate
^ @Hypersapien
 
so the data context of the item of an itemscontrol derived item is the item itself
and in the datagrid instance, it just happens to work out to be the column ?
 
Never done datagrid... how does that work?
Guess it makes sense, though...
I guess I would have expected the ROW to be the child DC.
And columns are properties.
 
4:39 PM
Fuck the binding. I just set the visibility manually on the Loading event.
 
lol. good luck with WPF in the future
 
I can't tell if you're being sarcastic or not
 
I think he's being serious.
 
binding is like a cornerstone of wpf
you are only going to be able to ignore it for so long
the sooner you embrace it, the better off your programming will be
 
@Hypersapien patience is key right now. Hang in there.
 
4:47 PM
If no one here can help me fix this thing or point me toward a resource that explain it to me, don't blame me for doing something that I do know how to do to make it do what I want.
I have other shit I need to work on.
 
there is this great site called stack overflow
you can ask questions on it
 
what are you trying to do? You're trying to hide a column based on what?
 
im not blaming you for anything. just pointing out that the "fuck binding" approach is not going to do you any favors
 
I have a property in the view that returns a Visibility. The logic works, but I can't get the binding to recognize it.
 
What does the viewmodel look like that you are binding to the DataGrid?
 
4:49 PM
I still don't know my way around WPF. What exactly is a viewmodel?
 
it is a class that holds properties referenced by the view
 
You need to do more research, if you're willing to learn.
 
you use a view model to isolate your view from actual data
it is also the "correct" place to put logic that determines whether an item should be visible or not
 
Shit, the property is in the view, not the model.
 
One way I learned it is by downloading the most basic examples from tutorials and reading that code. Then writing my own basic examples.
 
4:51 PM
so in your case, the only difference that makes is what your DataContext is
if you set your data context to the view, it's about the same as creating a new view model class and setting data context to that
 
The property is in the view, you need a bool inside a viewmodel instead. The model should be something like, items in a database maybe?
 
just less MVVM'y
 
I did that. It didn't work
 
yeah. thats the real question
your column has its own data context for some reason
 
This might help with learning about MVVM and view models in WPF: codeproject.com/Articles/819294/…
 
4:55 PM
I hate the new office layout here. We used to have a supply closet I could go in and take a 10 minute nap in or calm myself down when I'm frustrated with something. Ever since the remodel there's nothing.
 
Take a walk, if possible. I walk around the outside of my office
The exercise helps to clear the mind, calm the nerves, and bring fresh insights to problems
 
NO BREAKS ALLOWED BACK TO WORK
 
^ that too ;)
 
I might do that since they're replacing some desks in here now
Naturally not our shitty desks. Just the managers
 
5:10 PM
William: sorry I've been busy with other stuff .. not paying much attention to chat here.. if you really to get hold of me, ping me please :)
 
Ping ;)
 
5:27 PM
yeah, might be best using itemscontrol
29
Q: Binding Visibility for DataGridColumn in WPF

ygoeHow can I hide a column in a WPF DataGrid through a Binding? This is what I did: <DataGridTextColumn Header="Column header" Binding="{Binding ColumnValue}" Width="100" ElementStyle="{StaticResource DataGridRightAlign}" ...

I tried implementing ^ and that did not work
 
First of all DataGridTextColumn or any other supported dataGrid columns doesn't lie in Visual tree of DataGrid. Hence, by default it doesn't inherit DataContext of DataGrid
one more reason to hate datagrids
they are like context menus
the devil
 
yis
@Hypersapien here's MVVM for your viewing pleasure: gist.github.com/anonymous/1d87ccfe83a3d173e638ab77420c9ed1
 
5:55 PM
Kevin, you're quick!
 
be faster if you used fody :D
 
6:24 PM
@Kevin this should work
 
Did you guys see this?
Cloudflare have been leaking customer HTTPS sessions for months. Uber, 1Password, FitBit, OKCupid, etc. https://bugs.chromium.org/p/project-zero/issues/detail?id=1139
Pretty sure SO is behind cloudflare.
 
Heard about it earlier today
 
When it rains, it pours...
First SHAttered, now this.
 
It was a "buffer overrun" (Fortune article)
Over 3,000 domains are on CloudFlare so lots of sensitive data has been compromised
 
6:39 PM
@JohanLarsson no luck.
The binding is there, but doesn't toggle vis
 
hmm, wtf
 
i could just be doing something wron
g
feel free to take the gist and repo-ize it
 
Try grabbing this
It is not nice but I have used it in a couple of places
 
again, binding works, no errors, doesn't toggle visibility
wait
that did
interesting
return People.Any(p => !p.IsNameLong); and return People.Any(p => p.IsNameLong); both returning false? hows that.
ooooo
damnit
@Hypersapien the gist will work, you just need to change CanDeletePeople to return something that makes sense... unlike what i was doing.
 
@Kevin People is empty
 
6:54 PM
no its not
it always returns true... there are people with both long names and not long names.
 
7:38 PM
Hey ReedCopsey, you around?
 
What is this CPT6?
I'd like to use this, but I'm not sure how to get it. blogs.msdn.microsoft.com/visualstudio/2015/02/24/… I'm already working in 2015.
 
@Hypersapien Try this: Tools –> Options –> Debugging –> General –> Enable UI Debugging Tools for XAML
 
Yeah, found it.
 
Another similar tool: Snoop
 
How do I use Live Visual Tree to look at the properties in a popup menu? The menu goes away if I click on Visual Tree window.
 
Snoop doesn't even recognize my app
 
You need to choose it from the dropdown
 
I refresh the dropdown and there are two things in it. Microsoft.VsHub.Server.HttpHost, and something called CCC, which I don't recognize.
Probably Catalyst Control Center
 
@kevin What's up?
 
8:09 PM
@Hypersapien Is your app running?
 
Yes. In debug mode
 
Haven't used snoop in a long time so can't remember what I had to do to get it to show up in there
Try restarting snoop
 
arent the VS tools just snoop replacements
dont see a reason to go third party now
 
^ that
 
8:32 PM
I have a style for my button controls that includes different styles for different states (rollover, pressed, etc...). I have a control that inherits from Button that I would like to add add an additional state for. I already have a style for it that is using BasedOn, pointing to the button style.
 
you should probably create behaviors for the states
i dont think you can chain BasedOn to that degree
or maybe subclass button again
 
All the actual styling for Button is in a ControlTemplate. Is there a way I can take that ControlTemplate and inherit it and add the additional state, or make a second ControlTemplate and use both of them in the style?
the states are all defined in triggers
 
you can use triggers to decide which control template to define
but i think that is really ugly at that point
behaviors or sub class is better
 
This was a style I downloaded
WhistlerBlue
 
doesnt really matter. what kind of button changes does it make
 
8:40 PM
Basically there will be an additional state that is only changed internally
Wait, the style or the inheriting control?
 
i am not an expert at this. but i think what you really want are behaviors
you attach a button behavior to a button, and it can perform some logic
"when the button is clicked, change its background to red"
something like that
 
Anyone in here have any suggestions for obfuscators? Have any experience with any of them?
 
good ones cost a lot of money
not sure bad ones are worth the time
 
I've noticed a pretty hefty price tag on some of them.
 
do you really need to obfuscate your code
i sorta doubt it
 
8:51 PM
Been researching that today, and I've come across a lot. The two that people recommend most elsewhere are Dotfuscator since it comes with VS, though I'd need the pro version, and Crypto Obfuscator, which doesn't have anything beyond 2015 on its site.
 
Unless you're working for the government and they require you to obfuscate, don't
 
I don't know that I necessarily "need" it because it's still crackable given that it has to be on a client's machine, but it would make cracking my app a lot more undesirable.
 
probably not worth the effort
 
Well, I'm not working for the government, but my boss is an incredibly paranoid person, and he has demanded it.
 
then id make a license/registration system that goes through a server you host
 
8:53 PM
It's like folks who obfuscate their JavaScript. Why?
 
I've warned him that it's still vulnerable.
 
you can obfuscate easily, but then its just as easy to de-obfuscate
 
Yeah, obfuscation isn't fool/crack proof
 
um, if your boss wants it, show him the price tag
 
We're going to have the license/registration system set up, but once the assembly is on their computer, he wants it to be more or less unreadable.
 
8:54 PM
Yeah, go for a pro version in that case
 
never going to happen
short of paying big money
 
Not worth it either, unless you're hiding the secrets of the universe in there. And even then, you'd want to share it :)
 
yeah. thats the whole issue. it not only costs a lot of money, but it makes development/distribution harder
 
BTW, the secret of the universe: love
 
if that cost isnt some small percentage of your budget, its really not worth it
 
8:55 PM
I thought it was 42.
 
it will cost less to have someone pirate your stuff then try to prevent them from doing it
 
Hehehe
 
@ReedCopsey do you have any family in Milwaukee area right now?
 
don't believe so, why?
 
walked by an office today, there was a contractor in there with the same last name as you
 
8:59 PM
You've got a doppelganger
Twilight Zone episode "Mirror Image"
 
9:50 PM
If, in a style, I want to use a resource that is defined in a template that is being imported in a setter, how would I do that?
 
ahh, okay
yeah, there are a couple of them around, but not very common 😀
 
Right now it doesn't recognize PressedOn or PressedOff in style.xaml
 
I should've switched to 2017 RC before :P Spent all this time learning how to use .NET Core and Web API with an outdated framework.
And I was annoying I couldn't include shared projects, but with 2017 RC they switched to msbuild and I can now use shared project. :D
annoyed*
Obviously I'm also annoying, but that's a different topic. ;)
 
10:05 PM
you can edit messages in here :P press up to access last message, or hover over row for options on the right
 
Only for 5 minutes. :P
 
ah
 

« first day (1589 days earlier)      last day (2560 days later) »