MIkeKaye

NewPage1.xaml

Jan 20th, 2025
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.16 KB | Source Code | 0 0
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <ContentPage
  3. xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  5. x:Class="MM2.Views.NewPage1"
  6. x:Name="this"
  7. Title="NewPage1">
  8.  
  9.  
  10. <!--
  11. xmlns:local="clr-namespace:CollectionViewSelection"
  12. <ContentPage.BindingContext>
  13. <local:MyViewModel />
  14. </ContentPage.BindingContext>
  15.  
  16. BindingContext="{x:Static local:MyViewModel}"
  17. xmlns:local="clr-namespace:MyViewModel"
  18. <local:MyViewModel />
  19. <ContentPage.BindingContext>
  20. </ContentPage.BindingContext>
  21. -->
  22.  
  23. <ContentPage.Resources>
  24. <ResourceDictionary>
  25. </ResourceDictionary>
  26. <Color x:Key="ColorUnSel">Gray</Color>
  27. <Color x:Key="ColorSel">Pink</Color>
  28. <!-- the above are used as fake selection in MiniView -->
  29. <Style TargetType="Border">
  30. <Setter Property="VisualStateManager.VisualStateGroups">
  31. <VisualStateGroupList>
  32. <VisualStateGroup x:Name="CommonStates">
  33. <VisualState x:Name="Normal">
  34. <VisualState.Setters>
  35. <Setter Property="BackgroundColor" Value="LightGray" />
  36. </VisualState.Setters>
  37. </VisualState>
  38. <VisualState x:Name="Selected">
  39. <VisualState.Setters>
  40. <Setter Property="BackgroundColor" Value="Cornsilk" />
  41. </VisualState.Setters>
  42. </VisualState>
  43. </VisualStateGroup>
  44. </VisualStateGroupList>
  45. </Setter>
  46. </Style>
  47. </ContentPage.Resources>
  48.  
  49. <!--
  50. <ContentPage.BindingContext>
  51. <local:MyViewModel />
  52. </ContentPage.BindingContext>
  53. -->
  54.  
  55. <ScrollView BindingContext="{Binding BindingContext,
  56. Source={x:Reference this}}">
  57. <VerticalStackLayout>
  58. <CollectionView x:Name="MiniView"
  59. SelectionMode="Single"
  60. PropertyChanged="itemsTapped"
  61. SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
  62. ItemsSource="{Binding itemsOC}">
  63. <!--
  64. <CollectionView.GestureRecognizers>
  65. <TapGestureRecognizer
  66. Tapped="DummyForNow"
  67. NumberOfTapsRequired="1" />
  68. </CollectionView.GestureRecognizers>
  69. -->
  70. <CollectionView.ItemTemplate>
  71. <DataTemplate x:Name="WTF">
  72. <!-- x:DataType="item"> -->
  73. <Border
  74. Padding="0"
  75. Margin="0" >
  76. <!--
  77. BackgroundColor="{Binding BackgroundColor}">
  78. -->
  79. <Label>
  80. <Label.Text>
  81. <MultiBinding StringFormat="Name: {0} $$ {1:N}">
  82. <Binding Path="Acct" />
  83. <Binding Path="Amount" />
  84. </MultiBinding>
  85. </Label.Text>
  86. </Label>
  87.  
  88. </Border>
  89. </DataTemplate>
  90. </CollectionView.ItemTemplate>
  91. </CollectionView>
  92.  
  93. <HorizontalStackLayout>
  94. <Button x:Name="bUp"
  95. Text="Move Up"
  96. IsVisible="False"
  97. Clicked="clickUp"
  98. WidthRequest="120"
  99. HorizontalOptions="Start"/>
  100.  
  101. <Button x:Name="bTop"
  102. Text="Move to Top"
  103. IsVisible="False"
  104. Clicked="clickToTop"
  105. WidthRequest="120"/>
  106. </HorizontalStackLayout>
  107.  
  108. <HorizontalStackLayout>
  109. <Button x:Name="bDwn"
  110. Text="Move Down"
  111. IsVisible="False"
  112. Clicked="clickDown"
  113. WidthRequest="120" />
  114.  
  115. <Button x:Name="bDel"
  116. Text="Remove"
  117. IsVisible="False"
  118. Clicked="clickDelete"
  119. WidthRequest="120"
  120. HorizontalOptions="Start"/>
  121. </HorizontalStackLayout>
  122.  
  123. <Label Text="{Binding theDate}"
  124. FormattedText="dd-MMM-yy" />
  125. <Label Text="{Binding theDate}"/>
  126. <Label Text="A" />
  127. <Label Text="{Binding vm.anInt}"/>
  128. <Label Text="B" />
  129. <Label Text="{Binding anInt}"/>
  130. <Label Text="END"/>
  131. <Button x:Name="silli"
  132. IsEnabled="True"
  133. Command="{Binding SelectItemCommand}"
  134. CommandParameter="{Binding MiniIndex}">
  135. </Button>
  136. </VerticalStackLayout>
  137. </ScrollView>
  138. </ContentPage>
  139.  
Add Comment
Please, Sign In to add comment