« first day (1237 days earlier)      last day (2912 days later) » 
03:00 - 20:0020:00 - 00:00

03:24
@Kevin no, that's a treeview, it's for an FAQ style thing where the Question is the top node in bigger text with an arrow on one side or the other, and when the header or arrow gets clicked, the arrow rotates to some degree via animation and then the smaller text/sub text gets faded in or animates in from a direction
the above is the current treeview
I want to modify it to do what I want as above
 
2 hours later…
05:53
@Kevin sorry yes
an expander would be exactly what I need
 
2 hours later…
08:13
well I got it partially working
the expander now animates it's content
on the 2nd attempt
have to open it
close it
then re-open it to see the animation
that is a long example of code
it's the files I modified from mahapps.metro
I want to animate the Expander
and I have successfully done so
BUT
I have to make it run 2 times
(expand, de-expand, expand)
to make it run the animation
09:51
morning
how are you doing @Hamza_L ?
10:10
hey
I'm fine @franssu, I'm just struggling with python scripts
are you living in Tunis ?
10:39
So, I wonder... Can anyone help with syntax on how to define a value converter on 'StoryBoard.TargetProperty'? I have a situaton such as

<DataTrigger Binding="{Binding Path=SomeProperty}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard Name="blinkerBoard">
<Storyboard>
<ColorAnimation AutoReverse="True"
Duration="0:0:0.5"
RepeatBehavior="Forever"
Storyboard.TargetProperty="Background.Color"
To="{StaticResource DarkBlue2}" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
(see full text)
I see I don't know how to format code. :)
ctrl + k
or surround your code with backticks `
@franssu Meh, it says too late to edit that one. Let's see StoryBoard.TargetProperty.
That works. :)
<DataTrigger Binding="{Binding Path=SomeProperty}" Value="True">
 <DataTrigger.EnterActions>
 <BeginStoryboard Name="blinkerBoard">
 <Storyboard>
 <ColorAnimation AutoReverse="True"
 Duration="0:0:0.5"
 RepeatBehavior="Forever"
 Storyboard.TargetProperty="Background.Color"
 To="{StaticResource DarkBlue2}" />
 </Storyboard>
 </BeginStoryboard>
 </DataTrigger.EnterActions>
Storyboard.TargetProperty="Background.(SolidColorBrush.Color)"
Anyway, I have this exact error message as desribed at http://blogs.msdn.com/b/mikehillberg/archive/2006/09/26/cannotanimateimmutableobjectinstance.aspx
"Cannot animate '...' on an immutable object instance" and I think that tip there is the way to go.
It worked all right for months, but other recent changes to the XAML make it happed so that the when the binding to SomeProperty, I very likely get that error message. Not always, but usually.
@franssu I suppose that doesn't hint on how to add a ValueConverter. Or then I'm too ignorant to understand it. :)
@franssu, yes
10:47
have you tried what I said ? ^
I live in Tunis
@franssu Aah, I see. Without converter! Just a sec...
why ?
you were far from the attack on monday
yes
the attack happened in the south, near our beloved neignbour Libya, the terrorists came from Libya
and Tunis is in the north
10:52
I guess Tunis is different from the rest of Tunisia
yes, safer
also, most of coastal cities are safe
@franssu Ah, InvalidOperationException on there too. The exception message is Cannot animate '(Background).(0)' on an immutable object instance.
how is the background set in the first place ?
Which is something new, I perhaps have better luck with this. Part of the problem here is, it might have been good to tell in the first place, is that this is defined inside a template like this:

<UserControl.Resources>
<ResourceDictionary>
<Style x:Key="TabHeaderListBoxItemStyle" TargetType="ListBoxItem">
<Setter Property="Margin" Value="0" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
/* snip, snip... */
(see full text)
@franssu Which is part of the problem. This template is too complex to my skills to modify in a way I can fix it (for now, at least).
I wrote originally the storyboard code as an addition to there, it seemed to work. Until now.
where is the background brush set ?
mmmh
is it not set ?
(the border's background brush)
11:08
@franssu I'm looking for this now. I'm not sure (XAML is not my fortes). I see it's not inside this template and its `Border.Style`. In that `snip, snip...` there is

    <ControlTemplate TargetType="ListBoxItem">
                            <Border x:Name="TabBorder" SnapsToDevicePixels="true">
                                <Border.Background>
                                  <MultiBinding Converter="{StaticResource XyzTabBackgroundConverter}">
Could that be such a Place?
There's also another multibinding converter after that for <Border.BorderBrush>.
I'd paste more code, but it looks like I can't get it formatted properly...
ok
you can try to comment out the multibinding
<!--                                <Border.Background>
                                  <MultiBinding Converter="{StaticResource XyzTabBackgroundConverter}"> ...  -->
and see if you still have the bug
@franssu Good point, I'll try that.
@franssu Still `InvalidOperationException`. The exception message is in Finnish (I should change language to English, I see -- a new work comp), but it's something like "not all property Background.Color cannot objects can be referenced" or something. Maybe it means the default background is now null and it might needs to be set. Regardless of that, the color should be set too. I modified a bit the template (to protect the innocent, so to speak) and it's like this

<Border.Background>
<MultiBinding Converter="{StaticResource SomeTabBackgroundConverter}">
(see full text)
Mm, this looks like getting somewhat difficult. Though, @franssu, you've given helpful insight already. I don't want to take too much your time on this. :)
11:25
Still comment out the multibinding but hard set the background
<Border x:Name="TabBorder" SnapsToDevicePixels="true" Background="Blue">
and check if you have the bug
anyways if you find out why, please tell me :)
11:39
@Veksi My guess it is a freezable frozen issue
If you set the brush in a style and it is frozen it cannot be animated
Wow, there's a separate WPF room? cool
Star this room and start lurking right now.
This is the best place you will find for learning wpf
I will know if you are in the lounge and not here :)
@fredoverflow Do you want a kata?
@fredoverflow Yeah, @JohanLarsson is everwhere except on Orleans Gitter. :-P
@JohanLarsson No thanks, I'm a pacifist.
@JohanLarsson Anyway, it's squarely the freezing problem for what I can see. I just lack the mental capacity to try that converter thingy: blogs.msdn.com/b/mikehillberg/archive/2006/09/26/….
Heh, I starred this. :D
11:47
@Veksi that looks like a nice way
The converter is simple enough no?
@franssu Sure, if I get this a sensible conclusion, I'm sure to tell
@fredoverflow I'll give you one any way, hold on
@JohanLarsson I haven't even installed Visual Studio at home yet ;)
do it while I code up the kata
@JohanLarsson

<DataTrigger Binding="{Binding Path=SomeProperty}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard Name="blinkerBoard">
<Storyboard>
<ColorAnimation AutoReverse="True"
Duration="0:0:0.5"
RepeatBehavior="Forever"
Storyboard.TargetProperty="Background.Color"
To="{StaticResource DarkBlue2}" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
11:49
@Veksi is that a thing that will blink?
I don't know how to apply the converter to that StoryBoard.Color. Is it even possible?
no, don't think it is possible
@JohanLarsson I won't have time for that today, sorry. But thanks :)
you want to bind the brush I thiknk
@JohanLarsson It's part of a template for a list of tabs a background of which I'd like to blink. Unfortunately the template and all is somewhat complicated. :/
11:50
@Veksi you can try this for blinking
It has worked before, months. Just recently stopped working due to some changes "elsewhere".
No clean one-liner XAML? :-P
I'm adding some sample xaml to the blink thing
@Veksi sample
I notice the blink is an old version, I have another that lets you set what property to blink
For a border:
<Border local:Blink.When="True"
        local:Blink.From="Aqua"
        local:Blink.To="Yellow"
        local:Blink.Property="{x:Static Border.StrokeBrushProperty}"/>
gonna look for it, if not exercise for the reader
1
Q: WPF 2D in 3D view Animations : Performance issue

Mitra MI've put a TextBlock in a 3D panel (Planerator) and I used a Storyboard to animate it. (as crawl text) When the field of view is 1 everything works fine, But if I set the field of view to more than 5 the frame rate will drop sharply. ُُI used theCompositionTarget.rendering. Please see the foll...

@JohanLarsson Thanks. You are the man of last resorts! :D
Naturally I provide the credits to you if I end up using this. Which I may do, since if I need to take drastic measures and do rewriting with regard to this, you have the five litre XAML brain. :-P
12:07
@fredo this is the kata.
Make it using only xaml
Ask if you get stuck
@Veksi don't worry about it
@JohanLarsson Are you from Sweden? That's so nice :)
yes I'm from sweden
@JohanLarsson Credits to whom they belong to. :)
@fredoverflow It will be a good exercise for learning layout in wpf.
We will do a binding kata after that
12:31
Hmm. If, when profiling my app, I see that 51% of execution time takes place in
System.Windows.Application.Run(), this probably means my bindings are slow and messed up, huh?
Not sure
You can filter out all broken bindings in snoop btw
I'm not talking about broken bindings, necessarily.
I've filtered out most UI Virtualization problems where a lot of time was spent dozens of items that aren't even seen on-screen.
But I still have a lot of rendering that happens on app startup, causing the login to take 10-20 seconds, because we instantiate all the views and viewmodels in advance.
12:58
Is there a way to offload loading vms to a background thread?
I do that in our app and it cut startup time a lot
@JohanLarsson Depends on what the VMs construction does.
yes but could be worth looking into
If it contacts services and fetchs data, probably. If it initializes ObservableCollections, that has to be on the UI thread.
Ah, you're asking about my cases?
Yes, we already try to reduce logic in VMs as much as possible to avoid that bottleneck.
Not sure about ObservableCollections think they only needs to be updated on dispatcher once bound
No, creation too. I checked. :)
I've started implementing data virtualization as well, paging, to avoid fetching too many items and creating VMs for them, even if UI virtualization prevents actual rendering.
13:07
But I don't usually bind to raw observable collections
Have written a thing that handles dispatching of the collection changed event
Isn't that an abstraction on top of an abstraction? Observable collections are already far from 'raw'.
yes
public class ViewModel
{
    public ViewModel()
    {
        var ints = new ObservableCollection<int>();
        IntsView = ints.AsDispatchingView();
    }

    public IObservableCollection<int> IntsView { get; }
}
looks like ^ (pseudo)
then the raw collection can be updated from other threads
Is in this package but I think there is a bug in the last version
Must add UI-tests for it
Snoop... Doesn't Live Visual Tree (blogs.msdn.microsoft.com/visualstudio/2015/02/24/…) visualization show them.
I suppose not, hmm...
@JohanLarsson We had a similar construction in a previous project - an ObservableList<T> that held two internal synchronized collections - a threadsafe List<T> and an ObservableCollection<T>, allowing it to be bound to like an ObservableCollection, but can accept Add/Remove requests from any thread.
yeah
I'm not very happy with my current implementation
13:16
I'm always so frustrated with the huge gaps that WPF-MVVM leave out.
yeah, would be nice if controls reacted to colchanged like propchanged
manipulating collections concurrently is another problem
Just confirmed that you can create the oc on any thread
Was pretty sure but not sure enough to write it here :)
I can push the repo if you want to have a look
Hi, I have a grid with a lot of columns in XAML, and it's really messy in the code (just 17 <ColumnDefinitions/> and then 17 buttons, one in each column), and I was wondering if there is a way to condense it or make all the columns in one line in the xaml code.
because now I have to do the same thing with a lot more buttons
UniformGrid ?
and I don't want literally half the file to be columndefinitions
@franssu That looks like it'll do
alright thanks
13:37
Just using a dispatching OC won't necessarily solve my problems. I'll be able to create my VMs on a background thread, but it will still have to dispatch to the main thread to do its work.
Mm, on the surface Gu.Wpf.Reactive resembles dynamic-data.org.
@AvnerShahar-Kashtan Add a splash screen to wash user's eyes while everything is created in background, that's how we do it.
Of which @JohanLarsson knows too, since he sits on that channel too. :D
Isn't the ObservableCollection adding and removing items solved with the async/await, providing the necessary context for the operation ?
add and remove must happen on the dispatcher if the collection is bound as itemssource
@AvnerShahar-Kashtan what work?
@Veksi The collection stuff is a first write, must clean it up at some point. The commands and the condition stuff is really nice
@Veksi you should always have a tab open for this chat imo :)
14:12
'morning all
good morning Lynn
14:28
morning
14:39
Morning
@JohanLarsson I'm actually of the impression that default await/async always return on the original context (which is why we have to append .ConfigureAwait(false) to make it not marshal back on ui thread) -- is that what you said too in just different words?
I have a List<Customer> which is shown on View A and can be edited (add/remove items with a repository) on View B. Each view has its own ViewModel. When a change to the list is made in ViewModel B, I want ViewModel A to know about it so it can update the list also.
I've been using an event in the repository class (repository singleton instance used by both ViewModels) to notify ViewModel A of the change so it can refresh the list. I've just been introduced to messaging which seems fairly similar but limits the communication to only the ViewModels. Is messaging a better approach?
14:55
@Maverik you are right that await schedules back to the context before the call
I tried to say something else but then maybe I did not understand what NovitchiS said :)
as long we all are on the same page eventually :D
@SeeSharpCode sounds like somebody has been using frameworks for aid :)
Messaging shouldn't technically be limited to viewmodels, you can message from anywhere to anywhere (see stuff like MassTransit / ServiceBus / MessageBus / EasyMQ)
@Maverik I'm actually not using any frameworks. I aimed to avoid them on my first MVVM implementation.
Making the viewmodels share the list might be simpler
Synchronisation is tricky and it just hides the fact that it is shared mutable state
@JohanLarsson Perhaps wrap the list in its own ViewModel and pass it as a child to both parents?
sounds right
15:03
posted on March 09, 2016 by ericlippert

You are atop the west wall of a great canyon, offering a marvelous view of the mighty Frigid River below. Across the canyon, the walls of the White Cliffs join the mighty ramparts of the Flathead Mountains. To the north, … Continue reading →

@JohanLarsson One question I have with that is where to instantiate the list and pass it around. I instantiate my ViewModels in XAML. I'm guessing that would need to move to the code-behind so the parent ViewModel constructors could take the child as a parameter?
I see Eric's still in Zork mode...
He's likely to be eaten by a grue.
@SeeSharpCode I use IoC so for me it is a non-issue. Nontrivial to setup though.
You could use a singleton for a quick-and-dirty fix
@JohanLarsson Meaning the child view model is a singleton? Technically no injection required then.
Yeah, the shared thing a singleton but don't tell @fredoverflow :)
15:11
i dont think its dirty actually. It's a shared state in typical Master / Detail scenario, i think shared viewmodel is appropriate
It is honest about it at least.
Hmmmm, one other hole to plug, perhaps. The list isn't actually updated manually, i.e. not an ObservableCollection. It is just refreshed when the repository tells the ViewModel something has changed. Should I still just use the event raised by the repository and subscribe the child ViewModel list to it now?
when the repository tells the view model something has changed, does the view model not actually make the change?
that change should trigger INPC and be reflected in your UI
is "change" items being added/removed to the list, or is it items themselves being modified?
@Julien The ViewModel makes the change by calling RaisePropertyChanged("Customers")
Removed/added. No items being modified.
i think that should work
but it begs the question why you arent using an OC
15:21
@Julien I really didn't see the point of using an OC. I could manually add/remove items from the OC, or I could call RaisePropertyChanged for both an add/remove which I saw as less code. I didn't see the point of using OC in the latter case since List would act the same way.
you have a list of items and you want collection change events to propagate to the UI
use an OC
you lose nothing and gain everything
it's less code. you dont have to manually track any events
@Julien Perhaps my design is broken further upstream. I'm using a small dataset, so my repository grabs the data from an XML file. When something is added to the list, it calls the repository.Add(Customer). In repository.Add(), it fires RaiseRepositoryChanged which the ViewModel listens to and refreshes the list by calling repository.GetAll().
It's a Brock!
15:27
if you are binding against a list, and then you new your list, your UI element will still be bound to the original list
make sure you doing .Clear and then rebuildling
if you wanted to fix up your design, your add event would pass the new item to the view model, which just adds it to your OC
@Julien My List<Customer> in the ViewModel just has a getter that calls repository.GetAll(Customer). So the RaisePropertyChanged reads everything fresh from the repository.
instead of calling GetAll and rebuilding the whole hting
what you are doing should work fine as long as you trigger INPC
sounds ok from your description
@Julien So you think either approach would work between rebuilding the list vs. replicating the repository event on the OC? I just went with the first option as it seemed like less code.
yes you could do both ways
the better way involves not rebuilding the list completely each time
using an OC
and passing new items from your data repository to your model to your vm
that would be the mvvm style
i find it weird you can F12 from XAML to viewmodel, but the # references that is shown above the property is still 0 if its only used in xaml
15:35
@Julien Ok, so the repository might fire an event like this: RaiseRepositoryChanged(RepositoryEvent.Added/Removed, Customer customer), and then the OC would add/remove based on that?
yup pretty much exactly that
the VM shouldn't have to do any work
past adding/removing to the OC
@Julien Gotcha, thanks for your suggestions! Will definitely think about implementing that instead.
Also keeps my repository.GetAll() from being called except for initialization.
yeah .if you are using small datasets its easy to take that approach and not see the pitfalls
Exactly. This is a starter project, so I want to design it in a way that translates to larger apps.
if you had 1 or more images, and wanted to display them as a stack, something visually appealing
anyone done anything like that
16:19
@JohanLarsson I hope I sometime have something to tell as to why I have hard time keeping WPF chat open besides occasionally at work. :)
16:30
no short version?
16:45
@JohanLarssonIt's a secret still. :)
 
1 hour later…
17:46
@Veksi Are you NSA?
@JohanLarsson On assignment tracking Reed for recruitment. :)
 
1 hour later…
18:59
hahaha
Does a line have direction or is it two points unordered?
line has no direction
vector does
iirc
yeah, I'm leaning towards agreeing
line apis often has startpoint/endpoint though
hey so some labels are not reading the text properly and so the username is blank
username is supposed to be displayed above session stats and truck information
and below the welcome label\
it reads fine in the game log
19:15
@JohanLarsson A few billion dollars market startup, a unicorn with multiple horns. We'll take over the world while others chill and rest. :)
(We hope.)
@Johan Line is typically undirected, but Ray is directed, and segment can be in some implementations
but in the application it disappears and is not shown
and I can't seem to replicate the issue
step 1 : switch the binding for a hard coded label so you can make sure its properly visible
step 2 : look for binding errors in your output pane
step 3 : reproduction
@Johan In practice, it's often nice for line,ray,segment to be implemented almost identically, though - the only real difference is distance calcs and such
there are no binding errors and the label works fine on my system every time
it's not every user that has their name disappear
but I'll set it to a hard code
19:19
so in the getter/setters put logging of what its getting set to
it's not getting set to blank
it reads fine in the logs
Username: jammerxd | Assumed username: jammerxd
(raw json interpretation vs object interpretation)
so you have a variable that 100% has content, bindings that are 100% correct, yet a label that does not show the content
if you have no errors in the output panel, it could mean your label has no data context whatsoever
but you are saying it works sometimes, so that shouldnt be possible
yes
works every time for me
19:21
so something is not 100% correct then hehe
and that's not running in debug mode
that's running in my test environment on the production program that gets sent to everyone else
Different framework version(s)?
ahh, equality testing?
@ReedCopsey We already have a ray,
19:24
for true equality, a line isn't two points
I just threw in equality to remember it
line defined by (0,0), (1,0) should be equal to a line defined by (0,4),(0,-2), for example
The current implementaion of line has a direction property iirc
ie: for equality, you probably need to rework to a line defined as an axis intercept + (positive) direction, or something
then check equality against that
so line is a plane intersecting the xy plane then?
infinite?
19:26
@ReedCopsey I'm not sure
@JohanLarsson More like a line defined as a point on a (known, always constant) plane + a vector
I know that some of the testers are on 4.6 when my app is targeting 4.5.2
I have only ever thougt about line as two points before
theres no framework issue that would make it work sometimes
or rework to y=mx+b form
19:27
it is 100% a pebcak issue
@ReedCopsey that is a ray in sweden :)
@JohanLarsson A ray is (should be) a different beast - a ray has a specific end point and a direction, so it's like a vector with a starting point
but you can use the same (memory) representation for a line, ray, and segment, if you want - its only the interpretation of that which changes
oh, yeah sry read it wrong
ie: all three can be defined as 2 points, point+vector, etc
hi guys. going through Reed Copsey's great tutorial on MVVM
@Alex Feel free to ask questions if you want
linking screenshots doesnt help
^ that
okay....so what could th issue be?
got stuck... can't call new ActionCommand(...)
19:29
could initialization be the problem?
initialization of what?
it underlines it and says "The type or namespace name 'ActionCommand' could not be found"
the object of the ViewModel I am binding to
and it's properties
@Alex That's not in the framework - my sample project (not sure if it's still around) has an implementation, though tere's a better one in a gist in the links here (starred)
you have a label bound to a property.
19:30
@Alex: I'd steal gist.github.com/ReedCopsey/ba11d8d691f27ca2710f if you don't use some framework
i don't see how any other objects matter
you said earlier you are 100% that the property is being set correctly
ohhh! so that's not part of the framework. been pulling my hair out. no wonder it can't find it
according to the log file
it is being set
and the label is properly bound to the object holding the property
i think you should double check your logging
all of that cannot be true
19:32
<Label Content="{Binding Driver.username}" />
@Alex Nope - Framework didn't include any implemetation of that
<Label Content="{Binding Driver.username}> is all that matters
log the gets and sets against Driver.username
@Josh Could "Driver" be messing up somehow?
if a label is displaying nothing, it is still hitting the get and pulling nothing, which you can log
ok. thanks, @ReedCopsey
now back to the tutorial :)
19:33
public string username { get; set; }
yes that is a property
<DockPanel ContextMenu="{StaticResource MyContextMenu}">
    <!--- some stuff --->
    <ListBox />
</DockPanel>
right clicks on my listbox are getting the dockpanel context menu
anyway to prevent that?
could language localization be an issue?
if you have a label bound to a string, and the string has a value, i don't see how localization applies
@Julien does it have a background?
if bg is null hittesting cannot see it
the listbox?
19:40
transparent works
i havent set any backgrounds
worth trying then
background = {Brushes.Transparetnt}
nah not working. doesn't matter, i'll do it differently
{ 2016-03-09 13:38:18,880 } DEBUG [1] (:0) - USERNAME RETRIEVED:
{ 2016-03-09 13:38:18,892 } DEBUG [1] (:0) - USERNAME SET TO: NO USERNAME
{ 2016-03-09 13:38:18,894 } DEBUG [1] (:0) - USERNAME RETRIEVED: NO USERNAME
{ 2016-03-09 13:38:36,812 } DEBUG [1] (:0) - USERNAME RETRIEVED: NO USERNAME
{ 2016-03-09 13:38:36,813 } DEBUG [1] (:0) - USERNAME SET TO: jammerxd
{ 2016-03-09 13:38:36,818 } DEBUG [1] (:0) - USERNAME RETRIEVED: jammerxd
{ 2016-03-09 13:38:36,818 } DEBUG [1] (:0) - USERNAME RETRIEVED: jammerxd
(see full text)
if those debugs aren't coming out of the get/set, it means nothing
19:43
they are
@Julien maybe you need to set ishittestvisible = true + bg transparent
that is taked directly in the getters and setter
im trying to prevent the context menu. isn't that backwards
i think its just bad design anyways to have half an element have a context menu
@JoshMenzel does the class implement INPC?
through fody.proertychanged
you can always add a method to make sure its trigger inpc properly
private void OnusernameChanged(){}
not sure if caps matter, my props are always capitalized
03:00 - 20:0020:00 - 00:00

« first day (1237 days earlier)      last day (2912 days later) »