Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
Change to resolve an issue with the sync button on Windows Apps
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocav committed Aug 20, 2015
1 parent 8a5ef80 commit 5192a97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
9 changes: 1 addition & 8 deletions client/xamarin.forms/ZUMOAPPNAME/TodoList.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,10 @@
</Grid.ColumnDefinitions>
<Entry x:Name="newItemName"
Placeholder="Item name" />
<StackLayout Grid.Column="1" Orientation="Horizontal" HorizontalOptions="StartAndExpand">
<StackLayout x:Name="buttonsPanel" Grid.Column="1" Orientation="Horizontal" HorizontalOptions="StartAndExpand">
<Button Text="+"
MinimumHeightRequest="30"
Clicked="OnAdd" />
<Button Text="Sync items"
x:Name="syncButton"
IsVisible="False"
Grid.Row="1"
HeightRequest="30"
Clicked="OnSyncItems" >
</Button>
</StackLayout>
</Grid>
</StackLayout>
Expand Down
12 changes: 10 additions & 2 deletions client/xamarin.forms/ZUMOAPPNAME/TodoList.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@ public TodoList()
manager = new TodoItemManager();

// OnPlatform<T> doesn't currently support the "Windows" target platform, so we have this check here.
if (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone)
if (manager.IsOfflineEnabled &&
(Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone))
{
syncButton.IsVisible = manager.IsOfflineEnabled;
var syncButton = new Button
{
Text = "Sync items",
HeightRequest = 30
};
syncButton.Clicked += OnSyncItems;

buttonsPanel.Children.Add(syncButton);
}
}

Expand Down

0 comments on commit 5192a97

Please sign in to comment.