Reputation: 443
I have created my own custom property in app.xaml.cs file I require to access this property in one of my viewmodel. When i try to access via Application object it does not show up. Can anyone help me with this.
Regards
Upvotes: 5
Views: 6925
Reputation: 5605
Use Application.Current
to access custom property you have crated.
var currentApp = Application.Current as App;
currentApp.YourPropertyName = "WhateverYouWant";
Read this article on MSDN with example on how to do it.
Upvotes: 16