DocumentManager Not sorted

Ribbon for WPF Forum

Posted 15 years ago by Eli Gazit - CEO, Softwear Suit Ltd
Version: 9.1.0501
Avatar
Hi,

I have am using the Document Manager though I have no use for the URI property.
I am using the Tag property to store the document unique Guid used to re-open the document.
Every time I update the LastOpenedDateTime the list is not being re sorted according to the last opened date time. is there a way to resolve this? am I doing something wrong?

On that note, why isn't there a way to get a reference using the Tag property rather than the uri?

here is my code:

RecentDocumentManager manager = MainWindow.Instance.recentDocManager;
            
manager.Documents.BeginUpdate();
DateTime dateTime = DateTime.Now;
Guid guid = dock.Graph.First.UniqueKey;
string label = dock.Graph.First.Label;
bool exists = false;
foreach (DocumentReference current in manager.Documents)
{
                if (guid.ToString().Equals(current.Tag.ToString(), 
                    StringComparison.OrdinalIgnoreCase))
                {                    
                    //manager.NotifyDocumentOpened(null, label, guid);
                    current.LastOpenedDateTime = dateTime;
                    exists = true;
                    break;
                }
            }
            if (!exists)
            {
                DocumentReference docRef = new DocumentReference();                
                docRef.Name = label;
                docRef.Tag = guid;
                docRef.LastOpenedDateTime = dateTime;
                manager.Documents.Add(docRef);
            }            
            manager.Documents.EndUpdate();

Comments (3)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Eli,

The documentation topic "Document Manager" talks about the RebindFilteredDocuments that you need to call if a last-opened date/time is changed so that it knows to resort the list. Try that and it should work.


Actipro Software Support

Posted 15 years ago by Eli Gazit - CEO, Softwear Suit Ltd
Avatar
Cool thanks, where can I find the documentation.
I usually search the forum for related issues but couldn't find one.
I looked at the sample code before posting and copied the code from there.
Is there an online repository for documentation?
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Eli,

The documentation is installed on your machine when you install the product. Go to your Windows Programs menu, find the Actipro Software group, then WPF Studio within that, and you'll see a link to the documentation.

We don't publish it online.


Actipro Software Support

The latest build of this product (v24.1.1) was released 22 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.