ClientUI MVVM Data Application template (reusable code, Grouping, Copy/Paste)

3 replies. Last post: September 28, 2011 2:46 AM by Handy Surya
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hi

1. Silverlight class library
Today I've worked with ClientUI MVVM Data Application template. The structure of the generic base classes is great! The only downer is that partly text messages (e.g. MessagePresenter) are hard coded!

Unfortunately it is not possible (I did not manage) to move the dictionaries ModelServices.Infrastructure and ViewModels.Infrastructure in a Silverlight class library. In the Silverlight Class Library, I can not reference the assembly Intersoft.Client.Data.ComponentModel. Is there another way to increase the reusability?

Is probably a mistake in MessagePresenter.cs:

public void AskYesOrNo(string question, Action yesAction, Action noAction)
{
    MessageBoxServiceProvider.Show(
        "Are you sure you want to delete the selected contact?",
        "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question,

        dialogResult =>
        {
            if (dialogResult == DialogResult.Yes)
            {
                if (yesAction != null)
                    yesAction();
            }
            else
            {
                if (noAction != null)
                    noAction();
            }
        });
}

better is:

MessageBoxServiceProvider.Show(question,"Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question,

 

2. Gouping
The products page is grouped by CategoryID. If I delete the following code ...

<Intersoft:UXGridView.GroupDescriptors>

<Intersoft:UXGridViewGroupDescriptor PropertyName="CategoryID"/>

</Intersoft:UXGridView.GroupDescriptors>

... then I get the error message: The method 'OrderBy' must be called before the method 'Skip'. So I inserted the following code...

<Intersoft:UXGridView.SortDescriptions>

<ComponentModel:SortDescription PropertyName="RegionID" Direction="Ascending"/>

</Intersoft:UXGridView.SortDescriptions>

...I still get the same error message. Order by is still missing in URL:
http://localhost:20316/ClientBin/ClientUIDataAppWithPic-Web-NorthwindDomainService.svc/binary/GetRegions?$skip=0&$take=20&$includeTotalCount=True

It works, if I add the SortDescriptor in constructor. If this is the only way?

public RegionsViewModel() :

base()

{

this.QueryDescriptor.SortDescriptors.Add(new SortDescriptor() { PropertyName = "RegionID", Direction = ListSortDirection.Descending });

}

 

3. Copy/Paste
Using the context menu, I can copy rows in UXGridView. How can I paste the copied row again?

 

Thanks for help.

Regads Michael

All times are GMT -5. The time now is 12:08 AM.
Previous Next