Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 18 11:44

    delete-merged-branch[bot] on nuget

    (compare)

  • Jan 18 11:44

    GeertvanHorrik on develop

    Bump Moq from 4.15.2 to 4.16.0 … Merge pull request #1743 from C… (compare)

  • Jan 18 11:44
    GeertvanHorrik closed #1743
  • Jan 18 09:31
    dependabot-preview[bot] labeled #1743
  • Jan 18 09:31
    dependabot-preview[bot] opened #1743
  • Jan 18 09:31

    dependabot-preview[bot] on nuget

    Bump Moq from 4.15.2 to 4.16.0 … (compare)

  • Jan 13 18:35
    GeertvanHorrik commented #1741
  • Jan 13 18:32
    GeertvanHorrik commented #1741
  • Jan 13 14:42
    gofrogi commented #1741
  • Jan 13 14:42
    gofrogi commented #1741
  • Jan 13 14:37
    GeertvanHorrik commented #1741
  • Jan 13 14:37
    GeertvanHorrik commented #1741
  • Jan 13 14:35

    delete-merged-branch[bot] on 20210113-143511

    (compare)

  • Jan 13 14:35

    GeertvanHorrik on develop

    GitHubSync update Merge pull request #1742 from C… (compare)

  • Jan 13 14:35
    GeertvanHorrik closed #1742
  • Jan 13 14:35
    GeertvanHorrik opened #1742
  • Jan 13 14:35

    GeertvanHorrik on 20210113-143511

    GitHubSync update (compare)

  • Jan 13 14:31
    gofrogi edited #1741
  • Jan 13 14:24
    gofrogi opened #1741
  • Jan 13 14:12

    delete-merged-branch[bot] on 20210113-141154

    (compare)

Ghost
@ghost~5da242acd73408ce4fcdaa63
Anyone have any insights on why objects present within an FastObservableCollection (that are based off ValidatableModelBase) are not getting garbage collected? The collections do not have events attached to them but if I null out the property it will GC the objects in the collection (sometimes).
Geert van Horrik
@GeertvanHorrik
Are they bound to VM's in any way? The collection and change wrapper could be subscribing here, but it should all be weak events.
And are you using .NET Core? It has a slightly different way of GC (we had to fix all the unit tests since we cannot rely on objects being collected by GC.Collect)
Ghost
@ghost~5da242acd73408ce4fcdaa63
Full .NET Framwork (would love to move to Core but there are blockers preventing this). These are basically collections bound to the ItemsSource dependency property of a RadGridView.
I have the feeling it may be the way I’m handling instantiation and population however.
Geert van Horrik
@GeertvanHorrik
There is no other object referencing this object? And it only happens in FastObservableCollection?
Just checked the code for FOC, don't see any subscriptions there. Maybe it's the RAD grid subscribing to property changed of the objects inside collection?
Ghost
@ghost~5da242acd73408ce4fcdaa63
That’s the issue, I cannot seem to track down the root culprit and dotMemory is not showing anything that pops out. My only other route I have left to try is changing how the collection is instantiated and populated.
Geert van Horrik
@GeertvanHorrik

weird, I would expect dotMemory to show some sort of relation, even if it's via an event subscription.

Just a few double checks

  1. Is the collection cleared (are items removed from the list)?
  2. Is the collection no longer part of a VM?
  3. Is the VM closed / no longer attached to a view?
Ghost
@ghost~5da242acd73408ce4fcdaa63
Yeah so would I but it hasn't been rather forthcoming. But as an example:
  1. I have a ViewModel for the sake of this example called GridViewModel<TDomainModel>
  2. The ViewModel has a member property called Rows which is a FastObservableCollection<TDomainModel>
  3. Rows is an inline initialization -- public FastObservableCollection<TDomainModel> Rows { get; } = new FastObservableCollection<TDomainModel>
  4. Items are retrieved from an external source and added to Rows in InitializeAsync via AddItems
  5. The property Rows is cleared during OnClosingAsync()
  6. dotMemory shows that all the objects within Rows survived the closing and disposing of the ViewModel along with their ValidationContext
