Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8" ?>
- <ContentPage
- xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- x:Class="MM2.Views.NewPage1"
- x:Name="this"
- Title="NewPage1">
- <!--
- xmlns:local="clr-namespace:CollectionViewSelection"
- <ContentPage.BindingContext>
- <local:MyViewModel />
- </ContentPage.BindingContext>
- BindingContext="{x:Static local:MyViewModel}"
- xmlns:local="clr-namespace:MyViewModel"
- <local:MyViewModel />
- <ContentPage.BindingContext>
- </ContentPage.BindingContext>
- -->
- <ContentPage.Resources>
- <ResourceDictionary>
- </ResourceDictionary>
- <Color x:Key="ColorUnSel">Gray</Color>
- <Color x:Key="ColorSel">Pink</Color>
- <!-- the above are used as fake selection in MiniView -->
- <Style TargetType="Border">
- <Setter Property="VisualStateManager.VisualStateGroups">
- <VisualStateGroupList>
- <VisualStateGroup x:Name="CommonStates">
- <VisualState x:Name="Normal">
- <VisualState.Setters>
- <Setter Property="BackgroundColor" Value="LightGray" />
- </VisualState.Setters>
- </VisualState>
- <VisualState x:Name="Selected">
- <VisualState.Setters>
- <Setter Property="BackgroundColor" Value="Cornsilk" />
- </VisualState.Setters>
- </VisualState>
- </VisualStateGroup>
- </VisualStateGroupList>
- </Setter>
- </Style>
- </ContentPage.Resources>
- <!--
- <ContentPage.BindingContext>
- <local:MyViewModel />
- </ContentPage.BindingContext>
- -->
- <ScrollView BindingContext="{Binding BindingContext,
- Source={x:Reference this}}">
- <VerticalStackLayout>
- <CollectionView x:Name="MiniView"
- SelectionMode="Single"
- PropertyChanged="itemsTapped"
- SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
- ItemsSource="{Binding itemsOC}">
- <!--
- <CollectionView.GestureRecognizers>
- <TapGestureRecognizer
- Tapped="DummyForNow"
- NumberOfTapsRequired="1" />
- </CollectionView.GestureRecognizers>
- -->
- <CollectionView.ItemTemplate>
- <DataTemplate x:Name="WTF">
- <!-- x:DataType="item"> -->
- <Border
- Padding="0"
- Margin="0" >
- <!--
- BackgroundColor="{Binding BackgroundColor}">
- -->
- <Label>
- <Label.Text>
- <MultiBinding StringFormat="Name: {0} $$ {1:N}">
- <Binding Path="Acct" />
- <Binding Path="Amount" />
- </MultiBinding>
- </Label.Text>
- </Label>
- </Border>
- </DataTemplate>
- </CollectionView.ItemTemplate>
- </CollectionView>
- <HorizontalStackLayout>
- <Button x:Name="bUp"
- Text="Move Up"
- IsVisible="False"
- Clicked="clickUp"
- WidthRequest="120"
- HorizontalOptions="Start"/>
- <Button x:Name="bTop"
- Text="Move to Top"
- IsVisible="False"
- Clicked="clickToTop"
- WidthRequest="120"/>
- </HorizontalStackLayout>
- <HorizontalStackLayout>
- <Button x:Name="bDwn"
- Text="Move Down"
- IsVisible="False"
- Clicked="clickDown"
- WidthRequest="120" />
- <Button x:Name="bDel"
- Text="Remove"
- IsVisible="False"
- Clicked="clickDelete"
- WidthRequest="120"
- HorizontalOptions="Start"/>
- </HorizontalStackLayout>
- <Label Text="{Binding theDate}"
- FormattedText="dd-MMM-yy" />
- <Label Text="{Binding theDate}"/>
- <Label Text="A" />
- <Label Text="{Binding vm.anInt}"/>
- <Label Text="B" />
- <Label Text="{Binding anInt}"/>
- <Label Text="END"/>
- <Button x:Name="silli"
- IsEnabled="True"
- Command="{Binding SelectItemCommand}"
- CommandParameter="{Binding MiniIndex}">
- </Button>
- </VerticalStackLayout>
- </ScrollView>
- </ContentPage>
Add Comment
Please, Sign In to add comment