Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class MainViewModel : ViewModelBase
- {
- [ObservableProperty] private string? _loggedInUserName;
- [ObservableProperty] private DocumentViewModel _selectedDocument;
- [ObservableProperty]
- private ObservableCollection<DocumentViewModel> _documents = new()
- {
- new DocumentViewModel()
- {
- Title = "Product 1",
- Pages = new()
- {
- new DocumentPageViewModel() { Title = "Description", Content = "Text Editor here" },
- new DocumentPageViewModel() { Title = "Pillars", Content = "Text Editor here" },
- new DocumentPageViewModel() { Title = "TargetPlatforms", Content = "Text Editor here" },
- new DocumentPageViewModel() { Title = "Schedule", Content = "Text Editor here" },
- },
- },
- new DocumentViewModel()
- {
- Title = "Product 2",
- Pages = new()
- {
- new DocumentPageViewModel() { Title = "Description", Content = "Text Editor here" },
- new DocumentPageViewModel() { Title = "Pillars", Content = "Text Editor here" },
- new DocumentPageViewModel() { Title = "TargetPlatforms", Content = "Text Editor here" },
- new DocumentPageViewModel() { Title = "Schedule", Content = "Text Editor here" },
- new DocumentPageViewModel() { Title = "Camera and Controls", Content = "Text Editor here" },
- new DocumentPageViewModel() { Title = "Player Character", Content = "Text Editor here" },
- new DocumentPageViewModel() { Title = "Building and Construction", Content = "Text Editor here" },
- new DocumentPageViewModel() { Title = "Equipment", Content = "Text Editor here" },
- }
- },
- };
- public MainViewModel()
- {
- SelectedDocument = Documents.First();
- Messenger.Register<UserLoggedInMessage>(this, UserLoggedIn);
- }
- [RelayCommand] public async Task Logout()
- {
- await Task.Delay(50);
- Messenger.Send(new UserLoggedOutMessage());
- }
- private void UserLoggedIn(object recipient, UserLoggedInMessage message)
- {
- LoggedInUserName = message.UserName;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement