RequisitionEditDetailsView.xaml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <local:RequisitionEditView xmlns="http://xamarin.com/schemas/2014/forms"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  4. xmlns:local="clr-namespace:PRS.Mobile;assembly=PRS.Mobile"
  5. xmlns:mobile="clr-namespace:InABox.Mobile;assembly=InABox.Mobile.Shared"
  6. xmlns:views="http://xamarin.com/schemas/2020/toolkit"
  7. x:Class="PRS.Mobile.RequisitionEditDetailsView"
  8. x:DataType="local:RequisitionEditViewModel">
  9. <local:RequisitionEditView.Resources>
  10. <mobile:BooleanToColorConverter x:Key="EditorBackgroundConverter" TrueColor="LightYellow" FalseColor="Silver"/>
  11. <mobile:BooleanToColorConverter x:Key="EditorForegroundConverter" TrueColor="Black" FalseColor="Gray"/>
  12. <mobile:BooleanToBooleanConverter x:Key="HideElementConverter" Invert="True"/>
  13. <mobile:StringWithDefaultValueConverter x:Key="JobNameConverter" Default="(Select Job)" />
  14. <mobile:StringWithDefaultValueConverter x:Key="RequestedByConverter" Default="(Select Employee)" />
  15. <mobile:StringWithDefaultValueConverter x:Key="DestinationConverter" Default="(Select Method)" />
  16. </local:RequisitionEditView.Resources>
  17. <local:RequisitionEditView.Content>
  18. <views:DockLayout LastChildFill="True">
  19. <Label
  20. views:DockLayout.Dock="Top"
  21. Text="Subject"
  22. VerticalOptions="Fill"
  23. VerticalTextAlignment="Center"
  24. FontSize="Small"
  25. TextColor="Black"/>
  26. <Frame
  27. views:DockLayout.Dock="Top"
  28. HasShadow="False"
  29. CornerRadius="5"
  30. Padding="0"
  31. Margin="0,5,0,0"
  32. HeightRequest="45"
  33. BorderColor="Gray"
  34. BackgroundColor="{Binding IsMine, Converter={StaticResource EditorBackgroundConverter}}">
  35. <mobile:MobileEntry
  36. x:Name="Subject"
  37. Margin="5,0"
  38. Text="{Binding Item.Title}"
  39. TextChanged="Subject_OnTextChanged"
  40. Focused="Subject_OnFocused"
  41. Unfocused="Subject_OnUnfocused"
  42. BackgroundColor="Transparent"
  43. TextColor="{Binding IsMine, Converter={StaticResource EditorForegroundConverter}}"
  44. IsEnabled="{Binding IsMine}"/>
  45. </Frame>
  46. <Label
  47. views:DockLayout.Dock="Top"
  48. Text="Request"
  49. FontSize="Small"
  50. TextColor="Black"
  51. Margin="0,5,0,0"/>
  52. <mobile:MobileButton
  53. views:DockLayout.Dock="Bottom"
  54. Text="{Binding Item.DestinationDescription, Converter={StaticResource DestinationConverter}}"
  55. Clicked="Destination_Clicked"
  56. Margin="0,5,0,0"
  57. HeightRequest="40"
  58. IsEnabled="{Binding IsMine}"
  59. IsVisible="{Binding HideElements, Converter={StaticResource HideElementConverter}}"/>
  60. <Label
  61. views:DockLayout.Dock="Bottom"
  62. Text="Delivery Method"
  63. VerticalOptions="Center"
  64. HorizontalOptions="Start"
  65. FontSize="Small"
  66. TextColor="Black"
  67. Margin="0,5,0,0"
  68. IsVisible="{Binding HideElements, Converter={StaticResource HideElementConverter}}"/>
  69. <mobile:MobileDateButton
  70. views:DockLayout.Dock="Bottom"
  71. Date="{Binding Item.Due, Mode=TwoWay}"
  72. Changed="Due_OnChanged"
  73. Margin="0,5,0,0"
  74. HeightRequest="40"
  75. IsEnabled="{Binding IsMine}"
  76. IsVisible="{Binding HideElements, Converter={StaticResource HideElementConverter}}"/>
  77. <Label
  78. views:DockLayout.Dock="Bottom"
  79. Text="Items Required by"
  80. VerticalOptions="Center"
  81. HorizontalOptions="Start"
  82. FontSize="Small"
  83. TextColor="Black"
  84. Margin="0,5,0,0"
  85. IsVisible="{Binding HideElements, Converter={StaticResource HideElementConverter}}" />
  86. <mobile:MobileButton
  87. views:DockLayout.Dock="Bottom"
  88. Text="{Binding Item.RequestedByName, Converter={StaticResource RequestedByConverter}}"
  89. Clicked="RequestedBy_Clicked"
  90. Margin="0,5,0,0"
  91. IsEnabled="False"
  92. IsVisible="{Binding HideElements, Converter={StaticResource HideElementConverter}}"/>
  93. <Label
  94. views:DockLayout.Dock="Bottom"
  95. Text="Requested By"
  96. VerticalOptions="Center"
  97. HorizontalOptions="Start"
  98. FontSize="Small"
  99. TextColor="Black"
  100. IsEnabled = "False"
  101. Margin="0,5,0,0"
  102. IsVisible="{Binding HideElements, Converter={StaticResource HideElementConverter}}" />
  103. <mobile:MobileButton
  104. views:DockLayout.Dock="Bottom"
  105. x:Name="Job"
  106. Text="{Binding Item.JobDisplay, Converter={StaticResource JobNameConverter}}"
  107. Clicked="SelectJob_Clicked"
  108. Margin="0,5,0,0"
  109. IsEnabled="{Binding IsMine}"
  110. IsVisible="{Binding HideElements, Converter={StaticResource HideElementConverter}}"/>
  111. <Label
  112. views:DockLayout.Dock="Bottom"
  113. Text="Job"
  114. VerticalOptions="Fill"
  115. VerticalTextAlignment="Center"
  116. FontSize="Small"
  117. TextColor="Black"
  118. Margin="0,5,0,0"
  119. IsVisible="{Binding HideElements, Converter={StaticResource HideElementConverter}}"/>
  120. <Frame
  121. views:DockLayout.Dock="Top"
  122. CornerRadius="5"
  123. BorderColor="Gray"
  124. BackgroundColor="{Binding IsMine, Converter={StaticResource EditorBackgroundConverter}}"
  125. Padding="0"
  126. HasShadow="False"
  127. Margin="0,5,0,0"
  128. VerticalOptions="FillAndExpand"
  129. HeightRequest="3000">
  130. <mobile:MobileEditor
  131. x:Name="Request"
  132. Text="{Binding Item.Request, Mode=TwoWay}"
  133. TextChanged="Notes_OnTextChanged"
  134. BackgroundColor="Transparent"
  135. TextColor="{Binding IsMine, Converter={StaticResource EditorForegroundConverter}}"
  136. Margin="5,0"
  137. VerticalOptions="FillAndExpand"
  138. IsEnabled="{Binding IsMine}"
  139. Focused="Request_OnFocused"
  140. Unfocused="Request_OnUnfocused"/>
  141. </Frame>
  142. </views:DockLayout>
  143. </local:RequisitionEditView.Content>
  144. </local:RequisitionEditView>