« first day (920 days earlier)      last day (3229 days later) » 

10:54 AM
4 messages moved to Trash can
 
 
1 hour later…
12:08 PM
I got some more good shit for you WPF peeps. Material Design date pickers: dragablz.net/2015/04/27/…
 
:)
noice
Just when i move away from WPF.. good shit starts rolling in!
Thank you :)
any chance you could edit that to be a proper link or shall i do it for you?
 
uhm...how do i that? yeah...you do it! :) i can manage XAML...hyperlinks....different story :)
 
heh i just did, but i can't star it now.. somebody else will need to
 
i just did :)
 
thanks
 
12:34 PM
morning guys
so i made a loading screen that populates all my OC's in a background thread
then i load my main window
but at some point i have to switch those OC's to the gui thread
and i can't seem to figure out the most optimal way to do it
whatever i try, at some point i end up locking the gui
is there a pattern someone could recommend?
 
1:28 PM
Morning Julien
the thing you commented out?
where is it locking?
 
hey mav. when i uncomment that, it doesnt lock but my bound listboxes are empty
but looking at it more i think that is my own fault
i am using DynamicData
and it is using .ObserveOnDispatcher()
and beacuse i am loading stuff in background I don't think it's seeing changes
 
Yea i was about to say
you have to marshall it back when you send it to background thread
do stuff in buffer on background thread
and then do final assignment on Dispatcher
 
1:43 PM
when you say marshall it back
what does that mean
and what does the "final assignment" consist of exactly
 
hmm
well..
 
i feel like i need a reference to the background context
that i pass around
 
Task.Factory.StartNew(() => LoadStuffs()).ContinueWith(x => Dispatcher.Invoke(Action(()=> DataContext = x.Result))));
 
ok. do you think i should be assigning the main window datacontext in my loading window?
i am doing that in main window c'tor right now
 
well I'm just giving example of how i meant the final assignment should work
oh i'd say don't do it there
DataContext is accessible from outside.. just assign it from loading screen
 
1:47 PM
ok i like that
ok definitely better approach. but my listbox still empty hehe
 
ah i'll clone it
wait thats a gist
is there something cloneable that shows me what it's doing?
 
dynamic data?
or my project
i think i have to start a task with an IScheduler
and then ObserveOn(myScheduler)
 
heyyall
 
o/
 
how should i inject loggers. seems diffakalt
for instance, i'll have loggers in models and viewmodels I'm guesing. i'll have status window which prints info
 
2:08 PM
morning
 
Morning
@Julien you may want to check the article from Reeds blog - he's got threading covered there
 
2:30 PM
so I have that ItemsControl now, populated with items as they roll in, but I would like to be able to interact with the items in the list
I was wondering what the best way to do that is
in MVVM style that is
pretty much all I really need to do is to detect a click, and have access to the values that that item has
 
2:45 PM
hehe. sorta up my alley
so because you used an ItemsControl and not a ListBox, you lose access to any sort of selection/click functionality baked in
are your items control items user controls?
 
@MarkW use Selector instead of ItemsControl.
Selector inherits ItemsControl.
telling you this for like the 4th time now ;)
 
3:16 PM
@Julien @BradleyDotNET So, remember that HierarchicalDataTemplate issue that I was having the other day? (how to specify multiple DataTemplates)
I think I figured out the "right way": HierarchicalDataTemplate has a DataType attribute.
Right from the MSDN page:
      <HierarchicalDataTemplate DataType    = "{x:Type src:League}"
                                ItemsSource = "{Binding Path=Divisions}">
        <TextBlock Text="{Binding Path=Name}"/>
      </HierarchicalDataTemplate>

      <HierarchicalDataTemplate DataType    = "{x:Type src:Division}"
                                ItemsSource = "{Binding Path=Teams}">
        <TextBlock Text="{Binding Path=Name}"/>
      </HierarchicalDataTemplate>
Clearly THAT's how you specify a different template for different "levels"
 
posted on April 27, 2015 by ericlippert

A common problem I see in object-oriented design is: A wizard is a kind of player. A warrior is a kind of player. A staff is a kind of weapon. A sword is a kind of weapon. A player has … Continue reading →

 
@Netscape im not sure if selector will help all that much
sorta looks like if I use it
I will get the control type within the select
and I don't care bout them being able to 'select' one
what I care about is knowing when an item is clicked, and the values that are in the list for that element
but I gotta read more about them
the example I see here is really shitty
isn't even MVVM
it would be nice if there was a way to return the element in the collection binding for an ItemsControl / Selector when the item is selected, rather than the control that's in the Selector
 
3:35 PM
use IsSelected and SelectedItem?
I bind to selected item, when a item is selected, I populate the "next" list based on selection
 
right but from my understanding if I have a Selector with a <Grid> with values in it, the selected item is a Grid
 
actually, I .Clear then foreach { .Add } after selecteditem changes
the SelectedItem is the item in the collection that you bound to it
are you saying you have a itemtemplate which has like a button inside of a grid?
 
sorta
 
and you want to click the button, or select something inside the datatemplate?
 
that's a good enough analog sure
its sorta like, the 'list' has three values that are displayed
an ID, text, and a state of a button, represented as a colored border
when that border / button / whatever you wanna call it is clicked
I would like to know the ID of the device
which is in that grid
all part of the same poco that the items control binds to
but I want to ignore clicks on the ID or the text
or even selection change of the Selector for that matter
 
3:41 PM
this seems all, mvvm...
 
that's now whats important in terms of events
 
the model should have ObservColl<ModelViewModel> Models... and ModelViewModel should have IsSelected
bind to isselected... then you can either call Models.Where(x => x.IsSelected); or SelectedModel.DeviceID...
or something
oh
ew
 
but I don't care about them being selected
I care about the particular part of the item being clicked
not any part of it
I sorta thought that I could make a user control and use that for the datatemplate of the itemscontrol
or selector
 
IsHitTestVisible might help?
 
getting pulled away... brb
 
3:45 PM
turn it off on the ID and text, turn it on on the border? maybe?
 
Hold on..
do you have option to bind to a Command in there?
delegate the responsibility to the control itself?
that should work for any UIElement
so when you want to react to a click - just assign a command
 
I will check it out
stuffs sorta busy here atm
so I can use the example there, but instead of doing it on the window, do it on the control that's in the datatemplate
the issue I see is how to get the object in the collection that the datatemplate is rendering in addition to being notified of a click on the correct component
 
of course :)
 
maybe if I went with a selector I could use IsSelected in conjunction with that
that should be enough I think
 
hard to comment since i don't know the whole scenario but IsSelected is a win in most cases
 
3:59 PM
I think that's the ticket
 
listen to it change via PropertyChanged VM Notifications and everything should work out
 
you guys rock
 
:)
 
@Maverik how would you implement logging to a status window + logging to a .txt file
 
get a logger that works via ILog (quite a few implementations on nuget) and wrap existing functionality to make a custom logger that does both?
 
4:06 PM
i mean, would it have a LogViewModel then for the UI?
 
yea?
if there's a display, it'll have a vm.. seemples :)
 
4:43 PM
@NETscape what is the actual name of the Selector type?
 
Selector? lol
 
well... that type doesn't exist
 
so is that a 3rd party thing?
ugh...
 
that's microsoft's website
 
4:46 PM
yep I see that
doesn't change that I cant use Selector in the XAML
 
Use ListBox if you want
only different is that it has two more properties. selecteditems and selectionmode
noticeable difference*
 
that seems to have worked
any idea why I cant use the Selector type in my XAML though?
not that it really matters im just curious
 
its abstract
you can't create an instance of an abstract class
 
so why tell me to use it?
 
i thought i've used it before
testing now.
 
4:52 PM
maybe you made a custom control?
 
ahhh. yeah i must've been writing some sort of custom control
 
that makes way more sense then
lol
 
i learned about selector when watching a pluralsight video
 
I kept googling it and finding really really poor results, and no real examples
thought my google foo was just weak today
 
and i didn't realize ListBox wasn't a direct child of ItemsControl... then I was like wtf, selector? out of nowhere. sweet.
 
4:53 PM
thanks again @Netscape, this should work out fine.... I do appreciate your help
 
so my bad. I should have been saying use something that inherits Selector :)
 
heh no biggy
 
5:07 PM
@LynnCrumbling Whoops, I could have told you that had I realized its what you needed :(
 
Morning y'all. Hope you had a good weekend!
 
5:33 PM
Morning Kyle
I brought my code in case you couldn't get the VSM stuff working
 
@KyleHumfeld 'morning :)
@BradleyDotNET No problem... we're looking at using a DataTemplateSelector now...
Odd thing is... it doesn't seem to fire for the base level (of the HierarchicalDataTemplate)
 
Haven't used selectors, sorry
 
5:50 PM
maybe Reed has...
 
what does your xaml look like?
 
@JohanLarsson this:
<ContextMenu Placement="Top" ItemsSource="{Binding DockedUIElementControlTypeValues}">
    <ContextMenu.Resources>
        <local:ControlTypeEnumDataTemplateSelector x:Key="ControlTypeEnumDataTemplateSelector" />
    </ContextMenu.Resources>
    <ItemsControl.ItemTemplate>
        <HierarchicalDataTemplate ItemsSource="{Binding Children}"
                                    ItemTemplateSelector="{StaticResource ControlTypeEnumDataTemplateSelector}">
            <MenuItem Header="{Binding Value}"
@JohanLarsson ControlTypeEnumDataTemplateSelector Seems to only call SelectTemplate() for level 2 and greater.
 
hmm I think it makes sense as written
I think you want:
<ContextMenu Placement="Top" ItemsSource="{Binding DockedUIElementControlTypeValues}" ItemTemplateSelector="{StaticResource ControlTypeEnumDataTemplateSelector}">
might require moving the selector to an outer scoped resource
 
Oh. Right.
Ha. Now.. I feel dumb.
(confirming)
 
6:16 PM
can you bind in a contextmenu like that?
In a tooltip there is no datacontext
 
Yes.. It's binding.. I think your fix makes sense.. I'm just trying to deal with expandos at the moment.
dynamics really are technology from the devil himself.
 
"HERE.. Have some of these dynamic things. They'll get rid of all that compile-time type-safety kludge you've been having to deal with."
 
6:34 PM
Yes, you can bind in context menus
but as you say, its outside the visual tree, so its a bit... tricky
@KyleHumfeld Did you get the VSM stuff working?
 
7:07 PM
Hi @BradleyDotNET, I got it to work for font colors and for page background colors. I haven't found a way to get it to work for, say, border thicknesses, and I'm getting weird XAML parsing errors such as this: Unexpected 'ATTRIBUTE' in parse rule 'NonemptyPropertyElement ::= . PROPERTYELEMENT Content? ENDTAG.'.'
I have no idea how to interpret that message, though I do know what block of lines it's originating from
Since the syntax is alien to me, though, I haven't been able to locate the actual error (there's no property with no value, for example)
This is the VSM block I'm trying to use:
(Inside the <Storyboard> tag)
<ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty="(Button.Margin)"
Storyboard.TargetName="ColorChangeButton"
>
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Thickness>40,10,20,30</Thickness>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
See any obvious syntax errors with that?
afk
 
I don't see any obvious syntax errors
Perhaps the way you are creating the "Thickness"?
 
@BradleyDotNET ah, good. Ninjabind then.
 
7:22 PM
I've tried a couple of means by which to do that, including this:
<Button x:Name="ColorChangeButton" Content="Change Color!" Click="ColorChangeButton_Click" BorderBrush="Aqua" BorderThickness="10,20,30,40">
and this
<!--<Button.BorderThickness x:Name="ButtonBorderThickness">
<Thickness>10.0,20,30,40</Thickness>
</Button.BorderThickness>
My target name was ButtonBorderThickness when I was trying to use that method
 
@Julien, I made a suggestion against the sort issue. Have you tried the fix
 
I did discover that putting the VSM at the Page root level did not work, but putting it within the StackPanel containing the thing I'm changing did
That was good to find out =)
Looks like the error resides in the <Button.BorderThickness> declaration. I've tried as many permutations as I can think of, and most of them look as expected in the designer, but they all have that xaml parse error that stops the project from compiling
Okay, tried a permutation that did work, now to get it to animate...
... and turns out that DiscreteObjectKeyFrames don't animate, so I've got to figure out another way to animate the change of border thickness.
 
8:08 PM
Does anyone know of a cheat sheet detailing common Property-path strings that are valid? Intellisense doesn't seem to know how to help with that, and guessing over and over again doesn't seem like the best approach.
 
8:19 PM
Also, I keep seeing this term in the docs, but it doesn't seem to be defined anywhere I can find: "partial qualification". What does this term mean?
 
so I noticed today the the binding on my text boxes only really updates when the cursor leaves the text field
is there a property I can set on the binding to make it happen whenever a key is pressed?
 
@MarkW Its the UpdateSourceTrigger
And yes, you can
"PropertyChanged" I believe is the one you are looking for
 
thx
 
@KyleHumfeld Your animation wasn't exactly complete
unless there were pieces missing
@KyleHumfeld trial and error :(
and SO
 
that worked perfect
thx again
 
8:24 PM
no problem
Partial qualification isn't a term I've heard before, but I'm guessing its referring to the (SolidColorBrush.Color) or whatever
 
I noticed a line in the docs that the animation with key frames doesn't animate from point A to point B, it just jumps
so that's not going to work
 
A discrete animation will do that
because it animates in, well, discrete steps
you want a Double animation to have it transition
 
But I've tried every permutation of Control, Button, BorderThickness, Left, with parens, without parens, etc, that I can think of, but I just can't get the DoubleAnimation to work on the BorderThickness.Left of my button
I came to the same conclusion regarding DoubleAnimation, but have had zero luck in getting it to work, because I can't figure out how to address the BorderThickness.Left property
I found an example that moved a rectangle around its containing Canvas, but it used Canvas.Left with some other things rather than the Rectangle.Left... haven't quite wrapped my head around that one yet.
And because I don't understand what they were doing there, I haven't been able to extrapolate it to Button border widths
 
For starters, make sure you are targeting the border element
There is a ThicknessAnimation but it may be WPF only:
Since BorderThickness is not a type, did you try something like (Thickness.Left)?
 
Yes, that's WPF-only, sadly =)
I think so but let me try again. When I go through iterations upon iterations, it's tough to remember what I've already done
Neither of these work:
BorderThickness.(Thickness.Left)
(Control.BorderThickness).(Thickness.Left)
Nor (Thickness.Left) alone
Without understanding the anatomy of the property addressing structure, all I can do is guess and try to find someone who's posted something that does exactly the same thing that I'm trying to do... which is both unlikely and unsatisfying
 
8:32 PM
What are you targeting?
I know that feeling :(
 
The Button itself
 
it takes me 10 minutes every single time I have to do transform animations :(
 
If I try to change its markup to put a <BorderThickness> element in it with <Thickness> values, the xaml won't compile at all
Otherwise, I could just name that <BT> and set its Thickness property and be done with it
but nope
gotta step away for a bit, be back in a while
 
It may have something to do with the fact that Thickness is a struct
so it may not be possible to animate individual properties (since structs are immutable)
but I could easily be wrong on that
Perhaps a better question is why you are trying to animate that property?
What effect are you hoping to get?
 
 
2 hours later…
10:34 PM
Hi @Mehrad
 
 
1 hour later…
11:36 PM
Mainly, I was trying to get experience in using the VSM to animate things in my Page, and I figured the border width was a natural place to move once I got the border color to work. Looks like that was a bad assumption. =)
 
Hey all
 
Yeah, thats not usually a property you would animate
You could do Opacity if you want to practice DoubleAnimations
Hi @Nolski
 
Is there a good way of debugging the xaml DOM during runtime?
I'm playing a video through code and it isn't showing and I'm trying to figure out a good method of figuring out what's going on and if it's the video file or if it's the position of the element or what.
I'd set a brake point and inspect variables and stuff but really I'm more concerned with what all of the layers are and what state the video is in and all that. Not sure if VS has tooling for that sort of thing.
 
What about the Height property? I tried that, but it neither crashes nor works (i.e. does anything visible), nor does it put anything in the Output section
And changing the Heights of things is something that I could see as being commonly animated (Widths as well)
 
/ME sighs
So it turned out for some reason the .mp4 build action was set to Resource and not Content
I'm going to start writing a big ol' checklist of things to check when UI problems arise
 
11:53 PM
Apparently you can't animate values of Setters in Style definitions. Too bad, but not surprising.
It is problematic that you can't do heights (and presumably, widths), though. Or if you know that it's possible, I could use a hand getting that to work.
 

« first day (920 days earlier)      last day (3229 days later) »