Control states persistency
We're currently looking into a solution to automatically persist (serialize) control states (dependency properties) for dialogs. For example we want some controls on a dialog to resume their states (size, expanded state, ListView's column width etc) when reopening the dialog. The generic requirements are:
- The solution should provide a way to markup persistable control properties
- It should be extensible to all dialogs (no specific serialization codes for each dialog)
- The serialization should be done automatically (e.g. automatic serialize/deserialize on dialog closing/loading)
- It uses UIElement.PersisId property which is marked obsolete in WPF
- It utilizes logical tree path to generate a unique Id, but some control elements may not appear in logical tree (e.g. GridViewColumn)
-
-
sfernandez
Site Admin
- Posts: 2866
- Joined:
Re: Control states persistency
The solution exposed in that article (using a MarkupExtension) looks quite good to me and can be easily implemented in Noesis.
The lack of the PersistId doesn't seem blocking as WPF implemented it just as an auto-increment counter that you can handle in the markup extension itself.
I recommend implementing that approach. If you find any trouble please let us know and we will help.
The lack of the PersistId doesn't seem blocking as WPF implemented it just as an auto-increment counter that you can handle in the markup extension itself.
I recommend implementing that approach. If you find any trouble please let us know and we will help.
Re: Control states persistency
@sfernandez Thank you fro the reply.
I have no idea why Microsoft marked PersistId as obsolete. If it's safe and easy to implement then I think it will be nice to have it as part of Noesis framework.
Do you have a suggestion on how to deal with GridViewColumn?
I have no idea why Microsoft marked PersistId as obsolete. If it's safe and easy to implement then I think it will be nice to have it as part of Noesis framework.
Do you have a suggestion on how to deal with GridViewColumn?
-
-
sfernandez
Site Admin
- Posts: 2866
- Joined:
Re: Control states persistency
Could you please add the PersistId request to our bugtracker?
For the GridViewColumn you can use Noesis::FindTreeElement() to find the FrameworkElement ancestor holding the column definition.
For the GridViewColumn you can use Noesis::FindTreeElement() to find the FrameworkElement ancestor holding the column definition.
Re: Control states persistency
I've added this issue to your bugtracker.
We will try your suggestion on GridViewColumn. Thank you.
We will try your suggestion on GridViewColumn. Thank you.
Who is online
Users browsing this forum: Bing [Bot] and 2 guests