1
0

ExpanderPageViewModel.cs 690 B

123456789101112131415161718192021222324252627
  1. using Avalonia;
  2. using MiniMvvm;
  3. namespace ControlCatalog.ViewModels
  4. {
  5. public class ExpanderPageViewModel : ViewModelBase
  6. {
  7. private object _cornerRadius = AvaloniaProperty.UnsetValue;
  8. private bool _rounded;
  9. public object CornerRadius
  10. {
  11. get => _cornerRadius;
  12. private set => RaiseAndSetIfChanged(ref _cornerRadius, value);
  13. }
  14. public bool Rounded
  15. {
  16. get => _rounded;
  17. set
  18. {
  19. if (RaiseAndSetIfChanged(ref _rounded, value))
  20. CornerRadius = _rounded ? new CornerRadius(25) : AvaloniaProperty.UnsetValue;
  21. }
  22. }
  23. }
  24. }