« first day (1238 days earlier)      last day (2911 days later) » 

00:00
i dunno maybe I should!!
i am noob at this
tricky if it is a toplevel eventhandler
async command could be a nice fit for it
right now all my populate calls just happen instantly sequentially
because nothing is waiting for the inner task to finish
it would prevent the user from clicking twice
public async Task PopulateItems()
then you can await each call
but what do i await inside PopulateItems
the dispatcher?
if private async void LoadDatabase(object _)
@Julien yeah it is strange to run a task there
since you invoke inside it
why did you add task stuff in the first place?
00:04
i just want my stuff to load in the background, and my loading sequence has gotten progressively more complex
but you want to animate on each update
yeah
not sure you can have both easily
i always seem to code myself into these weird corners
yeah. without that inner task, the additions dont get animated
the whole listbox just renders at once
lol. what i have works ok too, the only reason i want to do this is to show some loading indicators of whats happening in the background
but the loaders methods are all abstract, so i don't really want to put the notifications there
 
8 hours later…
08:07
Morning
morning
M!
08:27
large number!
@franssu, did you use Humanizer ?
:)
did you know him ?
is it a yes or a no :D ?
him ? who ?
M ?
what's Humanizer ?
yes M
Mathieu Chedid
08:35
yes
?
yes :D , but I'm not fan
great guitar player
his voice is too soft :3
I don't know why, but he reminds me of Prince
sopranists
08:51
morning
morning
09:24
Hello fellow humans can somebody please find me a 65" TV under £1400 that isn't crap thx
I think you have to define "crap"
For instance the only other TV I've found was a Goodmans TV with a 400hz refresh rate
Basically I'm about to buy this, but it's a whole £700 more expensive than the exact same model but 55"... and I can't really justify that. But then they say that curved 55" TVs are bad and the curve is only effective at 65"+ so maybe it's worth it
 
1 hour later…
10:43
@Hamza_L For "M!", I was too lazy to write the whole word. :)
But I'll take a look at this M chap too. :P
I think its more chansons for me from France.
I think I'm more of a metal person. Hmm, do I know metal from France..?
:D
Too, I remembered. As it happens due to my origins. If one can say so...
M! = Morning!
11:33
Metal and France ? hum, nope, I don't think it's a perfect mix :3
@Veksi oooh, I have that labum
album
Any way, in WPF, is it common to use a converter as a validator?
Although I prefer the previous one (I think the front cover had a ship on it)
12:21
In WPF, with regards this example By @JohanLarsson at gist.github.com/JohanLarsson/a43133fad48d365c40f5, how on earth could I make it usable in a style?
You can use the attached proerties in a style np
Adding a sample, hold on
<Style x:Key="TabHeaderListBoxItemStyle" TargetType="ListBoxItem">
    <Style x:Key="TabHeaderListBoxItemStyle" TargetType="ListBoxItem">
    <Setter Property="Margin" Value="0" />
    <Setter Property="Template">
    <Setter.Value>
		<ControlTemplate TargetType="ListBoxItem">
			<Border x:Name="SomeTabBorder"
            <Border.Background>
            <Border.Style>
            <Style TargetType="Border">
				<Setter Property="Background">
                    <Setter.Value>
						<Border vm:Blink.When="{Binding SomeActiveProperty}" vm:Blink.From="Black" vm:Blink.To="Yellow"/>
Something like that, work in progress, syntax etc. being searched...
Hop, multiple Borders...
^ broken, does not stop blinking for some reason
@Veksi updated the code in the gist, had a strange dumb
Also failing silently in runtime now
The blink thing should probably not kill the application :)
We should add blink property, repeatbehavior and duration as attached properties
12:39
@JohanLarsson Let me check. Prelminarily I put:

<Setter Property="vm:Blink.When" Value="False" />
<Setter Property="vm:Blink.From" Value="Honeydew" />
<Setter Property="vm:Blink.To" Value="HotPink" />
<Style.Triggers>
<DataTrigger Binding="{Binding Path=SomeActiveProperty}" Value="True">
<Setter Property="vm:Blink.When" Value="True" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=SomeActiveProperty}" Value="False">
<Setter Property="vm:Blink.When" Value="False" />
</DataTrigger>
</Style.Triggers>
In
<Border.Style>
<Style TargetType="Border">
The previous and it worked. I'm messy with code, but this file is thousand lines long... If this work, I owe you one if I visit Sweden (or you visit here :D)...
updated so that you can pick property to blink
did not validate that the property is of type brush
This works like a champ boss. :)
Very good, I'm grateful. Let's see if I one day can give back. :)
np my friend
updated the gist with validation
gonna add duration and repeat now
updated the gist, did not even compile
nor update the sample
think it should work
i have a background thread that is a while(true) loop that i use to manage additions and removals to an items source. in my app i have buttons that add items to lists, and sometimes those items are new items. so i have to send the create request to the background thread. but i cant figure out a good way to get notified of the creation success and get the new object
what should i be doing
also the the add to list operation has to wait for the success of the create operation before it does anything
12:54
@franssu did you use the blink thing? Updated gist ^^
@Veksi suggestion for the thousand lines issue: use resource dictionaries in a resources folder
xaml gets huge, needs some organization
13:05
            var itemVm = MyItemsSource.GetItem(name); // get item from master ItemsSource

            if (itemVm) // item doesn't exist, we need to create it
            {
                ItemManager.AddItem(name); // send item to background processor

                ThreadPool.QueueUserWorkItem(delegate
                {
                    var itemAdded = false;

                    while (!itemAdded) //bleh
                    {
                        itemVm = MyItemsSource.GetItemByName(name);//see if the item has been added yet
triple bleh
13:31
ItemManager.AddItem(name, new Task(() => // work to be done after addition ));
hmm
13:54
@JohanLarsson not yet but next time I need something blinking :)
ok, I forgot who it was then
fixed a dumb bug in it
it was me
but I had finished doing it in xaml at the time you gave me the link
ok probably cleaner then
it is a hack to workaround a freezable issue
14:19
@JohanLarsson I'll go with the flow and all, just one of the many programmers in a project that had started about a two years ago. I think I'd try to do this differently, likely also most of the other people still in the project. :)
yeah, there are many ways to solve problems
the freezable issue is a bit tricky though
for blinking in a style I think our way is pretty good
binding with a converter is also a hack
A guy here chats that maybe the original would work in a different Place and that a control template was a wrong place etc.
I don't like complex and deeply nested things like this. :-P
I have seen blinking sometimes work and sometimes not, nasty
I try something simple and if it doesn't work, I start permuting the ways I can think of. The last time I've really programmed in WPF was around .NET 3.5 era, and boy, there were small annoyances back then! :D
I suppose I stop listening to Children of Bodom now and go pick up my own kids to listen to. Laters!
 
1 hour later…
15:46
0
A: Wpf animate background color

Johan LarssonHere is a set of attached properties that can be used if you run into issues with freezables. using System; using System.ComponentModel; using System.Windows; using System.Windows.Controls; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; public sta...

put the gist in an SO answer, easier to find
gah, ~answered~ the wrong question :)
changed it
happy again :)
16:15
hi all
happy Thursday :)
Happy Thursday, Alex
16:41
Have you started writing code/prototyping @Alex?
yep
got a basic design for the app
nice
Good that you don't stay in design paralysis for too long
i'm jumping around. do some db design. then do some XAML. then some research and tutorials.
i've installed Entity Framework 6. added models using db first. modified models to have them implement ObservableObject, which is an interface that handles the INotifyPropertyChanged stuff
nice work
thanks, @JohanLarsson :)
16:48
do you have resharper?
i wish
i've asked the boss.
i'll ask again
Resharper is a nobrainer when writing WPF, tell him that.
there was so much drudgery in writing the models' properties' getters and setters. they all did pretty much the same thing. and i wrote them all by hand :(
hold on, making a gif
i'm going to download the 30-day trial for now
16:49
piracy is alive and well, let's just say that
yep
show him this gif
It is realtime and I'm a slow typer ~35 wpm
dang. that's a nice gif!
thanks
bizznizkejs
i'll pester him for it again. heck, it took me some effort to get PluralSight subscription
i'd like to learn TDD... test-driven dev with WPF. but one step at a time :)
for now, i'll research writing unit tests
17:01
Writing tests is easy, writing testable code can sometimes be hard.
Testable code is usually nice code though.
I can write a sample for you if you want
if you've got the time, @JohanLarsson, that would be great!
ok, I'll add some random stuff to the TimeInputBoxThing
i'm hoping all that i'm learning will apply to my other programming efforts down the road
++ wpf mvvm teaches a lot of good programming practices imo
i'm seeing that in the work
ok
having a testproject named ProjectName.Tests like ^ is the most common
Keeping the testcode and real code separate
Then the test project has a reference to the real code and never the other way.
[Test] and [TestCase(...)] are attributes used by nunit
^ is what it looks like when I run them using R#'s testrunner
yep. i've seen nunit before. just never worked extensively with it
I could not get them to run in the VS runner, maybe a R# / VS issue
It is nice when tests can be short and sweet like that
Not always possible, sometimes large setup is needed. Can be a sign of smelly design.
it's saying Class1.cs isn't there
17:20
oh, I dumbed it had not saved when I pushed
Pull now, fixed it
ok
When you pull you fetch the latest from the remote
Remote being my repo on github
@Alex did pull work?
yes, but build is giving me grief
you probably need to restore packages
I added the nuget package
rmb on sln > nuget > restore packages
then build
i didn't see an option for restore packages.
17:29
tools > extensions and updates > install nuget
yep. did that
don't remember if it is included out-of-the-box
for example, it's giving an error on this line of Time.cs...
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
oh, that is C#6
strangely, i've got nuget, but don't see the Restore NuGet Packages option
17:32
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
    var handler = this.PropertyChanged;
    if (handler != null)
    {
        handler.Invoke(this, new PropertyChangedEventArgs(propertyName));
    }
}
must be written like ^ prior to C#6
was C#6 released with VS2015?
@Alex do you get any nuget option in the context menu?
@Alex yeah
Manage Nuget Packages for Solution
click that one then
should be a restore somehwre
ok
nothing that i can see. only Installed packages, Online, Updates
got it compiled!
just had to replace the two methods that were written differently for lower versions of C#
17:39
oh :)
very nice!
thanks for writing this!
18:23
0
Q: How to open Video/audio files direct when I click on link in IUWebView

J.S.OI have UIWebView and I have mp3links in it but when I click on the link, the mp3 file will not open and I get this and I must click on play logo to play the mp3 file.And when i click done after i heard the mp3 I get same play logo. how to open mp3 file direct when click on the link in uiwebview ...

18:39
2 messages moved to Trash can
@JohanLarsson r# should use that as promotional stuff and give you a free year at least :)
@Alex c# 6 came with Roslyn compiler which came with VS 2015 but can be downloaded on its own as well if you're on lower VS version
nuget install Microsoft.Net.Compilers   # Install C# and VB compilers
nuget install Microsoft.CodeAnalysis    # Install Language APIs and Services
better to nuget it than downgrade to filthy c#5 (or god forbid even lower versions)
18:55
@Maverik Excellent! £200 off :) Thanks
Ah £150 but still, woooooop
Closes the gap even more
Has anybody used Proget - Nuget Server?
never thought I'd see "Quad Core Processor" in Technical specs of a tv!
@Maverik we have our local nuget in a folder, no server.
works well, not even sure if there is anything different compared to real nuget
@JohanLarsson I'm considering it to enable automatic pushes from my CI server
ok, not sure I'd want that tbh
I like to be very explicit about publishing
also, I dont have direct access to ci server unless i'm on VPN, and i'm one of the very few privileged people who can directly vpn into infrastructure
19:01
If you use a network drive you just copy the .nupkg to it and it is published
For creating packages I highly recommend paket instead of nuget
no no you're missing my point.. my office and my ci server are in different geographical locations :)
everything development related except my laptop stuff happens in our datacenter
@Maverik Hehe same it does a LOT of processing it seems, check this
if it is not secret stuff using real nuget is an alternative
publishing is easy
its not secret but i can't sell that to management :(
they want everything inhouse.. they'd rather pay big bucks if thats what it takes!
i suppose the end product of it all could be considered a trade secret as it is our edge over our rival cloud providers but not the individual stuff
yeah, makes sense if the app is secret
19:04
anyways, i guess I'll give it a go and report back
many supporting libs probably not so secret
just wanted to see if anybody had any sort of comments on it already
it'd be nice to have it act as a symbol server too
yea exactly
symbols are annoying with nuget
but not nuget's fault
even if there is a symbol package sitting in the /packages it is not used
I started using dotpeek as symbol server
symbols for third party has been a mess since forever
i tried that too but i keep forgetting to turn on the dotpeeks symbol server
also, we're not doing nugets right now
by having build server do it automatically and push it out, at least something will start rolling
and then hopefully people will slowly adopt it
@RudiVisser way above my paygrade.. someday.. someday I'm sure :)
19:41
Hi all, I'm writing my first WPF app, and I have a ListView that I'd like to have the ability to reorder rows, ideally by dragging and dropping. I've looked over the docs, and they claim that there are properties like ItemDrag, OnDragDrop, and DragDrop, but Intellisense doesn't acknowledge those... so how do I set the ListView into 'reorder by dragging and dropping' mode?
@KyleHumfeld We use the behaviors that Gong provides
Gong?
Never heard of that one, sorry. Is that a nuget-able reference or something?
Thanks! I'll take a look. Do you use that, too, Julien?
never have. i think you are in for quite the learning experience
maybe that lib makes it easy but stock doing that kind of operation is not super trivial
19:53
Is there not a more 'native' way to do the reordering? Strange, in RT, that's built right into the ListView.
drag and drop reordering?
i think its strange that its built in. lol
Is there a better type of item-containing element for this kind of thing?
Why would it be strange? That's one of the 2 or 3 most basic things I'd want to do with a list of items.
Filtering and sorting are pretty standard behaviors for lists of items, right?
filtering and sorting yes
but involving user view actions no
19:54
And reordering would be #3
reordering is just sorting
With MVVM, the list is driven from a Collection, which can be reordered.
Reordering and sorting are different IMO, as sorting is more 'algorithmic', like sorting on a value alphabetically, rather than an arbitrary order defined by the user.
But that's neither here nor there.
its just sorting by different parameters
like when you drag an element
you have to get some sort of visual representation of it under the cursor
which depending on your elements isnt super simple
then you need indicators on the element you are dropping into to show where it would be dropped
then you need an actual drop event
theres a lot going on there
Got it. I figured that would be built-in in WPF like it is in RT, but if not then alright.
not to mention you will be in view level needing view models level stuff
19:57
I might change my implementation for v1 to just make up/down buttons appear on the line so the user can move an item up or down one time with a click.
i put context menus on them with move up, move to top
I have a good idea how I'd do that in the VM level, I think.
you might also consider using the arrow keys
that is probably significantly easier then mouse actions
Is a 'context menu' different than buttons with arrows on them?
context menu is windows standard right click menu
19:58
Right, that's why I figured I'd do it that way for v1 if there wasn't a simple way to do drag/drop
Aha, got it. I'll look that up, but probably not use it in this case, as I want it to be visible
Thanks for the advice and information!
mobile platforms probably treat that kind of operation as much more important
because you can't really build in other ways to do it
Except for making up/down buttons appear, of course =)
on a mobile screen that would not make for a very good user experience
It's the way you do it in Android, afaik, but I agree. =)
have any stock android app examples?
20:02
Yes.. gong makes it trivial.
Unless you want to roll your own with all the aspects you mentioned earlier. The base UI elements don't have much functionality available out-of-the-box. Luckily, MS did build that into WinPhone (and RT desktop)
Okay, I'll check out Gong before I go down the 'buttons' road. Thanks for pointing that one out, Lynn!
looking for sample code atm.
yeah id like to see some
<ListBox
AllowDrop="True"
dd:DragDrop.IsDragSource="True" dd:DragDrop.IsDropTarget="True"
dd:DragDrop.DragHandler="{Binding Path=DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
dd:DragDrop.DropHandler="{Binding Path=DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
ItemsSource="{Binding toolbarSettings.anchorStartControls}" />
xmlns:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"
Does ListBox work the same as ListView
?
20:08
Not sure. Probably. ItemsControl is the common base.
Okay, cool, thanks! I just want to know what I'm getting into and limit my exposure to demons creeping in as I change too many things at once.
225
Q: ListBox vs. ListView - how to choose for data binding

