« first day (860 days earlier)      last day (3289 days later) » 
00:00 - 23:0023:00 - 00:00

12:26 AM
@BradleyDotNET are you around Brad :)
 
12:37 AM
Hi @Mehrad
Yeah, I'm here :)
 
@BradleyDotNET sorry, thought you must have gone by now
I was creating my own exception to give some user friendly message rather than OleDbException message which is vague. and came across this syntax which I haven't used before
public TemplateFileUpdateFailedException(string message)
    : base(message)
{
}
did a bit of reading but still have doubts about that : base(message) part
is this syntactic sugar of some prolonged way of doing it? or it's a syntax of it's own
However, I should've asked this in the C# room rather
AFAIK, if B is inherited from A ( class B: A )
upon creating B using it's constructor A gets created.
but why would I need to pass my B's message to A that I am never going to be using?
@BradleyDotNET that's all. :)
 
12:57 AM
lol not even 5:00 yet :)
@Mehrad That syntax invokes a non-default constructor on the base
If you don't do the : base(message), the default constructor will be used
 
@BradleyDotNET you must be from one of the most western points of US then :D
 
yep, all of Nevada is on PST I believe
 
@BradleyDotNET but why should we care which one of the constructors of base is invoked :)
 
(UTC - 8)
In your case, you might not care
 
and we are +10 :D
 
1:00 AM
but in general, if you have a parameterized derived constructor, it will usually invoke the similar parameterized base constructor.
Like if I had an Animal Constructor that took an age and weight
 
@BradleyDotNET Yep I can see that I am missing a point here cuz it seems it doesn't apply to a situation that I can visualize
 
and then a Dog one that took age, weight,and breed
Dog doesn't need to handle age and weight, the base class does that
so it invokes the base class's parameterized constructor with age and weight
and only handles breed itself
 
Have a question about DataGrids
I have drag/drop behvaiors attached
and i need to override the datagrids row style
i cant find anything that helps me actually access the template
 
@Mehrad Does that make sense
 
the code that i do ahve compiles, but doesnt run
 
1:03 AM
@BradleyDotNET Oh... penny dropped. So in the constructor I don't need to tell my exception what to do with the message, cuz the Base already knows what to do with it
@BradleyDotNET that's why my the constructor in this case have 2/3 parameters but does nothing with them and its like {}
 
i fugred soemthing like this would work:
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate> blabla
but the grid is just blank
 
@BradleyDotNET totally
@JTester. hi there.
 
hi
 
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate> blabla
 
@Mehrad yep
 
1:06 AM
I just formatted it then I can read it easier. @JTester. You can do the same with Ctrl+K after you paste the code here.
@BradleyDotNET thanks alot. not it makes all the sense
 
oh okay mehrad, didnt know that. ty
 
its for code reuse more than anything
and you don't forget to assign some crucial base class variable
assuming you even can set the variable (if it was private)
then you have to do it this way
 
@BradleyDotNET interesting point. do you mean something that I couldn't necessarily could access with something like base.myPrivateFoo = this.Foo ?
 
right
if that was set in the constructor, you would have to go through the base class constructor
since you can't set it yourself
 
very interesting. good learning.
I must have memorised this in 2004 for the C++ exam but surely never used it from since
@JTester Your question is, how to do a template for the DataGrid's row?
@JTester your code seems right to me.
I have used a similar approach couple of times. such as below
  <ListView.GroupStyle>
    <GroupStyle>
      <GroupStyle.ContainerStyle>
        <Style TargetType="{x:Type GroupItem}">
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate>
                <!--The grouping binding should always be "Name". Bazaar!!!-->
                <Expander Header="{Binding Path=Name}" IsExpanded="True">
                  <ItemsPresenter />
                </Expander>
              </ControlTemplate>
            </Setter.Value>
 
1:32 AM
See you later @Mehrad Time to head home :)
 
1:42 AM
@BradleyDotNET see you man. thanks again
 
 
5 hours later…
6:12 AM
0
Q: how to set heights of 3 DataGrids inside Extenders in one StackPanel in MVVM dynamically?

matti The heights of each DataGrid should depend on: Are other Extenders extended How many rows the DataGrid has If other Extenders are extended, how many rows other DataGrids have. Height of the StackPanel the Extenders are in All Extenders should be always visible. If e.g. opening only upmost E...

 
 
1 hour later…
7:28 AM
Mörning
Unfortunately my keyboard has stopped working in Visual Studio... Can I go home for today then?
hmm, restart of VS didn't help...
 
Hi.
Restart PC -> Reinstall Windows.
 
let's hope not!
keyboard works in search in VS...
It's just that I can't write code...
 
Write in Notepad++ and paste in VS.
I know, I am helpful, do not thank me.
 
7:45 AM
I can also write in pause mode...
copy paste doesn't work...
is there any way to lock the keyboard that I can have accidentally switched on
 
7:59 AM
Turned out to be ReSharper that screwed things up...
 
8:35 AM
Oh, I see.
 
9:00 AM
good morning guys
how are you?
I need some library for docx file creation and management
Anybody knows something about it?
I've only found the DocX .NET library
but I hope that there is something more "official" around...
 
 
2 hours later…
11:12 AM
0
Q: Is there a clean way to animate the value of a ReadonlyDependencyProperty?

Johan LarssonI have a control where I want to animate the value of a readonly DependencyProperty Using vanilla animation like this does not work (as expected): var animation = new DoubleAnimation(value, TimeSpan.FromMilliseconds(100)); this.BeginAnimation(SomeValueProperty, animation); I have not found an...

 
11:27 AM
Why was it expected not to work?
 
11:50 AM
because the dependencyproperty cannot be changed when it is readonly
the dpkey is used to change the value
 
12:05 PM
I get that not anyone can change it... but that doesn't mean that it can't be changed right? (or isn't a property with a private set counted as a read only property?)
 
dependencyproperties are special
 
thats what my parents told me as well...
:)
 
63
A: How do You Create a Read-Only Dependency Property?

Kenan E. K.It's easy, actually: public class OwnerClass : DependencyObject // or DependencyObject inheritor { private static readonly DependencyPropertyKey ReadOnlyPropPropertyKey = DependencyProperty.RegisterReadOnly("ReadOnlyProp", typeof(int), typeof(OwnerClass), new FrameworkPro...

 
hm, didn't know they even existed :)
 
 
1 hour later…
1:17 PM
~solved~ it with a hack
 
 
2 hours later…
2:48 PM
@Denver what are you up to these days, any wpf?!
 
3:06 PM
@NETscape Hey! Yeah, WPFing alot. :) Creating yet another custom control to show some scientific data. Trying to do it in MVVM way using MVVMLight (EventToCommand rocks). Altough it is hard to create a custom control in MVVM-ish way. Also been working with storyboards. Got stuck cuz of setting TargetName for storyboard in style. Also conditonal EventTrigger is a lack.
And for some reason defining two DataTriggers within one Triggers collection in XAML acts like latter DataTrigger overwrites the first one.
And working with COM-ports also, nothing special there. However, SerialPort.GetPortNames() sometimes returns names of ports which were already closed.
 
@Denver can't you do MultiTrigger?
 
I tried MultiTrigger.
It did not fit my needs.
 
or MultiDataTrigger
 
And that too.
I can't tell exactly, why, a lot of info came through my head and I do not have source code at home.
 
ahh. interesting.
what are you like UTC+4?
 
3:09 PM
18:09 atm.
Time to go to gym and leave you alone. D:
 
utc+3 then ay. but alright, have fun!
 
:)
 
 
2 hours later…
4:55 PM
Good morning all (from UTC - 8 land)
 
5:10 PM
morning
solved the animate readonly dp problem
 
@JohanLarsson I was wondering if there is any property in the gauge, tht could be used to paint the painfull arc reading on the gauge?
 
nope not directly on the gauge
but you can do whatever you want with a controltamplate
you could add attached properties for it also
 
ok not too familiar with the controltemplate, will do a bit of reasearch
 
5:37 PM
in the sample styles the controltemplate is set
the controltemplate is a datatemplate for the control specifying how it should render
very nice thing imo as it provides for huge flexibility
a wpf control is composed of two parts: 1) the code file 2) the controltemplate
I try to avoid templateparts in the code
prefer binding things
this is an intermediate topic
maybe not super difficult but new things
 
5:58 PM
okay
let me digest that
I'm going to try out your first suggestion for the moment
layering one gauge over the other
@JohanLarsson
 
hey guys my company is planning to buy third party controls either from DevExpress or Telerik
which one is a better option?
 
@BrianJ yep, worth trying. can be wrapped in a usercontrol also
@savi anything I think. I never hear anything god about them.
Never used them though.
 
the one problem I can see coming from this, is painting the area between the start value of the arc and the end value
 
oh ok
 
Reed recommends some other thing that I don't remember
 
6:01 PM
@savi what controls do you plan on using?
 
broken controls are insanely annoying
 
mostly chart controls and richtextbox
 
@savi (referring to what @JohanLarsson) Look into Mindscape also
 
freezing up VS in the designer etc
@savi We use Oxyplot for charts
 
ok
 
6:02 PM
if you're looking for real-time performance with charts don't use telerik IMO
 
Not supernice wpf with oxy but a nice lib imo
 
oh is it slow?
I mean is Telerik slow?
 
we should make a Direct2D chart lib :)
we meaning Reed should show us how to :)
 
@savi I hear/see good with scichart.com
 
there is also D3
don't think it is actively developed any more
 
6:04 PM
I believe I had performance issues with telerik's RTB trying add ~1000 rows to a table to the rtb
 
Oxyplot is not very fast either I think
 
@savi it depends how real-time you're trying to be. Telerik's charts would probably be just fine if my requirements weren't stupid ridiculous
 
ok
wat abt Devexpress?
 
just realize that drawing them can be expensive. for instance, I can't turn on the point markers because i have so many points and drawing that many would use all my RAM... it's also my problem because i'm trying to show more points in a pixel area than an eye can see lol
 
hahaahhaa
 
6:26 PM
@JohanLarsson to start this off, basically I should just overlay the second gauge over the first, and set the visibility to hidden.
 
you don't even need an entire gauge
you can use a angularblockbar for that
hidden or value == 0
you want to have them aligned so put them both in a grid
 
ok so angularblockbar is a control within that library
 
yep
see how it is used in the sample style
 
okay
so its pretty much like having a tiny gauge within the main gauge?
 
guess you can say that
don't pull btw, things are very broken
pushed before I ran it :)
 
6:37 PM
okay no problem, i'm working off the previous version.
so I'm looking at the main window in the sample
I see Angular Bars but no Angular block bar..
@JohanLarsson
 
hmm not sure what version yuo have
if you have the sample style it should be there
 
The first working version where you pushed the angular gauge and fat styles
where should I be looking for the angularblockbar ?
I mean I can create one like this:
<gauges:AngularBlockBar


/>
but I can't see any example of how its used in the example
 
6:57 PM
<gauges:AngularBlockBar Fill="LightGray"
                        MaxAngle="{TemplateBinding MaxAngle}"
                        Maximum="1"
                        MinAngle="{TemplateBinding MinAngle}"
                        Minimum="0"
                        Opacity="0.2"
                        ReservedSpace="50"
                        TickLength="55"
                        Value="1" />
 
okay
the following layout places the gauge horizontally under my main gauge. I can't seem to re position it through the GUI though so that its in line with the existing gauge
@JohanLarsson
 
place the gauge and the blockbar in a grid
just them
and remove the rendertransform
 
okay why remove rendertransform though?
 
there is already ways to control the angles
think it will just be confusing
 
7:14 PM
oh okay
thought it would break something if I removed
 
hopefully I can help you better soon
want to unbreak some things first
 
getting there slowly lol
still can't re orientate the gauge though, also removing render transform caused some errors so left it there for the time being
 
remove Margin="149,2,-89,2"
and the rendertransform
you rarely want margins like that in wpf
use margins for space around controls not positioning
 
when I remove the margin, the gauges orientation gets messed up
 
Smart guys, can you move to Russia, please, somewhere in Moscow timezone? So that I could talk to you while being at job? Please?
 
7:23 PM
you have margins all over the place man
@Denver I'm trying to get Reed to move to Sweden
 
yeah to set up the positioning of the controls, I'm guessing this is bad practice
 
I would not recommend it
 
Well, at least Sweden!
 
try using grid rows & columns
 
I think I'll pass on russia
 
7:26 PM
we should all move to Norway
 
okay How can I get the two gauges to line up for the moment?
 
they should be lined up already
screenie of how they look?
 
you will have to look at it from a different angle to see the two gauges, main one is vertical on the right of the screen, other is horizontal across the latter half of the screen
 
what happens if you remove the rendertransform?
 
