Created
June 18, 2019 06:25
-
-
Save hamid-shaikh/ada51d3605ab744aadd12f5991bbd822 to your computer and use it in GitHub Desktop.
AppAttachProperties usage example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ContentPage | |
xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:appHelpers="clr-namespace:ProjectName.Mobile.Helpers" | |
x:Class="ProjectName.Mobile.Views.TestPage"> | |
<!--ContentPage Content--> | |
<Grid | |
BackgroundColor="{StaticResource whiteColor}" | |
RowSpacing="0" | |
ColumnSpacing="0"> | |
<Grid.RowDefinitions> | |
<RowDefinition | |
Height="*" /> | |
<RowDefinition | |
Height="Auto" /> | |
</Grid.RowDefinitions> | |
<Image | |
VerticalOptions="EndAndExpand" | |
DownsampleToViewSize="true" | |
Aspect="AspectFit" | |
HeightRequest="270" | |
Grid.Row="1" | |
appHelpers:AppAttachProperties.TapCommand="{Binding SomeViewModelCommand}" | |
appHelpers:AppAttachProperties.TapCommandParameter="{Binding SomeProperty}" <!--You can also specify some static value--> | |
Source="someIcon.png" /> | |
<StackLayout | |
x:Name="parentStackLayout" | |
Margin="24, 0" | |
VerticalOptions="EndAndExpand" | |
Spacing="30"> | |
<Label | |
appHelpers:AppAttachProperties.TapCommand="{Binding SomeViewModelCommand}" | |
appHelpers:AppAttachProperties.TapCommandParameter="{Binding SomeProperty}" <!--You can also specify some static value--> | |
appHelpers:AppAttachProperties.AnimateView="{Binding Source={x:Reference parentStackLayout}}"<!--Here i have attached AnimateView and passed stacklayout object which should be animated when label is clicked--> | |
VerticalOptions="Center" | |
Text="Label Text" | |
Style="{StaticResource primaryLabelStyle}" /> | |
<Button | |
Text="Button Text" | |
appHelpers:AppAttachProperties.TapCommand="{Binding SomeViewModelCommand}" | |
appHelpers:AppAttachProperties.TapCommandParameter="{Binding SomeProperty}" <!--You can also specify some static value--> | |
appHelpers:AppAttachProperties.AnimateOnTap="False" | |
Style="{StaticResource primaryButtonStyle}" /> | |
</StackLayout> | |
</Grid> | |
</ContentPage> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/hamid-shaikh/fba678321385608ac3b0b5164f9ae935