Skip to content

Commit

Permalink
[EmployeeDirectory.Android] Fix switch issue, bug #26496
Browse files Browse the repository at this point in the history
  • Loading branch information
olegoid committed May 11, 2015
1 parent d302dde commit 5e053b2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions EmployeeDirectory/EmployeeDirectoryUI/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public App ()
task.Wait();

var employeeList = new ContentPage ();
if (uiImplementation == UIImplementation.CSharp) {

if (uiImplementation == UIImplementation.CSharp)
employeeList = new EmployeeListView ();
} else if (uiImplementation == UIImplementation.Xaml) {
else if (uiImplementation == UIImplementation.Xaml)
employeeList = new EmployeeListXaml ();
}

MainPage = new NavigationPage (employeeList);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public EmployeeView ()
favoriteLabel = new Label ();

favoriteSwitch = new Switch ();
favoriteSwitch.SetBinding (Switch.IsToggledProperty, "Person.IsFavorite");

personName = new Label {
XAlign = TextAlignment.Center,
Expand Down Expand Up @@ -70,6 +69,7 @@ protected override void OnBindingContextChanged ()
Title = personInfo.Person.Name;
personName.Text = personInfo.Person.Name;
favoriteLabel.Text = personInfo.IsFavorite ? "Added to favorites" : "Not in favorites";
favoriteSwitch.IsToggled = personInfo.IsFavorite;
DownloadImage ();
}

Expand Down

0 comments on commit 5e053b2

Please sign in to comment.