« first day (1236 days earlier)      last day (2913 days later) » 
00:00 - 15:0015:00 - 23:00

15:01
PolyLineSegment
        PolyLineSegment GetBezierApproximation(Point[] controlPoints, int outputSegmentCount)
        {
            Point[] points = new Point[outputSegmentCount + 1];
            for (int i = 0; i <= outputSegmentCount; i++)
            {
                double t = (double)i / outputSegmentCount;
                points[i] = GetBezierPoint(t, controlPoints, 0, controlPoints.Length);
            }
            return new PolyLineSegment(points, true);
        }

        Point GetBezierPoint(double t, Point[] controlPoints, int index, int count)
PR requests are much better over branch only solution when you have developers you can't trust 100%
Most part of that code I've got from StackOverflow ;p Couldn't have done it myself
But I've managed to see what was wrong, the graph was being generated as a normal equation and some values were negative
you're welcome on behalf of protection duckys in here! I'm starting to lose count of edits on this now 5? this is taking (damn it) a long time to stop me from editing! Ok i'm gonna go do work again!
Therefore being generated outside of the screen
ding ding ding! good job
15:03
Now I'm just trying to fix my equation
The Y Axis is upside down T.T
sounds like you may need Math.Abs 0_o
and possibly some parentheses?
This is what it should be doing
And this is what is happening
is this a recursive function, ya?
15:08
Yes, but again, I did not do this :S
BezierSegments just draw 3 points
So you need a way to start a new BezierSegment and connect to the end of the last one
controlPoints.Length and outputSegmentCount whats the value of these?
i'm about to add mvvm light to my project. what's the diff between "MVVM Light" and "MVVM Light libraries only" on the NuGet Package manager?
do you have a full grasp of how mvvm works ;)
The amount of points I've created in the loop
Precisely, this loop:
for (var matX = -5; matX < 6; matX++)
{
    var matY = -5 * Math.Pow(matX, 2) - 3 * matX + 2;
    points.Add(new Point(matX + (this.Width / 2), matY + (this.Height / 2) - 30));
}
i've watched the tutorial on PluralSight and plan to watch it again now
15:12
@AndréSilva you'll have to step through it and watch return new Point((1 - t) * P0.X + t * P1.X, (1 - t) * P0.Y + t * P1.Y); i'm assuming
Alex, unless you have solid grasp on mvvm pattern itself, i'd suggest against using frameworks
debugging becomes a nightmare with them unless you can dry run all of it in your head and figure out whats going on because of all the additional abstraction layers added by frameworks
if you use frameworks you end up like some of the vampires that come in here about 2PM every day
xD
not specific at all!! :D
@AndréSilva to be clear, use var matY = (-5 * Math.Pow(matX, 2)) - (3 * matX) + 2; but that looks good. Not sure when you're doing the this.Width/2
should i build it with strong coupling (using code behind) and then refactor to mvvm?
15:17
low coupling, high cohesion
identify your views, your models, and then view models... something I'm still not good at, ask @franssu
the mroe view models you have the better hehe
pretty much that's what i've concluded lol
yep. each vm should be responsible for handling one view.
as well as representing any "items" you want to display
right, but it gets complex pretty quick
15:19
as well as handling custom user controls
take a treeview structure for example
how do you identify your views? based on single responsbility
viewmodels in viewmodels in viewmodels
however you want your UI to look and behave I guess
i generally start with a singleton MainWindowVm
and build more as i add functionality
@Kevin I'm doing it to make the default position in the (0,0) of the graph
15:22
if you have a "welcome window" with 3 buttons, and clicking on the buttons does something, you could have a mainviewmodel and in there you might have 3 more view models
so here's what i've got so far, at the very beginning of the app...
And that is in the middle of the screen
The (0,0) point is in the half of the screens height and width ;p
i got rid of the buttons. now going with tabs on the MWindow
@AndréSilva to make that the middle, you have to shift the equation
If I don't do that the graph is generated with negative coordinates and that is outside of the screen :(
15:23
use MahApps for sweet sweet tabs
@AndréSilva but you're trying to represent f(x) = -5x^2 - 3x + 2
Yes, exactly
so it should be negative
Yey, first time in my life i have successfully used Mode = Binding.OneTime for a binding.
@Julien, can you add MahApps to an existing wpf app?
15:24
are you just trying to do a general parabola? x^2?
I've mentioned this before but I feel this library doesn't get enough mentioning so I'm spamming it one more time :)
It seems that it is working now, a bit slow but it is
@Alex Install-Package MahApps.Metro
then just convert whatever windows you want metro styled with 2 seconds of xaml fix
15:25
Humanizer, Humanizer Nuget -- Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities
@Maverik don't you dare, i'll delete your post. spam is not allowed here ;)
@Julien one sec and i'll do that
Yes, I'm drawing a parabola
I guess parabola is the correct term..
looks useful mav
.net has a built in pluralizer, usually good enough for me
never had to do sentences though
@Kevin I'd expect nothing less!
15:26
@AndréSilva well your parabola can change based on the equation--is the equation going to be changing or what?
at least then i wouldn't have to move images out everytime i login!
if you're using nuget of Humanizer, you don't need to pull in every single locale and instead you can target your own specific locale directly
@Maverik i would say, "then stop logging in" but I don't want you to take it seriously... which is something i feel like Stefan did... Stefan is probably your other personality, isn't it?!
I hope not!
Nope, never
It is for a college project
@Alex check out the ninject demo
15:29
@JohanLarsson say you wanted to add a common, shared piece of UI to a ModernUI window. or even better, a floating panel, think Picture in Picture
It is the nicest I have seen for wpf
possible?
yes, compose with viewmodels and use comntentpresenter + template
something similar, somewhere?
those are big words. lol
gonna clean up stars before they get pushed so down that i can't clean anymore without forged requests
15:31
@Julien sry about the words
    public class Shared
    {

    }

    public class Vm1
    {
        public Vm1(Shared shared)
        {
            this.Shared = shared;
        }

        public Shared Shared { get; }

    }

    public class Vm2
    {
        public Vm2(Shared shared)
        {
            this.Shared = shared;
        }

        public Shared Shared { get; }
    }
would look like ^ in code
And then View1 would take Vm1 as argument in its ctor
where Shared is what, a UserControl ?
a veiwmodel
@AndréSilva then simplify your equation to just be x^2 so its always positive
wat. where is the view
I should add a sample to the ninject thing, hold on
maybe there is already
15:33
@Julien that bot star you have.. should it stay? I'm not sure.. considering it was updated years ago last
bot star?
fourth from top
oh. you can kiill it
cheers
although i highly recommend it :D animating tile panel is great, even for being so old
15:34
and I don't know if you should use a beziercurve to draw a parabola, might be better off using linesegments and adjusting the resolution of how many segments are drawn
Perhaps link the trick itself?
as it is, i couldn't even tell what that link was
whos the bot star?
it's gone. you'll never know.
thats what i just killed
15:36
destaring cos LaTeX :)
@Kevin That is what I've done haha
(it was my star)
Latex is awesome :(
@JohanLarsson, wow i'm liking the MahApps UI :)
very cool
it doesn't matter if its latex or not, its gotta good instructions which are done using algebra, which is a language anybody in the world can speak
15:43
curious @Alex, Johan linked you ModernUI not MahApps UI -- are you sure you're looking at the right thing?
(they're both cool, just slightly different approaches)
Yea but it makes it scenario specific, i had originally thought it was a generic tutorial on charting
set Gu.Wpf.ModernUI.Ninject.Demo as startup proj
that would be Julien
15:44
@Maverik both I think
dang. i already installed MahApps!
Julien & I use MahApps, Johan uses ModernUI :)
Johan: i was talking about the Gu.Wpf.ModernUI link you gave a bit earlier
Lynn uses modern I think
how do you uninstall a NuGet package?
@Maverik I linked the original and the fork
15:45
same way you install it :)
oh
let me back out then
@Alex rmb sln node manage nuget packages
Are you awake Julien?
you can roll with Mahapps If you wish Alex, its just that different people have different level of experience with different frameworks, so you'd wanna choose the one that you're comfortable with and have somebody to ask questions from
barely :D i'll check it out later from home, still thinking about how i'd implement it
just an idea at this point
ok. removed MahApps
15:46
thanks for the sample
now on to ModernUI
having said that, i'm really liking the new MahApps.Metro + MaterialDesignXamlToolkit + Dragablz combo
for modern you probably want to start with the demo app and modify it
installing ModernUI via NuGet
modern ui is good but it forces you pretty hard into specific design pattern, at least stock
15:47
^ yeah, not very nice in that way
yea that was my reason to move away from it
ahh
BUT its a good start i think when you're still trying to find direction
upside is that you get a lot for free
MahApps is good when you know exactly what you want but you just need tools to do it
15:48
mah apps is more a theme pack with some helpers, while modern ui is a full on design pattern + theme pack
Modern will do a lot of direction for you by forcing you into patterns
yeah modern is more a framework which is a bit smelly
you can just use modern ui windows without any of the nav stuff
but i think i'd prefer mah apps for just that
for now, i'll just use the stock wpf controls and then add the ModernUI stuff
yup well put julien
that'd be a bad idea alex
you'll have to rip things out
15:49
oh
if you want to try modernUI, start with it
so go with it from start?
@Alex you cloned it right?
yeah it will be a big pain to implement after the fact
Mahapps is a little more flexible in that regard, but ModernUI is not so forgiving
15:49
unlike mahapps
@JohanLarsson, yep
Run the demo thing and have a look
for a beginner, will i run into issues with Modern UI?
probably
Then if you deceide to use it you should probably copy the demo thing and modify it
15:50
I wonder if we have any Elysium user around
I haven't used it myself or know anybody who has used it here, but its the third contender for using a Modern interface theme
Solid project for sure
interesting, the project appears to be paused since Oct 3rd, 2013
so i guess we're back to 2 :)
someone find a wpf package that makes context menus actually easy to work with
how about that :D
joke of the day ^
PS: MaterialDesignToolkit can be used independently of MahApps for vanilla app look with material design theme
it's getting ridiculous now, i have a dozen context menus in app.xaml and its probably going to triple
When things start getting too ugly, you need to take a step back and think outside the box :)
15:57
gah!
I'm in middle of implementing stuff Roland Pheasent used in his trader app
DD = win
I have a feeling his TailBlazer probably has a neat way of doing ContextMenus
even if not, ReactiveUI + DD shuold cure that ailment
since RUI isn't dependent on xaml
i have a user control that gets used in dozens of views
but the UC has a different context menu on each view
sounds like a typical dependency injection thing
15:58
so what i've done is chain dp's
i'm pretty sure RUI will be good for that
so that i can pass the correct menu from app.xaml from the top level all the way down to the uc in the view
isn't that what a proper DI framework would do?
i want to bind for my context menus
i think your only problem right now is the fact is that xaml is getting involved and that makes DI framework's life difficult
15:59
that would be so much better
this item type has these menu options defined in it's view model
well again, RUI uses code based bindings (its own lambda stuff not typical code behind)
so in theory context menus should just work
Thanks again @Kevin :)
thinkpixellab.com <-- nice front page of the guy who did BoT
<3
what was my name before netscape, or was it always that? Hopefully you remember be andre :)
we still haven't freed Stefan
I imagine its hard to escape dungeons when your back ache is severe enough to disable movement
Question: Do you guys use an "Infrastructure" in your MVVM projects? If so, what goes in there?
16:19
gonna have to be a bit more specific
thats as specific as I can get because i dont know what its for
16:30
infrastructure... hrmmm
i'm guessing thats your models?
ioc container?
i make folders and put files in them
lol
dotnetfiddle.net going slow for yall?
Once sec guys .. sorry i got pulled by my director
so I'm trying to figure out code from here: github.com/RolandPheasant/Dynamic.Trader
and trying to figure out his logic behind using Infrastructure folder
in the Domain project, it appears he's adding stuff that's not directly related to app in there.. like logging & scheduling
logic*
yeah, looks like "common"
16:40
thank you :)
but in the Client project, i completely lose him
its like "Others" catch-all folder
how do you store the user info across a wpf app? on the old web apps, you'd use a session variable. i'll need to fetch the values such as the user's Name (off of the AD) and authorization level
statics / singleton vm / application properties
i like singleton vm, personally
so just a POCO?
yeah
you can do start up init in the constructor + get access from anywhere without having to chain refs + get a sensical place to do operations like change user and what not
would i instantiate it in the OnStartup() of App.xmal.cs?
16:51
singletons init inside themselves
oh
i'll need to research it some and see how to use it
    public static MainPageVm Instance => _instance ?? (_instance = new MainPageVm());
