Пример #1
0
        public async Task Initialize()
        {
            try
            {
                var folders = await Windows.Storage.KnownFolders.HomeGroup.GetFoldersAsync();

                foreach (
                    var user in
                    folders.Select(
                        folder => new HomeGroupUser {
                    UserName = folder.DisplayName, IsHomeGroupUser = true
                }))
                {
                    this.Users.Add(user);
                }
            }
            catch (Exception ex)
            {
                var user = new HomeGroupUser
                {
                    UserName        = string.Format("Error: {0}", ex.Message),
                    IsHomeGroupUser = false
                };
                Users.Add(user);
            }
        }
Пример #2
0
        private void PopulateDesignData()
        {
            var user1 = new HomeGroupUser {
                UserName = "******", IsHomeGroupUser = true
            };
            var user2 = new HomeGroupUser {
                UserName = "******", IsHomeGroupUser = true
            };

            Users.Add(user1);
            Users.Add(user2);
            SelectedUser = user1;
            var image = new ImageItem
            {
                Name  = "Sample Image",
                Image = new BitmapImage(new Uri("ms-appx:///Assets/Logo.scale-100.png"))
            };

            Images.Add(image);
        }