Advertisement
MIkeKaye

NewPage1.xaml 29Jan

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