I can't remember a time in the last month that the room was this busy.
then anywhere in your app youa re able to do MainPageVm.Instance.Whatever
its a way of giving you a static reference to a single initialized class
that makes sense. i'm only going to have one window with multiple views/VMs
would an IoC container like Unity make sense here?
Example...
1
Q: MVVM share object between the all the views

Al WellsI have MVVM Project and I want to share one object( singleton ) from the model between several viewmodel what is the good practice to do that? Thank you for the help

16:58
Same advice as other frameworks: stay away from Unity until you fully grasp all the moving parts in a wpf app
@Maverik good advice
life is hard as it is when you're new in wpf world, don't make it harder for yourself by adding more layers :)
and it may not seem like much, but you'll soon find out that wpf has a lot of moving parts in it
thanks. will wait on the add'l frameworks
i mean i've been with these guys for years and have dabbled in wpf for a bit too and i still ask questions like the one above
"what am i supposed to put into this folder"
introducing a DI framework will instantly add the overhead of Interfaces at the very least
i'm a total noob, so will be asking lots of questions
17:00
and VS isn't that good at figuring out the concrete implementations being used
as long as you dont ask googlable questions, you should be ok
:)
will try to avoid those. i know the rules for SO, and will do my best to follow them here too.
dock panels and view models
all you need. lol
cos they're pretty annoying when you consider most of us residents have been answering same old questions for ages and its the same answers and at some point people get tired ;)
@Alex Maverick is our bad cop when he is not here you can ask anything :)
yea i dont think you'd be annoying anyone :)
17:02
hope i get to ask a question one day that stumps the experts
but answer frequency might go down
Johan: i'm not the bad cop just here.. i'm the bad cop in my guild too xD
i do all the kicking or any other sort of sanction on members
cos everybody else wants to be the good cop
now that reminds me of Lethal Weapon 2, with Leo Getz and his bad cop/good cop talk
17:03
lol. in my old guild we had a club called Team Asshole for all the cool people. i was the chief
I don't even remember how it was to write wpf without ioc container
@Alex lol you'll have to find experts.. there's reed.. and of course johan.. but i'm not sure who else would like to raise hand as an expert here
but we love questions that make us ponder for a solution
lol Julien
@Maverik expert is a relative term. to the beginner, anyone who has built apps using wpf is an expert :)
:)
we reserve that for select few in here
people with published libraries / blogs :)
which reminds me! Alex do you have winform background?
posted on March 08, 2016 by ericlippert

I am spending the week at FB headquarters in Menlo Park: (That’s me looking out for the thief. He’s around here somewhere.) I assume that the axe-wielding troll had already been killed and turned into mist, since the room was … Continue reading →

17:21
yeah, i did VB6 back in the day. and maintained them up until a few years ago
hmm in that case you may find Reed's blog post useful for transitioning from a familiar background to wpf
its a series that we pretty much recommend to all newbies coming into wpf world. It should give you a good basic grasp of how things work in wpf world and the right questions to ask when you need to
Another handy site that deals with one bit of wpf at a time: wpf.2000things.com/index
(there's 1100ish tips / posts on that site)
lower numbers = lower difficulty
thanks!
wpf.2000things.com/2010/07/13/1-what-is-wpf <-- thats where it starts.. you could just hop through it sequentially to read about basics after you've had a go at reeds 6 part series
or you can use the index link as a point of reference to see how some of the common things are done
17:31
thanks again!
no worries :)
Do keep in mind that most of the web works with WPF v4 (or god forbid v3 at times), and we're with v4.5 right now. Some things have evolved since 2010 and if things aren't working out, it could be due to evolution
(and we can generally point you in the right direction if you hit one of those issues)
18:04
hey everyone!
got an interesting thing I need help with
I want to build an accordion control off of the mahapps.metro framework
does anyone have any ideas?
(similar to treeview but animated and using rotating arrows)
never done any such thing here sorry
18:42
accordion?
you mean Expander ?
18:59
yeah
pretty much
but animated
pretty much the treeview but with a different icon
and a few animations
19:24
                                var iconForFile = Icon.ExtractAssociatedIcon(file.FullName) ?? SystemIcons.WinLogo;

                                using (var ms = new MemoryStream())
                                {
                                    iconForFile.Save(ms);
                                    MyVm.Thumbnail = ms.ToArray();
                                }
icons all look really pixelated and blurry
is there a better way ?
my Thumbnail property is byte[]
 
3 hours later…
22:30
@JoshMenzel you talking like the album art in itunes?
when you can swipe left and right?
Hey, stupid question I just had... If I create an animation in XAML and create an element that should be animated, but that element is created dynamically in the back code, will that element be animated ?
I don't think so? You can apply the animation by grabbing it from the controls Resources and setting up the animation in codebehind though
That seems something that would take more than 30 minutes for me to do, I'll google it!
Thanks :) Now I have a base to search haha
@JohanLarsson may know
00:00 - 15:0015:00 - 23:00

« first day (1236 days earlier)      last day (2913 days later) »