Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. public class CustomField
  2. {
  3. [JsonProperty("uid")]
  4. public Guid uid { get; set; }
  5.  
  6. [JsonProperty("name")]
  7. public string name { get; set; }
  8.  
  9. [JsonProperty("type")]
  10. public CustomFieldType type { get; set; }
  11. }
  12. public enum CustomFieldType
  13. {
  14. TEXT = 0,
  15. MULTI_LINE = 1,
  16. DATETIME = 2,
  17. ...
  18. }
  19.  
  20. public class CustomFieldValue
  21. {
  22. [JsonProperty("uid")]
  23. public Guid uid { get; set; }
  24.  
  25. [JsonProperty("type")]
  26. public CustomFieldType type { get; set; }
  27.  
  28. [JsonProperty("textValue")]
  29. public string textValue { get; set; }
  30.  
  31. [JsonProperty("dateValue")]
  32. public DateTime dateValue { get; set; }
  33. ...
  34. }
  35.  
  36. public class BaseModel
  37. {
  38. [JsonProperty("uid")]
  39. public Guid uid { get; set; }
  40.  
  41. [JsonProperty("name")]
  42. public string name { get; set; }
  43.  
  44. [JsonProperty("description")]
  45. public string description { get; set; }
  46. ...
  47.  
  48. [JsonProperty("customFieldValues")]
  49. public List<CustomFieldValue> customFieldValues { get; set; }
  50. }
  51.  
  52. public class ViewModel : brmViewModelBase
  53. {
  54. BaseModel cModel;
  55. ...
  56. public string name
  57. {
  58. get
  59. {
  60. if (isLoaded)
  61. return Model.name;
  62. else
  63. return "";
  64. }
  65. set
  66. {
  67. if (Model.name != value)
  68. {
  69. Model.name = value;
  70. OnPropertyChanged();
  71. isModified = true;
  72. }
  73. }
  74. }
  75. ...
  76. public BaseModel Model
  77. {
  78. get
  79. {
  80. return cModel;
  81. }
  82. set
  83. {
  84. cModel = value;
  85. OnPropertyChanged();
  86. OnPropertyChanged(nameof(name));
  87. ...
  88. }
  89. }
  90. }
  91.  
  92. <TextBox x:Name="txtName"
  93. Text="{x:Bind ViewModel.name, Mode=TwoWay}"
  94. Style="{StaticResource entryDefault}"
  95. Header= "Name*"
  96. PlaceholderText="Enter Name"
  97. Margin="0,10,0,0"
  98. Width="800"
  99. HorizontalAlignment="Left"/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement