« first day (2161 days earlier)      last day (1988 days later) » 

9:04 AM
I'll put a hose on it, and see if the smell goes away :)
 
9:24 AM
@Alex May also want to explore: 10printhello.com/oneof-npotw-2-of-n
@Jeffrey should be inheriting from EventArgs & defining your own properties to handle your cases
 
Maverik, thank you! but eeh... you kinda speak in riddle....
 
lol
standard event handler delegate looks like: public delegate void EventHandler(object sender, EventArgs e);
you're breaking that pattern and that's what the warning is about
for example, public delegate void PropertyChangedEventHandler(object sender, PropertyChangedEventArgs e); is the one you use frequently in INPC
 
so you're saying: make a custom eventArgs which implements EventArgs, but allows for both int and string to be given?
 
so you should be defining an EventHandler<MyEventArgs> where MyEventArgs : EventArgs and carries the properties for you to deliver the data to event handlers
 
or am I like making no sense?
 
9:38 AM
allowing both int & string sounds weird.. you have two different values.. i'd expect it to go in two different properties
but if you must send both in one.. use something like OneOf and define a discriminated union
(its the same library i linked to alex above your reply but that one is blog post)
 
ah, nice! will go look into that (or make my code less.... mandatory to have both)
 
 
1 hour later…
10:58 AM
Hi all
 
Hey Alex
 
Hey Maverik
 
hey Alex
 
Hey Jeffrey
Maverik, that's a cool library -- OneOf
The .IsT0 is throwing me off... the T is referring to a generic type, but what is the "0" for?
 
yup.. and it's sister library is very nice too ValueOf
its the two things i really miss from f#
First Type?
 
11:03 AM
Ahh yes
 
(i haven't used the library myself.. just found it while looking around after your question & Lynns answer)
 
Return value is cool too: public OneOf<Product, NotFound> FindProduct(int productId){...}
 
11:29 AM
I'm a bit stuck. I think I get the problem, but not sure what the solution is.
https://gist.github.com/JBtje/7af1c0ed6fe4a9d7547f5c990d154f76
Almost all works find, but it cannot bind "ButtonPressCommand".
That makes sense, because its searching for "ButtonPressCommand" in the "Ports" model.... but I need to bind it to the VM property "ButtonPressCommand".

So i think i need something like relativesource? or static? or?
 
11:44 AM
took awhile, but found it: stackoverflow.com/questions/1511516/…
 
Don't forget to upvote the answer + the question if they help you
 
I tend to do... thanks! did the upvotes :D
 
12:01 PM
:)
 
12:30 PM
Off-topic: for fans of Star Trek 2 (Lynn!), a very cool "modern trailer": youtube.com/watch?v=7ToQ7wAwZ8w
 
Hi all
At Android MVVM I am bumping my head on the same problem I had on WPF MVVM
How do I call on a dialog? How to start such View without actually having this View in my ViewModel?
 
Not sure how actually managing that in terms of android works, but if there's separate, relevant data, ideally the parent VM would create a child VM, or call on a service to do so, and the child VMs creation would also trigger it's data being shown in the relevant View, I think
In all the WPF situations I've seen, dialogs which need a simple choice (2-4 options that you might put in an enum, say) can be a simple (possibly awaited) call to a service which pushes the dialog and returns when the dialog has a result
More complex VMs are probably owned by some other portion of the VM layer, because that data ultimately is owned and needed by something (or else why does the data exist?)
 
