Exemple #1
0
        private void NavigatedTo(NavigationEventArgs arg)
        {
            if (Program.PreviewerDetached)
            {
                switch (arg.NavigationMode)
                {
                case NavigationMode.New:
                    var args = ((NavigationDialogHost parent, UserProfile profile, bool isNewUser))arg.Parameter;
                    _isNewUser = args.isNewUser;
                    if (!_isNewUser)
                    {
                        _profile    = args.profile;
                        TempProfile = new TempProfile(_profile);
                    }
                    else
                    {
                        TempProfile = new TempProfile();
                    }

                    _parent = args.parent;
                    break;
                }

                DataContext = TempProfile;

                AddPictureButton.IsVisible    = _isNewUser;
                IdLabel.IsVisible             = !_isNewUser;
                ChangePictureButton.IsVisible = !_isNewUser;
            }
        }
        private void NavigatedTo(NavigationEventArgs arg)
        {
            if (Program.PreviewerDetached)
            {
                if (arg.NavigationMode == NavigationMode.New)
                {
                    _parent   = (NavigationDialogHost)arg.Parameter;
                    ViewModel = _parent.ViewModel;
                }

                DataContext = ViewModel;
            }
        }
        public static async Task Show(AccountManager ownerAccountManager, ContentManager ownerContentManager, VirtualFileSystem ownerVirtualFileSystem)
        {
            var           content       = new NavigationDialogHost(ownerAccountManager, ownerContentManager, ownerVirtualFileSystem);
            ContentDialog contentDialog = new ContentDialog
            {
                Title               = LocaleManager.Instance["UserProfileWindowTitle"],
                PrimaryButtonText   = "",
                SecondaryButtonText = "",
                CloseButtonText     = LocaleManager.Instance["UserProfilesClose"],
                Content             = content,
                Padding             = new Thickness(0)
            };

            contentDialog.Closed += (sender, args) =>
            {
                content.ViewModel.Dispose();
            };

            await contentDialog.ShowAsync();
        }