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
- Host: GitHub
- URL: https://github.com/kanryu/caliburnapp1
- Owner: kanryu
- License: mit
- Created: 2018-04-15T10:03:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-15T14:47:48.000Z (about 8 years ago)
- Last Synced: 2025-02-10T03:26:50.210Z (over 1 year ago)
- Language: C#
- Homepage:
- Size: 92.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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

- 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