"it's data being shown in the relevant View" this part I get
" which pushes the dialog and returns when the dialog has a result" Is a service allowed to hold the UI element in MVVM terms?
Because in my WPF app the dialog looks as followed
    // the inherited method comes back here
    public string GetFolderPath(string folder)
    {
        var dialog = new System.Windows.Forms.OpenFileDialog();
 
12:54 PM
Yeah, sure. If you're using a native dialog,the idea would be to have a service which owns it, and perhaps allows the program to run normally while the dialog exists, and appropriately notifies the VM which invoked it. It may also allow only one dialog open at a time, depending on how you build your service.
 
Aah so that is the trick
The Service is holding my dialog, the VM is simply calling on the service
Service could do UIElement.Show() without the VM violating the MVVM pattern
But then the service must be static right? Otherwise the VM holds a Service object which holds the direct UI-element reference?
 
1:16 PM
Yeah, the pattern is normally there's some root singleton, and what type it is depends on if you're using a DI framework or not, and your precise structure.
I use the lazy singleton pattern a whole lot for my work, because of the way I have to bolt on to this API
And if you don't have some sort of service locator or DI container to get the instance of the service for you, it's how I'd default to instantiating services
Let me quickly gist what I mean and what I'm doing...
Mmmm. Hold on. I don't have a great example here because I have a rather more complicated thing going on right now. Here's Jon Skeet's article on a couple of singleton patterns: link
If you're on any recent .net framework (v4+), you can use version 6, which is succinct, fully lazy, and threadsafe.
 
1:51 PM
Ah yes I get that pattern, got it on my school recently as well
Thank you for all the info, DI framework(?) not sure about that though
I am not sure about the service locator though, and DI is not known to me either (will look it up)
 
So another common thing in WPF (and with other MVVM too) is to use a framework for dependency injection. What this means and looks like varies a bit from framework to framework, but the idea is that you write interfaces that describe what you need at a given location, and write concrete classes implementing those interfaces.
The DI framework works out which concrete type to provide in a given situation. You might have different dialog services on android and windows, for example. Or use the same VM with different views on iOS and Android
Or have different views of the same VM depending on other context. DI frameworks work to solve a lot of the 'glue-code' and to help you avoid tightly binding to types, which is something that might be desired in WPF (and elsewhere in MVVM)
 
Thanks, that clears out
 
and supports unit tests!
 
2:09 PM
Right. Sorry. Big point for a lot of people: The DI framework lets you inject classes that don't actually do the work, but satisfy the interface, so you can test just the type you want without starting up all the 'real' services (which might hit databases or the internet or whatever)
 
just that few enough people really need a strategy pattern that the unit tests is an easier "go do this" reason beyond "best practices"
 
You realize why best practices exist when you don't follow them. Unit tests become difficult/impossible. Code becomes impossible to manage because of tight coupling of UI to logic/data layer.
 
hey guys does this diagram make sense?
 
It doesn't communicate a whole lot of information.
but the information that is there is understandable
 
I just wanted to have an overview of the parts of my app
 
2:16 PM
@Alex I mostly feel like I should learn about MVVM and such asap since I am still a student and it feels relevant since more and more platforms implement it strongly
Also my code becomes more pleasantly seperated, which provides less searching and headaches
 
That diagram could basically be jus the box on the lower left with a "My program logic is in a library run by a shell .NET application"
and then you are just describing some general areas that you put classes in
Its not a bad diagram persay, but its not like its revealing anything profound about your app
That's the right feeling MwBakker
 
what I really wanted was to show that its a plug in library, that the user can extend with more plug ins and that its run by a shell application
 
Your diagram does not show that at all
besides using the word "Plugin"
If you want to show plugins, the diagram should include at least one sample plugin, the separate library that contains the interface, etc.
 
Bakker, totally agree. MVVM is becoming a universal pattern
Current MVC app is really MVVM. Tons of VMs used all over the place
 
3:14 PM
Being on stack sure is a risky business
Trying to get into the Android room for an Android sepcific q, but needed 80 rep
Gained 10 points two houres ago, and just lost 8 haha
@Alex True MVVM is still always kind of a discussion though
Jesus, somebody even went on my account and pushed me down another -2 on a very old thread for I dk what
 
3:32 PM
* another - 4 I have an enemy haha
 
4:07 PM
Which post, Bakker?
Put a link here and we'll reverse it :)
 
4:24 PM
That answer... is not great. And its on an awful question
explains the DVs
 
4:43 PM
Maybe then Bakker shouldn't post a link here :)
 
I delete voted the question... if it ends up deleted he should get the rep back
 
Good call
 
5:30 PM
Looks like he did - he's back up to 82.
 
5:47 PM
would you consider an API just the set of publicly facing methods and properties that you use to interact with some library?
 
That's basically the definition of an API yes
Its not necessarily the exact way that term is always used
but its a good working definition
I would, though, replace "some library" with, "some package" or otherwise more generic
applications, websites, etc can also have APIs
 
what do you think of this variation of my diagram
 
That tells me quite a bit more than the previous one. I think it makes sense, and explains the structure to some extent.
 
ok cool...I'll just stick with that...of course I'll add description and further break it down using class diagrams
 
6:04 PM
Are your plugins actually inside the library?
 
good point, no they aren't they are in folders ...they are linked to the library by the plug in contracts dll
 
Then maybe they're in their own external boxes, with an arrow int the system they plug in to?
 
but the host application only needs to reference the report processing dll to use
yeah I could separate them out that way
 
In a component architecture (which looks like what you are going for... sort of) you certainly have each library in its own box
With interfaces as "lollipops" sticking out of them
 
I could do that
 
6:08 PM
"API" isn't really a great block either. Is that supposed to be a single class? If so, it should probably just name its interface the same way
It comes down to: What message are you trying to send?
An implementor working off that diagram would probably get it wrong atm
 
just what the components are...very high level how they relate to each other
 
Well, you have the components
I see basically no relations
 
I think the location of them (if they are under each other) was supposed to convey that
for example .net framework encompasses everything so its at the top
I've seen Microsoft produce diagrams like that during presentations
 
Fair, though they are typically doing really high level architectural stacks
I personally haven't used or seen that style for an application
 
oh
 
7:03 PM
hello people
 
Hey Hasan
 
how is things?
I'm still trying to get a dev job
 
Exhausted but still here :)
Keep at it, Hasan. You'll find one
 
I hope so. I've been trying to get one in Dubai but almost every company here are looking for PHP developers with some CMS system knowledge
 
Hope the CMS isn't Joomla
 
7:08 PM
so no Dubai. I'll push for Europe
I don't know but although I am not in the industry, I can tell from the job ads, I wouldn't be happy doing that kind of stuff
 
Get your foot in the door. Never look at that job as the last one you'll have
In IT, you're always looking, keeping your options open
Once you have that job, it's easier to jump ship at some point
Even if it's not what you want
 
I was thinking I should find anything .net based
 
Well, that would be great. But at this point, anything programming/db related
So keep your options open
 
I see
 
.NET is the dream job. But in the meantime, you can work doing DBA stuff, or (gasp!) Winforms
 
7:13 PM
haha
I was worried that kind of stuff would stick
 
Nah. I did cobol/OpenVMS years ago.
Plus PHP/CMS/Joomla
We have to go through the darkness to get to the light
VB6, VBA, classic ASP
VB6 app firing off a DTS to pull data from flat files on OpenVMS into SQL Server 2000
 
omg no
hahaha
sounds horrible but you are right. I need to get my foot in the door
 
Yup. Yet, today I'm blessed with a job that lets me do modern tech. They defer to me on tech questions
 
... COBOL? Ugh. Bank job?
 
State uni
But before that, I'd done Lisp. So i was somewhat familiar with self immolation.
 
7:25 PM
lol. Lisp has some nice features. Just... quite the syntax.
 
Just write ten thousand parenthesis and you've created your first Lisp program
 
heh.
 
{}())(({}}{}}{{}}}{}{}}}
 
((((((((()))))))((((())))))((())))
 
more like: (*(+27 6) (-(/ 3 6) (* 7 9 2) 3.7))
 
7:33 PM
I abbreviated it for brevity ;)
 
XD
(The statement of mine returns -4214.1, by the way, if I've math'd correctly)
 
Hiall
 
Impressive, Zarenor
 
Any ideas, why pastebin.com/CSVM0e8k will only show me the grey canvas, on program run? pastebin.com/CSVM0e8k
Image shows up in the xaml editor
 
