Exemple #1
0
        private void AddLinkCommandHandler()
        {
            var link = new Link { Name = Name, Uri = new Uri(Url) };
            LinkService.Add(link);

            Frame.Navigate(typeof(AppHub), link);
        }
Exemple #2
0
        public void Activate(ShareTargetActivatedEventArgs args)
        {
            DefaultViewModel["Sharing"] = false;

            _ShareOperation = args.ShareOperation;
            DataPackagePropertySetView shareProperties = _ShareOperation.Data.Properties;
            DefaultViewModel["Link"] = new Link
                                           {
                                               Name = shareProperties.Title,
                                               Uri = new Uri(shareProperties.Description)
                                           };

            Window.Current.Content = this;
            Window.Current.Activate();
        }
Exemple #3
0
        private async void LoadLinks(Link newLink = null)
        {
            List<Link> links = await LinkService.GetAllLinks();
            if (links == null) return;
            
            foreach (Link link in links)
            {
                Links.Add(link);
            }

            if (newLink != null)
            {
                bool exists = Links.Any(l => l.LinkId == newLink.LinkId);
                if (!exists)
                {
                    Links.Add(newLink);
                }
            }
        }
 public void Add(Link link)
 {
     link.LinkId = Guid.NewGuid();
     _Links.Add(link);
 }