Skip to content

Commit

Permalink
Fix Task Frequency Save and Cancel buttons appearing behind Navigatio…
Browse files Browse the repository at this point in the history
…n Bar (#11)

Fix Task Frequency Save and Cancel buttons appearing behind Navigation Bar. Found a way to calculate the offset for the Nav Bar:
https://stackoverflow.com/a/34668606

Also fixed border styling around the buttons.
  • Loading branch information
webOSpinn authored and japf committed Feb 7, 2018
1 parent d0fe802 commit f3b4abe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 15 additions & 0 deletions src/2Day.App/Controls/AppFlyout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,21 @@ private void OnContentLoaded(object sender, object e)
{
dateTimePicker.VerticalAlignment = VerticalAlignment.Center;
}

//Prevent Frequency Picker Cancel/Accept buttons from appearing under Windows Mobile Nav Bar
var frequencyPicker2 = TreeHelper.FindVisualChild<FrequencyPicker2>(popupChild);
if (frequencyPicker2 != null)
{
var currentMargins = frequencyPicker2.Margin;
var navBarOffset = (bounds.Height - Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().VisibleBounds.Bottom);

if (currentMargins.Bottom < navBarOffset)
{
var newMargin = new Thickness(currentMargins.Left, currentMargins.Top, currentMargins.Right, currentMargins.Bottom + navBarOffset);
frequencyPicker2.Margin = newMargin;
}
}

}
}
else if (page.Width > 0)
Expand Down
4 changes: 2 additions & 2 deletions src/2Day.App/Controls/FrequencyPicker2.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@
<Border
Grid.Row="1"
Height="45"
Margin="-12,7,-12,-10"
Margin="-11,7,-11,-11"
VerticalAlignment="Bottom"
Background="{StaticResource NavMenuSecondaryBackgroundBrush}"
BorderThickness="0,1,0,0"
BorderThickness="1,1,1,1"
BorderBrush="{StaticResource NavMenuBorderBrush}">
<Grid>
<Grid.ColumnDefinitions>
Expand Down

0 comments on commit f3b4abe

Please sign in to comment.