(1)XAML
DataContext="{Binding BookFlight, Source={StaticResource Locator}}"
(2) XAML
SupportedOrientations="Portrait"
Orientation="Portrait"
shell:SystemTray.IsVisible="False"
(3)XAML
<i:Interaction.Triggers>
<i:EventTrigger EventName="BackKeyPress">
<cmd:EventToCommand Command="{Binding BackKeyPressCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
一是触发器的详细介绍;而是BackKeyPressCommand的使用。
BackKeyPressCommand = new RelayCommand(() =>
{
_isLoad = true;
});
(4)查看StaticSource的定义处
(5)
<CustomAppBar:BindableApplicationBar x:Name="AppBar" Mode="Default" BarOpacity="1" IsMenuEnabled="True" >
<CustomAppBar:BindableApplicationBarIconButton Command="{Binding FlightSearchCollectCommand}" IsEnabled="True" IconUri="Images/appbar/appbar_history.png" Text="查询历史" />
<CustomAppBar:BindableApplicationBarIconButton Command="{Binding AirTicketSearchCommand}" IsEnabled="True" IconUri="Images/appbar/appbar_search.png" Text="搜索" />
<!--<CustomAppBar:BindableApplicationBarIconButton Command="{Binding AirFlightCollectCommand}" IsEnabled="True" IconUri="Images/appbar/appbar_collect.png" Text="航班收藏" />-->
<CustomAppBar:BindableApplicationBar.MenuItems>
<CustomAppBar:BindableApplicationBarMenuItem Text="航班收藏" Command="{Binding AirFlightCollectCommand}"/>
</CustomAppBar:BindableApplicationBar.MenuItems>
</CustomAppBar:BindableApplicationBar>
CustomAppBar:BindableApplicationBar
(6)BookFlightVM.cs
public BookFlightVM()
{
NavigationHelper.NavigatedMsgReg(this);
CreateCommands();
}
NavigationHelper.NavigatedMsgReg(this);
注册导航完成MSG
(7)BookFlightVM.cs
#region StartCity 出发城市
private Airport _startCity = App.Settings.PreferredDepartureAirport;
public Airport StartCity
{
get { return _startCity; }
set
{
if (_startCity != value)
{
_startCity = value;
RaisePropertyChanged("StartCity");
}
}
}
#endregion
App.Settings.PreferredDepartureAirport;
(8)XAML
<Controls:FlightCitySelectionControl FlightCity="{Binding StartCity,Mode=TwoWay}" Grid.Row="1"/>
城市选择
时间: 2024-12-20 08:33:48