|
namespace RegiRide.Views
{
using System.Windows;
using Microsoft.Phone.Controls;
public partial class RideDetailView : PhoneApplicationPage
{
public RideDetailView()
{
InitializeComponent();
var lightThemeVisibility = (Visibility)Resources["PhoneLightThemeVisibility"];
if (lightThemeVisibility == Visibility.Visible)
{
AddStartAddress.Style = (Style)Application.Current.Resources["ImageButtonStyleLight"];
AddEndAddress.Style = (Style)Application.Current.Resources["ImageButtonStyleLight"];
}
else
{
AddStartAddress.Style = (Style)Application.Current.Resources["ImageButtonStyleDark"];
AddEndAddress.Style = (Style)Application.Current.Resources["ImageButtonStyleDark"];
}
}
private void ApplicationBarIconButtonSave_Click(object sender, System.EventArgs e)
{
var vm = DataContext as RideDetailViewModel;
if (vm != null)
{
vm.SaveRideCommand.Execute(null);
}
}
private void ApplicationBarIconButtonCancel_Click(object sender, System.EventArgs e)
{
var vm = DataContext as RideDetailViewModel;
if (vm != null)
{
vm.CancelCommand.Execute(null);
}
}
private void ApplicationBarIconButtonDelete_Click(object sender, System.EventArgs e)
{
var vm = DataContext as RideDetailViewModel;
if (vm != null)
{
vm.DeleteCommand.Execute(null);
}
}
private void PhoneApplicationPage_BackKeyPress(object sender, System.ComponentModel.CancelEventArgs e)
{
var vm = DataContext as RideDetailViewModel;
if (vm != null)
{
vm.GoBackCommand.Execute(null);
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Patrick Kalkman is a senior Software Architect with more than 20 years professional development experience. He works for
SimpleTechture where he helps teams develop state of the art web applications.
Patrick enjoys writing his
blog. It discusses agile software development. Patrick can be reached at patrick@simpletechture.nl.
Published Windows 8 apps:
Published Windows Phone apps:
Awards:
Best Mobile article of March 2012
Best Mobile article of June 2012