© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
19 replies
Daltz333

❔ Do static two way bindings leak XAML?

To summarize, does the following leak the
ContentPage
ContentPage
here:
<ContentPage>
  <Label Text="{Binding Source={x:Static mySingleTon.Instance}, Path=myproperty}"/>
</ContentPage>
<ContentPage>
  <Label Text="{Binding Source={x:Static mySingleTon.Instance}, Path=myproperty}"/>
</ContentPage>


If so, would this be an appropriate replacement, or the same issue?
public partial class MyViewModel : ObservableObject {
  [ObservableProperty]
  public MyObject ObjectA {
    get => return mySingleton.Instance.myproperty;
  }
}
public partial class MyViewModel : ObservableObject {
  [ObservableProperty]
  public MyObject ObjectA {
    get => return mySingleton.Instance.myproperty;
  }
}


Replacement paradigms would be useful.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Do static classes leak memory?
C#CC# / help
3y ago
✅ xaml
C#CC# / help
9mo ago
❔ XAML
C#CC# / help
3y ago