« first day (878 days earlier)      last day (3271 days later) » 

07:41
Hey peeps
@Maverik around? :D
 
6 hours later…
13:33
hey @furier
hey :)
mav was on vacation, don't know about now though
okay ty :)
I'm trying to start a storyboard when an item is selected from a ListBox. The listbox items are usercontrols.
If this wasn't a usercontrol, I could use a Trigger on the IsSelected property.
But inside of a UserControl, it complains that all triggers need to be EventTriggers
I don't fully understand why. Is maybe it's just because I'm going down the wrong path.
14:07
@furier what was your ?
huh? question?
@LynnCrumbling well if you are using a UserControl, that means you're not using the default ListBoxItem style, right?
That probably means ListBoxItem has a property that UserControl doesn't have... IsSelected
so how do you fix that? You make a IsSelected dependency property on the UserControl (separate XAML file probably)
@furier thought you had a question for mav. figured i'd try to get it out of ya
^^ I worked it out :)
but thankx
14:24
@NETscape [reading, digesting]
14:44
Hey guys anybody know the best way to handle lots of property updates in a single frame?
Is it best to possibly run it in a thread and spread them out? so the UI doesn't lock up?
whats "lots" to you?
you could throttle it a lot of ways, really up to you
could do a simple bool flag if you really wanted
@NETscape its basically a perforce plugin
I have a navigator with (currently) around 2000 elements in it
I run a perforce stat, which returns the state of each file. Then when the thread completes, i tell each UI element its new state
Which means the app starts, its fine while the background worker runs, then it locks up until the UI updates
How can I "slow down" the ui updates/Spread them out?
15:05
0
Q: Avoid UI Lockups when doing lots of PropertyUpdates

AshehI am trying to discover the best way of avoiding UI-Lockups when you are doing a lot of updates to the UI at once. The basic premise is that on start up my tool runs a perforce FSTAT on the within a background worker. Once this is completed, in its RunWorkerCompleted function, I then propagate t...

You update using some kind of progress approach
@Asheh anytime you try changing "everything at once" its going to lag the UI. if you update the UI at the convenience of the UI, you mitigate those issues
Yeah but thats what I am asking. I dont know how :)
you can use something like IProgress<T>
or some kind of ReportProgress
when you follow backgroundworker approach
Does report progress happen on the dispatcher thread?
15:20
when you report progress, the report will be added to the UI thread to be executed while the background thread continues to run... the UI task scheduler will execute the report whenever it wants/has the resources
@Asheh when you use IProgress<T> approach, all you have to call is .Report and the whole setting synccontext/scheduler/etc. stuff is done automatically
But it seems silly though, because ill be running a background thread and just calling back to the dispatcher straight away
Since all its doing is calling

MyProperty = SomeValue; //5000 times
I was hoping I could do this:

MyProperty = SomeValue; //50 times
Yield;
MyProperty = SomeValue; //50 times
Yield;
well aren't you executing something per file?
Yeah, but thats all done on a background worker
right... and in the background worker, you would tell the UI to update the item you're executing or whatever
So, in my loop, for each item, call back to the dispatcher and tell it to property update?
15:30
//on background worker
while(i < 5000)
{
    ExecuteCode()
    progress.Report( whatever you want to report);
}
Ok I think I get it.
if you want, you can only report progress every 10th item, its up to you
Yeah. That makes total sense. Ill try it now
you just have to manage it, but beware it could still take a good amount of time
I dont care i just want it to be repsonsive :)
15:32
either way you still have to report 5000 things to the UI one way or another
Oh @NETscape i've just realised, the function I run in the background happens all at once
Dang
can you split it up?
or is it 3rd party call or something
3rd Partay
ACtually
I can split it up. Ill try it :)
what are these items loaded into?
datagrid? chart? treeview?
Virtualized TreeView
15:35
well if its actually virtualized, it should only take a limited amount of time until other items come into view
Maybe I break the virtualization somehow :(
It seems to be a very easy thing to do ;)
depends on what you're doing I guess.
does it have deep nesting and such?
Not yet - but has the possibility to
if you can only see 40 items in the treeview, and there are 5000 total, it's either taking 5 secs to update those 40 items, or virtualization is broke id say
then again not too familiar with how the whole drawing happens with virtualization
is it trying to refresh the entire list bound to the treeview?
Well I tell each property its value
Maybe I need to not do that. Or leave it to the binding to get the value
That might be an idea you know....
15:41
lots of factors. what the ui needs to do, when it needs to do it, whats all being shown, etc.
Hey @NETscape I think you cracked it...
So calling PropertyUpdate breaks virtualisation
Kinda makes sense I suppose
16:15
@NETscape reports progress works :)
16:26
it does, does it
It does!
what property changes the UI ?
just one? or a bunch of them?
are you stuck in .NET Framework 4.0 or lower?
4.5
nah
can't you use async?
hey @BradleyDotNET you around yet?
16:41
NETscape - I was using that but it caused loads of binding issues because of the virtualization
the solution i found was to remove IsAsync lol
17:11
ahhh
17:30
@NETscape Yeah I'm around
demo this morning :(
@NETscape what's up?
hey
how'd the demo go
all good so far
17:52
so question
application has 2 access levels... both come at a different premium to customers
the main difference is being able to edit documents and not being able to edit documents
when a document is opened, a user is present with a datagrid with a bunch of items
in the product version where edits are allowed, the user would be able to change a items setting in the datagrid
in the non-editable version, they cannot change anything.
how should that be implemented? Simple bool to set isreadonly=true on the datagrid?
lets say someone is running non-editable version, then enter product key to upgrade their software... they should then be able to edit they datagrid items
hi
:)
yay demo over
everyone can stop running around like chickens with their heads cut off
@NETscape Stuff like that gets tricky
not on the UI side, but on the "is this activated" side
But yeah, just disabling the datagrid should be OK
ok so the whole calibration thing I was trying to do is scrapped..
Of course, a lot depends on how evil you expect your users to be
the calculation doesn't work if you reset to a new pitch value, so I'm just going to output the users pitch and the pitch they need to start at.
:)
makes more sense
so when both match, they should start the measurement
18:06
Sounds like a much simpler approach
yeah and I could add a linear gauge, to show them when their min pitch is lining up with the required min pitch
18:41
@BradleyDotNET we are going with a simply means of "activating a product." I think checking activation at application start will be the route we go
so I'm not sure if I should create simpler VMs or just have robust VMs
posted on March 16, 2015 by The .NET Team

dotnetConf is a free, 2 day virtual event co-organized by the .NET community and Microsoft, and it’s this Wednesday! As you can guess by its name, it’s dedicated to your favorite development platform, .NET. Grab a comfortable chair, a pot of your favorite hot (or cold) beverage and a mind to fill with all the latest .NET product and community news. The dotnetConf team has been planning the even

@NETscape Not sure what you mean by that
@BradleyDotNET lets say you have two VMs.
public BasicVM
{ public string Setting { get;set; }
public AdvancedVM
{ public List<Setting> Settings {get;set;}
   public string Setting SelectedSetting {get;set; } }
or whateva
Ok (first piece of confusion, I thought you were referencing virtual machines for some reason)
if you only have basic activated, i'd create BasicVMs... etc..
18:52
I see
When I've done similar logic I had just one VM
and then I bound the IsEnabled property of various controls to a "CurrentUserLevel" property
with a converter that checked against the passed converter parameter which was the required level.
You might consider doing something similar
19:26
Hey all. If I have a setter that collapses my Window by default, what is the way that I can make it visible during design time?
if you have a DataGrid, and you define the columns, whats the DataContext of the Column itself?
@BrandenBoucher make what visible? why isn't it visible during design time?
is default of some button only visible when a bool = true?
@NETscape there is no DC for the column itself
so you can only make a column visibile/not visible through code behind?
the DC for the Datagrid is inherited from it's parent, then each item in the ItemsSource becomes the DataContext for each row, and the properties of the object in each item are set as the DataContext for each cell in that row
Hold on. I have some code for that
But, that's almost true. It's tricky
Right, so if my DataGrid has DataContext = DataBaseVM, and my DataGrid.ItemsSource = Items... can i make DataGridColumn.IsVisible = DataBaseVM.IsColumnVisible?
19:40
Not really because that's not the columns DataContext
I think you can if you literally mean what you've written
well i can set the datacolumn's datacontext ( at least with telerik)
i'm talking xaml, sorry
yea me too
DataGrid.DataContext can be bound to when you're binding columns
and DataGridColumn.Visiblility can work
so it'd more so be: IsVisible="{Binding IsColumnVisibile, Converter....}"
still opening my project...
19:43
this has an example even
I think he's trying to do it without code in the codebehind
yea ms is lame
that code can be done in xaml
i've assumed netscape can translate the logic - i've done this ages ago on this channel for somebody
basically what is the DataContext of DataGridColumn... is it the same as DataGrid?
of the column yes i think
not of the cell though
even if not, you can always jump around with explicit datasource
Right. The cell's datacontext is specified by the ItemsSource and column binding
19:46
yea
but the datagridcolumn's datacontext is same as datagrid
(i'm assuming you're not autogenerating, otherwise this will get pretty complicated)
yeah, the cell would be DC of the row item
yeah, not autogen
okay, fair enough, just checking
and I is sorry for abandoning the channel practically.. though in pretty good hands :)
@NETscape I think Maverik's right. In my code, I'm not changing it's visibility, but it's width, which is another can of worms.
i've been consumed in infrastructure stuff and still in linux land
niceee
19:49
took me three weeks to realise.. my problem wasn't my own >.>
i was using ECC 384 based certificates and turns out that was breaking the erlang based mini server
fix: give it old RSA based certificate and everything started working /sigh
death toll: 240 hours roughly
so something to remember if you've decided to join the newer algorithms of ssl
some things still don't like elliptic curves based encryption
exact problem: static binding against old ssl library rather than using what's installed on system itself
also, if any of you using git and would like to have a nice githuby experience on server side -- gitlab is doing pretty nicely for me for past few months
and i'm closing shop.. bah bai peeps
bye mav
and yeah, played with gitlab. i voted for it
 
1 hour later…
21:21
public class CellPhone
public class CellPhoneParameter
@BradleyDotNET say I have ^
and I change CellPhoneParameter
essentially, the CellPhone is what is actually changing the CellPhoneParameter, how should that be done via design?
currently I have
public class CellPhone : IEditor
and CellPhoneParameter(IEditor cellPhone)
so in CellPhoneParameter, I would edit the value in the view, and call _cellPhone.EditParameter(this.Address, this.Value)
I'm not sure I understand that...
So a CellPhone owns a CellPhoneParameter?
a cell phone has parameters... depending on the values the parameters are set to, the state of the cell phone changes
ok, I got that, so CellPhone composes/aggregates CellPhoneParameter
And CellPhone is... a view?
21:25
so when you change a cellphoneparameter value in the view.. lets say a textbox value
IEditor makes it sound like that
the parameter has to somehow actually tell the cellphone that it changed value
how should the parameter tell the cellphone
It could raise an event
But from what it sounds like, CellPhone should just be polling CellPhoneParameter whenever it needs something.
obviously I could be missing a key piece as well
well if there are 5000 parameters, should cell phone be polling every parameter?
But since CellPhone already aggregates CellPhoneParameter, an event isn't a crazy way to do it
21:31
mhmmm
also
changing 1 parameter could cause 15 other dependent parameters to change as well
That aren't in CellPhoneParameter?
right
CellPhone would have List<CellPhoneParameter> Parameters
and after you change one
CellPhone will find all of the affected parameters, then get their updated setting
Ugh... thats pretty smelly
in reality, CellPhone is a COM object
and it has it's "Database" of parameters...
parameters have dependencies
on each other, but that's how it works in the motor industry... if you change your max speed to 20MPH, then other parameters need to change in order to prevent motor from going over 20MPH
the COM object exposes SetParameterValue(address, value); and GetParameterValue(address); in short... I can call get like parameter status, so I could say something like GetParameterStatus(address) and it'll tell me if it was affected by a parameter change or not
21:41
COM objects can't really be changed at this point unfortunately :(
because changing one = changing one hundred of them
The simple solution is to have the parameter raise an event and have the owner object loop through everybody letting them also know
well that happens in the COM object...
If I was designing from scratch, I might make the "dependent" properties actually methods that took the dependencies as parameters, so I can get the current value on-demand.
21:43
so what I was saying is CellPhoneParameter has IOwner _cellPhone
and when the value changes, in the setter it calls _cellPhone.UpdateValue(this.address, this.value)
which is an explicitly defined interface function on CellPhone (not the COM object)
and CellPhone calls _comObj.SetParameterValue(address, value)
and internal to the COM object, all the parameters go through their dependency checks and what not
that seems reasonable given everything else you've said
okay, meaning the explicit interface approach?
@BradleyDotNET so lets go with this example... You have CellPhone which is a class, and it has a parameter for access level, advanced and basic.
if you're in basic you see Parameter1,Parameter2,Parameter3
if you're in advanced, you see Parameter1,Parameter2,Parameter3,Parameter4,Parameter5
on the UI you mean?
21:50
well, that's even accessible in the model itself
i guess yeah, the UI
ok
I guess I'm saying that usually basic/advanced is just a view distinction
the rest of the system doesn't care
well the other parameters will still exist technically
but basically i'm saying changing Access Level parameter, will cause the ParameterX.IsAvailiable setting
alternatively...
Lets say you have a Motor Max Speed parameter set to 100MPH. And your have 3 speeds which are dependent on max speed of the motor. speed 1 parameter = 1/10th of max, speed 2 parameter = 5/10th of max speed, speed 3 parameter = 10/10th of max speed
now you change max speed to 50MPH on the UI
the UI should show the updated values of speed 1,2,3 on the UI
22:11
@BradleyDotNET that make sense?
22:54
Right
I see what you mean

« first day (878 days earlier)      last day (3271 days later) »