Geoff CoxI'm considering either a ListBox or a ListView for a WPF application. It seems either supports data binding and item templates. My application has a simple list of items that I intend to be able to search/sort/filter based on user input. The data binding demo (http://msdn.microsoft.com/en-us/l...

listview = fancy listbox with support for columns
items control = base object with no item selection support
Okay, I don't need columns, so sounds like a Listbox should suffice for my purposes. Thanks for the info!
@LynnCrumbling so the drag and drop handlers are what?
can you show how you handle one of those events
There's an interface that you have to implement in your vm (or wherever your handlers will live.)
20:17
for eg, how would you get the index of the position its being dropped on
so that you can rearrange your list
You may be able to just get away with the default handlers:
<ListBox ItemsSource="{Binding Collection}"
         dd:DragDrop.IsDragSource="True"
         dd:DragDrop.IsDropTarget="True"
         dd:DragDrop.DropHandler="{Binding}" />
The page that @Julien mentioned (github.com/punker76/gong-wpf-dragdrop) goes into a great amount of detail for implementing your own handlers, like I did.
Very cool, I'll take a look at that this afternoon!
Examples -> Adding a Drop Handler -> "You handle the drop in your ViewModel by implementing the IDropTarget interface..."
yeah but the example just validates the operation
It's entirely possible that the defaults handlers will work fine for you.
20:20
i guess you could hold the index in the VM itself
And that the code 6 lines up is sufficient.
bleh
20:43
@Maverik thank you! appreciating all the help you all provide :)
you're welcome :)
i'm having knowledge overload today! been reading MSDN about DataTemplate and ControlTemplate, plus bindings, CollectionView and on and on
need advice on the UI...
getting ready to post a screenshot
so in the above screen, the user will click on an employee on the grid to see additional details
the details will be shown below the grid, and they'll include additional data pulled from the database unrelated to the grid
it'll have test details for the employee
sounds like a typical Master/Detail pattern question :)
good. want to make sure i'm following master/details pattern :)
try binding SelectedItem for the DataGrid
20:54
^ that
ask away if you need specific help, but plenty of code samples on web if you search for that pattern name
here comes the silly question... would i switch views if the user wants to add a test to the person?
(of course restrict it to wpf when you're searching and you should be able to see full code sample with xaml)
new user = new row in datagrid
@Alex what is a test in context?
with the binding on detail, it'll just all happen by itself in theory
20:56
an employee can have many tests on the database
It's probably an OC<test> that is a member of an Employee
new row in Datagrid implies a new Employee() in the ItemsSource collection you've bound
(separate grid)
yep, separate grid.
we're all guessing right now, so lets wait until we have some actual code structure to work with
20:57
Do you add a test by going into the user details, or directly into an edit test screen?
no style for datagrid in mahapps?
if you've pushed to github with your test code, we can give better advice
there should be Johan
sorry, @JohanLarsson. went with a simple theme for this app
I'd think that the "edit Employee " screen would have two tabs: Employee Details, and Test History
20:57
+1 on the push to github idea
@Alex sorry :)
ok. i'll have to do more work and then i'll ask
Test history tab would have a grid to edit tests, similar to the employee list one.
but this has helped. sorry for the vagueness of the questions.
Alex: key is to have correct ViewModel structure
</guessing>
20:58
@Maverik yep, working on that piece right now
so if you have MainWindowViewModel that has EmployeesViewModel collection
and each EmployeeViewModel has ExtraDetailViewModel
i know. i'm doing lots of <guessing>
all of the bindings will just fall into place and just work
guessing is for us actually
since we dont know what you've written :)
20:59
once you mentioned SelectedItem and Master/Detail, it all made sense :)
and I normally nudge guys to not guess as it wastes time and such :D
cool :)
thank you, all, and sorry for the nebulous nature of my questions :D
no problem.. good luck :)
thanks
so on an unrelated note, has anybody tried to inject commit SHAs into version information in assembly?
21:02
we're svn here; we've written pre-build steps to push the build # into the version at build time
well i suppose its roughly same?
i can't figure out how to inject the commit sha using pre-build
git show -s --pretty=format:%h that gives me the short sha that i need
but how do i then give it the project so that msbuild actually adds it InfromationalVersion
Give me a little time to see how the guy is doing it.
I'll see if I can get you some helpful info
thanks, leave me a ping as its 9pm and I'm gonna start to pack

« first day (1238 days earlier)      last day (2911 days later) »