2020-05-11 19:22:41 +02:00
|
|
|
|
using Windows.UI.Xaml;
|
2017-09-11 18:25:00 +02:00
|
|
|
|
using Windows.UI.Xaml.Controls;
|
|
|
|
|
using Windows.UI.Xaml.Navigation;
|
2020-04-15 12:02:30 +02:00
|
|
|
|
using ModernKeePass.Models;
|
2017-09-12 18:20:32 +02:00
|
|
|
|
using ModernKeePass.ViewModels;
|
2017-09-11 18:25:00 +02:00
|
|
|
|
|
2017-09-12 18:20:32 +02:00
|
|
|
|
// The Group Detail Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234229
|
2017-09-11 18:25:00 +02:00
|
|
|
|
|
2017-12-08 19:38:33 +01:00
|
|
|
|
namespace ModernKeePass.Views
|
2017-09-11 18:25:00 +02:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2017-09-12 18:20:32 +02:00
|
|
|
|
/// A page that displays an overview of a single group, including a preview of the items
|
|
|
|
|
/// within the group.
|
2017-09-11 18:25:00 +02:00
|
|
|
|
/// </summary>
|
2017-10-12 17:45:37 +02:00
|
|
|
|
public sealed partial class GroupDetailPage
|
2017-09-11 18:25:00 +02:00
|
|
|
|
{
|
2020-04-01 12:48:36 +02:00
|
|
|
|
public GroupDetailVm Model => (GroupDetailVm)DataContext;
|
2017-10-12 18:37:49 +02:00
|
|
|
|
|
2020-04-27 11:14:29 +02:00
|
|
|
|
public GroupDetailPage()
|
2017-09-11 18:25:00 +02:00
|
|
|
|
{
|
2017-09-15 11:47:43 +02:00
|
|
|
|
InitializeComponent();
|
2017-09-11 18:25:00 +02:00
|
|
|
|
}
|
2017-09-12 18:20:32 +02:00
|
|
|
|
|
2017-09-11 18:25:00 +02:00
|
|
|
|
#region NavigationHelper registration
|
2020-04-23 19:00:38 +02:00
|
|
|
|
|
2020-04-25 22:03:47 +02:00
|
|
|
|
protected override async void OnNavigatedTo(NavigationEventArgs e)
|
2017-09-11 18:25:00 +02:00
|
|
|
|
{
|
2020-04-21 17:13:39 +02:00
|
|
|
|
var navigationItem = e.Parameter as NavigationItem;
|
|
|
|
|
if (navigationItem != null)
|
2020-04-25 22:03:47 +02:00
|
|
|
|
{
|
|
|
|
|
await Model.Initialize(navigationItem.Id);
|
|
|
|
|
Model.IsEditMode = navigationItem.IsNew;
|
|
|
|
|
}
|
2017-09-11 18:25:00 +02:00
|
|
|
|
}
|
2020-04-21 19:12:26 +02:00
|
|
|
|
|
2017-09-11 18:25:00 +02:00
|
|
|
|
#endregion
|
2017-10-31 18:49:18 +01:00
|
|
|
|
|
2017-10-11 14:30:07 +02:00
|
|
|
|
#region Event Handlers
|
2018-06-21 18:40:44 +02:00
|
|
|
|
|
2017-10-09 18:40:02 +02:00
|
|
|
|
private void SemanticZoom_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
|
|
|
|
|
{
|
2017-10-13 15:46:41 +02:00
|
|
|
|
// We need to synchronize the two lists (zoomed-in and zoomed-out) because the source is different
|
2018-06-18 14:58:01 +02:00
|
|
|
|
if (!e.IsSourceZoomedInView)
|
2017-10-09 18:40:02 +02:00
|
|
|
|
{
|
|
|
|
|
e.DestinationItem.Item = e.SourceItem.Item;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-05-04 20:56:19 +02:00
|
|
|
|
|
|
|
|
|
private void GroupDetailPage_OnSizeChanged(object sender, SizeChangedEventArgs e)
|
2017-12-14 17:15:28 +01:00
|
|
|
|
{
|
2020-05-04 20:56:19 +02:00
|
|
|
|
if (e.NewSize.Width <= 640)
|
2017-12-14 17:15:28 +01:00
|
|
|
|
{
|
2020-05-04 20:56:19 +02:00
|
|
|
|
VisualStateManager.GoToState(this, "Small", true);
|
|
|
|
|
VisualStateManager.GoToState(TopMenu, "Collapsed", true);
|
|
|
|
|
VisualStateManager.GoToState(HamburgerMenu, "Hidden", true);
|
|
|
|
|
}
|
|
|
|
|
else if (e.NewSize.Width > 640 && e.NewSize.Width <= 1008)
|
|
|
|
|
{
|
|
|
|
|
VisualStateManager.GoToState(this, "Medium", true);
|
|
|
|
|
VisualStateManager.GoToState(TopMenu, "Overflowed", true);
|
|
|
|
|
VisualStateManager.GoToState(HamburgerMenu, "Collapsed", true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
VisualStateManager.GoToState(this, "Large", true);
|
|
|
|
|
VisualStateManager.GoToState(TopMenu, "Overflowed", true);
|
|
|
|
|
VisualStateManager.GoToState(HamburgerMenu, "Expanded", true);
|
2017-12-14 17:15:28 +01:00
|
|
|
|
}
|
2017-12-11 19:00:14 +01:00
|
|
|
|
}
|
2020-04-22 11:58:06 +02:00
|
|
|
|
|
2017-12-11 19:00:14 +01:00
|
|
|
|
#endregion
|
2017-09-11 18:25:00 +02:00
|
|
|
|
}
|
|
|
|
|
}
|