예제 #1
0
 public PassListPage()
 {
     this.InitializeComponent();
     Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                                                                                           async() =>
     {
         // Your UI update code goes here!
         WebPasses            = new ObservableCollection <WebPass>(await WebPassManager.GetWebPassesAsync());
         passList.ItemsSource = null;
         passList.ItemsSource = WebPasses;
     }
                                                                                           ).AsTask();
 }
예제 #2
0
        private async void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            var pass = new WebPass();

            pass.Id       = Guid.NewGuid();
            pass.Host     = boxWebHost.Text;
            pass.Uri      = boxWebHost.Text;
            pass.Username = boxUsername.Text;
            pass.Password = boxPassword.Password;

            //Task.Run(async () => await WebPassManager.Add(pass));
            await WebPassManager.Add(pass);

            MainPage.ContentFrame.Navigate(typeof(PassListPage));
        }
예제 #3
0
 private void MfDel_Click(object sender, RoutedEventArgs e)
 {
     if (passList.SelectedItems != null && passList.SelectedItems.Count > 0)
     {
         foreach (var item in passList.SelectedItems.OfType <WebPass>().ToList())
         {
             WebPasses.Remove(item);
             Task.Run(async() => await WebPassManager.Delete(item));
             passList.ItemsSource = null;
             passList.ItemsSource = WebPasses;
         }
     }
     else
     {
     }
 }
예제 #4
0
 private void PassList_CellEditEnded(object sender, DataGridCellEditEndedEventArgs e)
 {
     Task.Run(async() => await WebPassManager.SaveAsync(WebPasses.ToList()));
 }