void InitBindings() { mvvmContext1.RegisterService(DialogService.CreateXtraDialogService(this, "Details")); mvvmContext1.RegisterService(DispatcherService.Create()); var mvvm = mvvmContext1.OfType <TrackListViewModel>(); mvvm.SetBinding(gridView1, x => x.LoadingPanelVisible, x => x.IsLoading); mvvm.WithEvent <EventArgs>(this, "Load").EventToCommand(x => x.LoadTracks()); mvvm.WithEvent <ColumnView, FocusedRowObjectChangedEventArgs>(gridView1, "FocusedRowObjectChanged") .SetBinding(x => x.CurrentItem, args => args.Row as TrackViewModel, (gView, track) => gView.FocusedRowHandle = gView.FindRow(track)); mvvm.WithEvent <RowClickEventArgs>(gridView1, "RowClick") .EventToCommand( x => x.EditItem(null), x => x.CurrentItem, args => (args.Clicks == 2) && (args.Button == MouseButtons.Left)); mvvmContext1.RegisterService(new CustomReportService(gridView1)); mvvm.BindCommand(barButtonItem1, x => x.ShowReport()); mvvm.SetBinding(repositoryItemLookUpEditAlbum, e => e.DataSource, x => x.CurrentItem.AlbumLookupData); }
void InitializeBindings() { mvvmContext.RegisterDefaultService(DialogService.CreateXtraDialogService(this)); var fluent = mvvmContext.OfType <DocumentsViewModel>(); mvvmContext.RegisterDefaultService(DocumentManagerService.Create(navigationFrame)); fluent.WithEvent(this, "Load") .EventToCommand(x => x.LoadDefaultDocument()); }