I started reading the wiki explanation of how Lisp want you to understand it's lists and it immediately confused me. I don't understand why they need such a complicated explanation and so much jargon for a singly linked list.
Oh, I didn't do it in my head. Definitely typed it in a calculator.
best guess? Probably the asset isn't being copied to the output location correctly. Not a certainty, but a guess.
Might check the 'Build Action' on the assets folder or the image
 
7:38 PM
it is copied
the assets folder is right next to the exe and the file is in there
 
Rando Hinn: Can you provide MCVE?
 
literally that, Assets added via VS, then files added as existing items. File build action is none and set to copy always
okay
got it
set the build action to content
 
8:20 PM
Another quick Q
I animate 2 images sliding offcreen (a split fullscreen cover) with pastebin.com/kVLeEHBP
However, this can be triggered as many times as I want... On calls 2-n+1, the images slide immediately. Any way I can delay the start of the timer, reasonably, to allow the images to be seen for about a second?
And if you can make it smoother, let me know :P... The first one is especially choppy
 
I think what you want to do instead is use a Storyboard for this - it's the preferred method of animating anything in WPF. I think if you work with a storyboard for this, you could queue them however you like. It will be a bit more complex to work with, at least at first.
 
ooh
do you have an example?
 
But Storyboard animation can be as smooth as you like. the default methods - linear interp etc. are extremely smooth - the math is handled per-render-frame
I can link you to some. But be warned: Storyboards are complicated because they do let you animate... well, almost anything.
For slide-in slide-out animation, you probably want to use images positioned on a canvas, I would guess.
One sec while I find the docs
Here is the microsoft intro to animating properties using storyboards
I think you already have some of what you need, but I don't think storyboards will directly animate thickness (I think I've had that issue before) - You'll probably want to use a canvas so you can animate Canvas.Left or somesuch - that's why I'm suggesting a Canvas.
Things like GridLength, Thickness, and Size can be a real pain to animate because they don't like to be handed a double . There are workarounds, if it's what you determine you need - usually some sort of intermediate property that does the conversion.
 
okay
Canvas can't have 2 smaller than itself images fully fill it up, though :/
 
The XAML elements won't do the conversion on their own, unfortunately.
Canvas can have arbitrarily many things. The thing you'll need to do is be sure to size the images
 
8:31 PM
my left and right are 1920x1080 in total. Canvas can be whatever it wants (will make the images be svg's or sth like that later on)
 
Sure
 
but
the images only fill 1920x1080 in the canvas
-.-
 
What you will need to do is know (or check) what size the canvas' displayed area is. It doesn't automatically size items, no
You'll have to set the width or height of the image controls
 
okay
 
You could try using a different type of panel, but Canvas is the one that lets you position objects in an absolute fashion, which is what you're likely to want to do a slide transition.
Doing it cleanly and neatly will seem a little complicated, but like a lot of things in WPF, once it works, it just keeps working - there is unlikely to be an edge case that breaks it.
If I was doing it, I'd probably make the thing displaying the image a control, and internally cycle through three Image elements. That way you always have a center, left and right element. Then you can work out the animations and other behaviors, and encapsulate it all neatly. But that's just me. you may have other ideas how to get it done.
 
8:41 PM
Rando, I wouldn't use a canvas for any of that
the slide transition can be done with a TranslateTransform which is much more efficent
Some other panel would also take care of the sizing
 
8:59 PM
@Zarenor How do I set the Propertypath for the position?? the location varibles are not accessable on the objects?!?!
what goes instead of WHAT_ON_EARTH in animateCover?
 
Should be Canvas.Left
But I'm not sure how that works with attached properties
its fairly simple with the transforms
 
nope
        Storyboard.SetTargetProperty(myDoubleAnimation, new PropertyPath(Canvas.TopProperty));
does not move it at all
 
It wouldn't be TopProperty
Literally the string "Canvas.Left"
but like I said; I'm not experienced doing that to a canvas
You can't access the property directly because it is an attached property
 
noope
public void animateCover()
{
DoubleAnimation myDoubleAnimation = new DoubleAnimation();
myDoubleAnimation.From = 0;
myDoubleAnimation.To = 200;
myDoubleAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(1000));

Storyboard.SetTargetName(myDoubleAnimation, CoverRight.Name);
Storyboard.SetTargetProperty(myDoubleAnimation, new PropertyPath("Canvas.Top"));

// Create a storyboard to contain the animation.
Storyboard myWidthAnimatedButtonStoryboard = new Storyboard();
myWidthAnimatedButtonStoryboard.Begin(CoverRight);
does not move it
 
I think there's a minor bug with attached properties where you have to put the property name in parens - (Canvas.Left)
Let me seeeee
.. You're asking CoverRight to move... down?
(And it isn't?)
 
9:04 PM
yup
 
m'kay. Sec
 
yupx2
 
I thought the parenthesis did some sort of cast
you have to use them when animating a piece of a TransformGroup
but maybe they help with attached props as well
 
Yeah, there's a known (and long unfixed) bug that requires parens or it doesn't resolve correctly.
So try "(Canvas.Left)" rather than "Canvas.Left"
 
        Storyboard.SetTargetProperty(myDoubleAnimation, new PropertyPath(("Canvas.Top")));
?
Nothing at all
 
9:08 PM
If that doesn't work, then I'm not sure. I'd expect that property resolution to work. It may b indeed be easier to follow Bra'd solution and use a TranslateTransform (Though I haven't monkeyed with either of these cases much)
Storyboard.SetTargetProperty(myDoubleAnimation, new PropertyPath("(Canvas.Top)"));
Subtly different there.
One set of parens in the quotes
It's a weiiiird quirk in the syntax that the DependencyProperty name resolution uses.
Like I said, a known and long-unfixed bug. Apparently the workaround is simple enough, and the bugfix complex enough, they haven't fixed it.
 
that changes even less
 
Well the way you'd written it probably didn't compile, because it was a ValueTuple<string> instead of a string. Do you get an error out of the compiler, or a runtime exception? Or just nothing?
 
plain nothing
even with your line
 
Hm. Id've expected an exception if it failed to resolve the property. But I'm used to binding these in XAML, so I'm not sure what to expect when binding them in the C# code
 
9:16 PM
My next thing would be figuring out which part was failing where. I'd have something bound to the Canvas.Top on the control.... Or hm. wait.
Yeah. I'd probably try putting a plain-old C# property in the middle. Or a dependency property. And see if it's changing an the control isn't moving, or if it's not changing.
Have to divide it into smaller problems.
But, I just realized something.
Are you naming CoverRight anywhere? setting it's name property? x:Name in XAML? Unlike WinForms, names aren't required for a control to exist. But for binding-by-name, like it looks like you're doing, it is.
 
<Canvas Width="Auto" Height="Auto" Background="Black" x:Name="GraphicsCanvas">
<Image Source="/Assets/cover_slide_l.png" x:Name="CoverLeft" Stretch="Uniform"></Image>
<!-- Change this to svg for 2019 -->
<Image Source="/Assets/cover_slide_r.png" x:Name="CoverRight"></Image>
<!-- Change this to svg for 2019 -->

</Canvas>
I do that
 
Gotcha. Hmmmm. I'd have to build this on my machine to troubleshoot it more. My guess is that the binding isn't binding correctly. I doubt that the control is correctly bound and not moving.
 
But I've got to head off now. I would definitely consider some sort of intermediate property - especially if you're only switching between two images. Brad mentioned the TranslateTransform, and as I mentioned, it may be his idea is better than mine
 
not switching, just moving...
but ok, will ponder on this....
 
9:36 PM
PropertyPath with animation is a pain
(One of) the nice thing about translate transform is that because you can target the transform directly if desired, the path gets really simple
 
 
1 hour later…
10:46 PM
posted on September 19, 2018 by Brett Lopez [MSFT]

We deliver .NET Framework updates nearly every month, through Windows Update and other distribution channels. We are making changes to the way that we deliver those updates. We’ll soon start delivering a Cumulative Update for .NET Framework alongside the Windows 10 Cumulative Update, starting with the Windows 10 October 2018 Update. This new approach will... Read more

 

« first day (2161 days earlier)      last day (1988 days later) »