Skip to content

Instantly share code, notes, and snippets.

@karno
Created December 22, 2014 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karno/bfe1ac235824e2b1a0c5 to your computer and use it in GitHub Desktop.
Save karno/bfe1ac235824e2b1a0c5 to your computer and use it in GitHub Desktop.
Skylight example XAML code
<Page x:Class="TestApp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:actions="using:Skylight.Messaging.Behaviors.Actions"
xmlns:behaviors="using:Skylight.Messaging.Behaviors"
xmlns:comb="using:Skylight.Common.Behaviors"
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="using:Microsoft.Xaml.Interactivity"
xmlns:local="using:TestApp"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModels="using:TestApp.ViewModels"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d">
<Page.DataContext>
<viewModels:MainPageViewModel />
</Page.DataContext>
<i:Interaction.Behaviors>
<comb:NavigationHelperBehavior StateProvider="{Binding}" />
<core:EventTriggerBehavior EventName="Loaded">
<core:CallMethodAction MethodName="Loaded" TargetObject="{Binding}" />
</core:EventTriggerBehavior>
<behaviors:MessageTriggerBehavior Messenger="{Binding Messenger}">
<actions:MessageDialogAction />
</behaviors:MessageTriggerBehavior>
<behaviors:MessageTriggerBehavior Messenger="{Binding Messenger}">
<actions:NavigationAction />
</behaviors:MessageTriggerBehavior>
</i:Interaction.Behaviors>
<Grid>
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="Hello!" />
</Grid>
<Page.BottomAppBar>
<CommandBar>
<AppBarButton Label="TEST" Visibility="{Binding IsButtonEnabled, Converter={StaticResource BooleanToVisibilityConverter}}">
<i:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Click">
<core:CallMethodAction MethodName="ButtonClicked" TargetObject="{Binding}" />
</core:EventTriggerBehavior>
</i:Interaction.Behaviors>
</AppBarButton>
<AppBarButton Label="AUTH" Visibility="{Binding IsButtonEnabled, Converter={StaticResource BooleanToVisibilityConverter}}">
<i:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Click">
<core:CallMethodAction MethodName="BeginAuth" TargetObject="{Binding}" />
</core:EventTriggerBehavior>
</i:Interaction.Behaviors>
</AppBarButton>
</CommandBar>
</Page.BottomAppBar>
</Page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment