I have a calculated property on my View that I need to bind to my ViewModel. I’m using WPF and it seems that there is no way to make a bindable property (Dependency Property) that is self calculating. I don’t want to perform the calculations whenever the View’s state changes because they are time intensive. I want to do the calculations whenever the ViewModel needs the result, i.e. when it closes.
Share
Based on your comment above, I’d use a
ConverterYour ViewModel would contain the encrypted data, and the binding to the View uses a Converter which converts it into something readable. When it’s time to save the data back to the ViewModel, use the
ConvertBackmethod of the converter to encrypt the data again.If the Encryption code takes a while, set your
UpdateSourceTrigger=Explicitand manually trigger the source update when the Save button is clicked.