Geert van Horrik
@GeertvanHorrik
4 sounds alarm bells in my head
are you sure the external sourec is not holding it somehow?
Ghost
@ghost~5da242acd73408ce4fcdaa63
So 4 would be a manager class that handles mediation between the VM and the DAL. It basically does the query to the DB and converts the entity model to a domain model. You may be right though I should probably have the ViewModel discard the property that holds the manager class on dispose
I'll try that out on Monday and see what happens
Ghost
@ghost~5da242acd73408ce4fcdaa63
@GeertvanHorrik so I tried that, looks like something is still holding onto the object though
Geert van Horrik
@GeertvanHorrik
hmmm, will give it a thought, about to turn off the pc for the night. Let's discuss on Monday to see if we can come up with something
Ghost
@ghost~5da242acd73408ce4fcdaa63
Until then, here's a snapshot from dotMemory: https://i.imgur.com/ryXC0Dx.png
thanks for the input though
Geert van Horrik
@GeertvanHorrik
it's not the virtualization of the RadGrid?
Can you try a different grid (just the default one)?
Ghost
@ghost~5da242acd73408ce4fcdaa63
virtualization is not on for that particular grid (it doesn't get big enough)
It's most likely a behavioral issue with Telerik. I'll dig more on Monday.
Ghost
@ghost~5da242acd73408ce4fcdaa63
@GeertvanHorrik Just an FYI when you read this next, I found the ultimate issue. The ViewModels in question were not having their dispose methods called due to an implementation that got missed. So we're all good
Geert van Horrik
@GeertvanHorrik
Nice, glad you solved it, thanks for the update
Ghost
@ghost~5da242acd73408ce4fcdaa63
@GeertvanHorrik What are your thoughts on possibly creating an FastObservableItemCollection that inherits off FastObservableCollection but exposes an ItemChanged event? I'm pondering implementing one to throw out some rx.net extension methods that are being used
Geert van Horrik
@GeertvanHorrik
ItemChanged as in a property of an item in the collection has changed?
Ghost
@ghost~5da242acd73408ce4fcdaa63
yes
for the cases where the object within the collection is also observable
Geert van Horrik
@GeertvanHorrik
can you wrap the collection in the wrapper that is already there? I always forget the naem
ChangeNotificationWrapper or something like that
Ghost
@ghost~5da242acd73408ce4fcdaa63
Oh right you have that wrapper
I forgot about that
Geert van Horrik
@GeertvanHorrik
not sure though how it behaves in combination with the FOC
Ghost
@ghost~5da242acd73408ce4fcdaa63
I'd probably not use the CollectionChanged event within it but CollectionItemPropertyChanged is what I actually need so this eliminates an extension method that has a lot of boiler plate
rfuzzo
@rfuzzo

Hello! I have a question about MVVM patterns and ribbons in Catel+Orchestra+Fluent.
I want to have my ribbonView to have its own viewmodel, as does the mainview orchestra uses.

  • I'm using ApplicationCommandContainers as much as possible for the ribbon, which works great. so far so good
  • but there are instances where the RibbonViewModel should have access to the MainViewModel (contextual tabs e.g., commands targeting the mainViewModel e.g.)
  • what is the intended pattern here? is it possible to resolve a MainViewModel reference with dependency injection? (I haven't found an example for that yet).
  • the documentation here doesn't quite fit I think, since I'm not talking models really: https://catelproject.atlassian.net/wiki/spaces/CTL/pages/1409119/Introduction+to+the+nested+user+controls+problem

thank you in advance!

Geert van Horrik
@GeertvanHorrik
It's better not to directly rely on other vm's to be alive. To share data / state, it's best to use services (long-living objects where vm's are short living objects)
if you need commands to be existing on other vms, it's best to register a ComposeCommand. In the main vm, you can Add an action to that composite VM and unregister it when the vm gets closed. This way, the command is a long-living object (always available), but vms can subscribe to it. A great example is Refresh, where you have 1 Refresh command, and each VM that has refresh capabilities can add an action to this composite command.
rfuzzo
@rfuzzo

hmm thank you! yes, the service approach is definitely better. (and thanks, I'll have a look at ComposeCommands as well! )
I just had a look at the CsvTextEditor where a lot of the action also happens in the IProjectManager and Command containers - this is probably worth looking into)

my questions comes from trying to implement Dirkster99.AvalonDock+Mlib theming in the Orc+Fluent app. not as easy as I had thought :D
they had a ThemeViewModel inside the MainViewModel. I should probably move the themeing into a Service tho...

anyways. thanks for the quick reply!
Geert van Horrik
@GeertvanHorrik
You might want to look into Orc.Theming for tehming
rfuzzo
@rfuzzo
ohh thank you! that might be the better approach...
Ghost
@ghost~5da242acd73408ce4fcdaa63
@GeertvanHorrik I didn't want to piggy back this onto the issue comments but just as another curve ball it appears there is an ongoing effort to introduce an MVVM framework within the Windows Community Toolkit so I'm not sure what that will result in
Geert van Horrik
@GeertvanHorrik
Yes, I've seen. It looks like a MVVMLight clone, which works great for a lot of people.
We are not interested in doing a rewrite of our components at any stage. If we would do a rewrite, it would be non-windows (web / blazor). It seems Microsoft can't get their head straight around their XAML technology.
Ghost
@ghost~5da242acd73408ce4fcdaa63
I don't think they will, even Avalon seems a mess
Geert van Horrik
@GeertvanHorrik
I think Avalon is non-msft?
Ghost
@ghost~5da242acd73408ce4fcdaa63
Is it? I've only had minor exposure to it and wasn't keen on it and I also think that XAML Standard also went no where
Geert van Horrik
@GeertvanHorrik
I believe the codename for WPF was Avalon, and some non-msft did a great attempt to make wpf cross-platform (which is amazing what they have accomplished with which I believe is a small team compared to MSFT with nearly unlimited budgets)
Ghost
@ghost~5da242acd73408ce4fcdaa63
Ah it looks like it's just part of the .NET Foundation so yeah it's non-MSFT but has some recognition
Geert van Horrik
@GeertvanHorrik
btw we have enabled github discussions in Catel so we can keep everything on GitHub now