Ejemplo n.º 1
0
        private void Reload(int id)
        {
            var repo = new AuftragRepository();

            ViewModel   = AuftragDetailViewModel.FromExisting(repo.GetSingle(id));
            DataContext = ViewModel;
        }
Ejemplo n.º 2
0
        /// <summary>
        ///  Occurs, When this Page was called with a Fragment-Url ex. (?id=12)
        /// </summary>
        /// <param name="e"></param>
        public void OnFragmentNavigation(FragmentNavigationEventArgs e)
        {
            var fragment = Fragment.FromString(e.Fragment);

            if (fragment == null)
            {
                return;
            }

            if (fragment.ContainsKey(FragmentConstants.ID_KEY))
            {
                var id = int.Parse(fragment[FragmentConstants.ID_KEY]);
                if (id == 0)
                {
                    ViewModel   = new AuftragDetailViewModel();
                    DataContext = ViewModel;
                }
                else
                {
                    Reload(id);
                }
            }
        }