ItemViewModel.cs 567 B

12345678910111213141516171819202122
  1. // Copyright (c) The Avalonia Project. All rights reserved.
  2. // Licensed under the MIT license. See licence.md file in the project root for full license information.
  3. using System;
  4. using ReactiveUI;
  5. namespace VirtualizationTest.ViewModels
  6. {
  7. internal class ItemViewModel : ReactiveObject
  8. {
  9. private string _prefix;
  10. private int _index;
  11. public ItemViewModel(int index, string prefix = "Item")
  12. {
  13. _prefix = prefix;
  14. _index = index;
  15. }
  16. public string Header => $"{_prefix} {_index}";
  17. }
  18. }