the type angular gauge does not support direct content
 
7:39 PM
when you remove the transform?
 
yeah
on the angular gauge
 
then you are derping removing it :)
 
yeah
better to leave it there
for now I just want to get gauge 1 and 2 to align with each other
But I can't grab the gauge to adjust its orientation
maybe if I just set the same margin values from 1 on 2
that worked :)
now on to the "hard" part
 
I'm attempting to implement the solution to this question: stackoverflow.com/questions/7536049/…, but when I do the e.Source returned is a TabControl. I was expecting a TabItem so I could tell the TabControl which Tab to close. Anyone here know if I've implemented the solution wrong?
 
7:48 PM
> Help me plz! Thank you!
:)
 
Yes, I should have led with that. Sorry. If anyone can help I'd appreciate it. Thank you
 
be back in an hour
 
8:14 PM
@Brandon I dunno.
@iulian3000 gauges are pretty broken now but having a feature fest :)
 
@JohanLarsson Thanks for looking into it. I'll ask a new question on it
 
this room is pretty quiet, lurk around for a while
 
8:38 PM
@JohanLarsson so the two gauges are aligned now, what is the next step? Binding the block bar value to the start and end arc?
 
hmm
bindning value will get upper right
 
nope because the binding value needs to be between the two values
 
one way is bind minangle & maxangle with a converter
will work but perhaps not super nice
 
must be some way to bind to the two values, so when they are set it, there will be the start of the arc and the end
 
bot start & edn will change right?
 
8:47 PM
something quick and dirty
yeah
so I make a start pose, this populates the startArc for the reading at that point, then I make and end pose and this populates the endArc for that reading
so essentially there will be two values, eg startArc = 90.33 endArc = 110.44
 
bind it with a converter
 
okay I'm not sure how the converter would work in this instance, can you elaborate? :)
 
<-90% afk
 
the starting and ending values can be any value between 0 and 180, but the startArc will always be lower then the endArc
do you have any code snippet to explain the converter
its going to convert the diff between the two values, correct?
 
later, busy with life here
sry my friend
 
8:55 PM
then bind that value to the second gauge
no probs
is there a name for this converter so I can reasearch?
 
you will have to write it
google valueconverter
 
a converter is a wpf construct that translates bound values into whatever you want
 
(y)
it should be simple I think, just write a class that subtracts the two values and stores the result as the converted value. Then bind that to the gauge
will have to add the converted value to the start arc.
 
mhmmmmm
 
what are your thoughts on that? @NETscape
I need to highlight an arc on a gauge, so I'm thinking of subtracting the min from the max, then adding that result to the min. That values can then be binded to the second gauge
only problem with that is, the values prior to the min value will be shown too..
so I'm not sure.
I'm looking to just show the arc, for exampe 90 - 130 degrees
 
9:11 PM
@BrianJ sounds about right
you are making nice progress with wpf man
<- still busy
 
yeah thanks, I feel I'm getting slightly better anyways :)
 
posted on February 26, 2015 by Rich Lander [MSFT]

It has been a couple weeks since we last reported on the .NET Core open source project. It's been a very fun time, watching more people get involved in the project and to see progress on a daily basis. It's amazing watching my GitHub news feed. I have to scroll through several page views just to get through the last hour (on a weekday) of corefx, coreclr and roslyn repo activity. Today, we're g

 
I have a function that returns List<int> and could take anywhere from 100ms-1s to execute. and I call that function in a for each loop. where am i supposed to call await? @JohanLarsson
 
dunno :)
<- afkish
 
9:26 PM
for(int i = 0; i < items.Count; i++)
{
    List<int> vals = await Task.Run( () => MyPossiblyLongRunningFunction(stuff, one, two));
    foreach ... // short loop
}
 
you could put all the tasks in a list an await Task.WhenAll(listOfTasks)
 
MyPossiblyLongRunningFunction returns List<int>... is that correct?
 
but that would probably not work well with the inner for
@NETscape if you want list semantics
usually returning IEnumerable<int> or IReadonlyList<int> is nicer
 
9:41 PM
If you want list semantics you can always do IList<T>
The advantage to returning an interface is that you can change the underlying implementation at will
Granted, that doesn't happen very often, so you can usually get away with the concrete class
 
i was questioning if i was supposed ot be using await or not
 
9:57 PM
Is it on the UI thread?
and/or, would the thread blocking matter?
 
yeah, it was UI thread
but I think it works fine with Task.Run... everything seems to work at least
how would you show a progress bar/busy indicator for an application @BradleyDotNET?
UserControl that lays over window and disables clicking?
 
If you are going to disable clicking, that would work
Depending on what you want, you could just put a semi-opaque rectangle over everything
and have it trap the click events
Then you could have your indicator sit somewhere on top of that
But you could encapsulate those two things in a UC if you wanted to.
 
just wondering how I should set up this value converter, it needs to do a calculation on two values, so obviously it needs to take these as parameters.
 
So its a multi-value converter?
those are always fun
 
10:13 PM
yeah
it needs to take in the startArc and minArc, subtract them from each other and store the result. This result then needs to be binded to the gauge.
 
having derps over here!
 
haha couldn't figure out where to cast to prevent integer math.
got it now
 
Here's a fun casting issue: stackoverflow.com/questions/21488658/…
I think I pounded my head against that for half a day before asking :(
 
i knew that one
 
10:20 PM
The worst/dumb part was I simply wanted my RNG to generate the full range of an int
but the upper bound is exclusive...
so I had to use that
 
@BradleyDotNET so am I on the right track with the multi-value converter? just a class with a method that takes two values.
 
@BrianJ There's a specific interface you use
IMultiValueConverter
 
unchecked(int.MaxValue + 1); will compile too... except gives you int.MinValue!
 
instead of IValueConverter
 
okay
and that would be
?
 
10:23 PM
not sure what you are asking
you've made a standard converter
now you make one that implements IMultiValueConverter
 
IProgress<T> is hella nice
@BradleyDotNET right now have it working with a window, but user could close that >.<
 
okay, I'm asking if the multi value converter, is just a class with a method that takes two values as params, and implements IMultiValueConverter? @BradleyDotNET
 
Its not that nice
The convert method ends up taking an object[]
but implement the interface
you'll very quickly see what I mean :)
 
okay what would be the ideal solution to this requirement?
 
A multi-value converter
its just ugly
even standard converters are somewhat ugly
though the XAML looks nicer than the MultiValue variant
 
10:31 PM
@BradleyDotNET how would you suggest to do this?
 
Your progress bar?
Do what you suggested
throw a big thing over your controls
it doesn't have to be in a separate window
just the lowest in the XAML so it lays on top of everything else
or highest in Z-order
but the implicit Z-Order is XAML top -> bottom (top is low)
 
can it prevent user from closing application window too?
 
That control wouldn't
Although you could make it harder and set your window style to none or something (not sure if you can actually do that at runtime, but its worth a shot)
In the end, you can't stop Task Manager though
so an unexpected shutdown is always a possibility
 
yeah. true true. basically just handle correctly and expect the user to eff everything up ;)
 
okay so.. don't use a multi value converter ?
 
10:40 PM
no, do use one
I'm just warning you, its messy
so if you wanted to pre-calculate that value somewhere else, it would be cleaner
but if you really want to bind it that way, thats your best choice
 
okay so what if I pre calculte the value in the MyoDeviceModel? Then create a property for it, bind from that
 
Would certainly be cleaner
you just have to manually raise the property changed event for it when you set the other properties it depends on
 
@BrianJ yeah, I derped when suggesting the converter sry
 
Multi-Value Converter is messy enough that I would go the pre-calculated route given the choice though.
 
@BradleyDotNET do you think i should add/remove usercontrol in code behind, or should I just add xaml and set visibility?
 
10:43 PM
useful to know about converters though so no huge harm done
 
no problem, I'll get there in the end
 
things will start to go much faster for you soon
you have touched many parts of wpf by now
 
Add XAML and set visibility
 
yeah I really want to get a .NET grad interview, my previous two interviews have been for systems requirements and Java Developer
 
"Collapsed" will take it out of the visual tree
Way easier than modifying it yourself :)
@BrianJ If you are still struggling with events, I just wrote a small tutorial as an answer: stackoverflow.com/questions/28708731/…
 
10:52 PM
+1
imaginary internet points for you
:)
I'll check it out
I'm learning as I go along too, thanks to you guys
 
Apparently very imaginary internet points ;)
 
00:00 - 23:0023:00 - 00:00

« first day (860 days earlier)      last day (3289 days later) »