An open API service indexing awesome lists of open source software.

https://github.com/kanryu/caliburnapp1

A MVVM sample app for UWP with Caliburn.Micro
https://github.com/kanryu/caliburnapp1

Last synced: over 1 year ago
JSON representation

A MVVM sample app for UWP with Caliburn.Micro

Awesome Lists containing this project

README

          

# CaliburnApp1

A MVVM sample app for UWP with Caliburn.Micro

This project for a question for the issue.

https://github.com/Caliburn-Micro/Caliburn.Micro/issues/520

## The problem of Caliburn.Micro this sample reveals

![Execution result of this application](DemoRunning.png)

- Properties of ViewModel(especialy, DayEnable) can not be referenced through a DataContext object
- So there is no way to refer to the ViewModel of the page from the descendant of the tag with the ItemsSource attribute
- In particular it is a serious problem that RelativeSource can not be used from the Page's own context

PageView.xaml:



























PageViewModel.cs:

public class BodyViewModel
{
public bool BodyEnable { get; set; } = true;
}
public class PageViewModel : Screen
{
public bool DayEnable { get; set; } = true;
public ObservableCollection BodiesModel { get; set; }

private readonly INavigationService navigationService;
public PageViewModel(INavigationService navigationService)
{
this.navigationService = navigationService;

BodiesModel = new ObservableCollection() {
new BodyViewModel()
};

NotifyOfPropertyChange(() => DayEnable);
NotifyOfPropertyChange(() => BodiesModel);

}
}

## Author

KATO Kanryu

## License

MIT