wpf - Bind to static generic instance of a class -


i use code in views' (which usercontrol) constructors:

this.datacontext = the<chart1viewmodel>.instance; 

where the<> generic static per-type singleton storage needs to implement inotifypropertychanged notify of it's instance replacement.

i xaml code like, how can that? have never before did bind generic static classes.

if can't, how create binding static class' instance property?

as far know you'll have problems using generics in xaml. nevertheless can use static classes. wrapping property around generic this:

<control datacontext="{x:static the.chart1viewmodel.instance}" /> 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -