Advertisement
EdGr87

Untitled

Sep 20th, 2022
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.28 KB | None | 0 0
  1.      <Grid>
  2.             <Frame
  3.                 Margin="5,15,5,5"
  4.                 BorderColor="LightGray"
  5.                 CornerRadius="5"
  6.                 HasShadow="False">
  7.                 <Grid>
  8.                     <Grid.RowDefinitions>
  9.                         <RowDefinition Height="Auto" />
  10.                     </Grid.RowDefinitions>
  11.                     <Grid IsVisible="{Binding IsExpanded, Source={x:Reference _carView}}">
  12.                         <Grid.RowDefinitions>
  13.                             <RowDefinition Height="Auto" />
  14.                             <RowDefinition Height="*" />
  15.                         </Grid.RowDefinitions>
  16.                         <Label
  17.                             HorizontalOptions="End"
  18.                             Text="{Binding Notes}"
  19.                             TextColor="Gray" />
  20.                         <Label Grid.Row="1" Text="{Binding Description}" />
  21.                     </Grid>
  22.                 </Grid>
  23.             </Frame>
  24.  
  25.             <StackLayout
  26.                 Margin="20,0,0,0"
  27.                 BackgroundColor="White"
  28.                 HorizontalOptions="Start"
  29.                 Orientation="Horizontal"
  30.                 VerticalOptions="Start">
  31.                 <local:CarCircleView
  32.                     Margin="7,0,0,0"
  33.                     xct:TouchEffect.Command="{Binding ToggleCollapseCommand, Source={x:Reference _carView}}"
  34.                     xct:TouchEffect.CommandParameter="{x:Reference _carView}"
  35.                     HeightRequest="30"
  36.                     HorizontalOptions="Start"
  37.                     VerticalOptions="Start"
  38.                     WidthRequest="30" />
  39.                 <Label
  40.                     Margin="0,0,7,0"
  41.                     FontAttributes="Bold"
  42.                     Text="{Binding Name}"
  43.                     VerticalTextAlignment="Center" />
  44.             </StackLayout>
  45.         </Grid>
  46.     </ContentView.Content>
  47.  
  48. ViewModel anim
  49.  
  50.   private void ToggleCollapse(ContentView cv)
  51.     {
  52.         //if (DeviceInfo.Platform == DevicePlatform.Android)
  53.         //{
  54.         //BUG iOS pre7+: doesn't collapse the section, only makes the label invisible
  55.         cv.LayoutTo(cv.Bounds, 600, Easing.SpringIn);
  56.  
  57.         IsExpanded = !IsExpanded;
  58.         OnPropertyChanged(nameof(IsExpanded));
  59.         //}
  60.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement