private void OKButton_Click(object sender, RoutedEventArgs e) { if (0 == FolderNameBox.Text.Length) { MessageFlyoutText.Text = "文件夹名字不能为空"; MessageFlyout.ShowAt(FolderNameBox); return; } if (!NameStringCheck(FolderNameBox.Text)) { MessageFlyoutText.Text = "文件夹名称无效"; MessageFlyout.ShowAt(FolderNameBox); return; } if (!NameCheck(FolderNameBox.Text)) { MessageFlyoutText.Text = "文件夹已存在"; MessageFlyout.ShowAt(FolderNameBox); return; } NamePackage.Name = FolderNameBox.Text; NamePackage.OKState = true; Hide(); }
private void NotesDataModel_ContactsSynced(object sender, PropertyChangedEventArgs e) { if (_firstSync && NotesDataModel.Notes.Count == 0) { _firstSync = false; NotesDataModel.SyncDownNotes(); } else { MessageFlyout.Hide(); } }
void ContactsDataModel_ContactsSynced(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (_firstSync && ContactsDataModel.Contacts.Count == 0) { _firstSync = false; ContactsDataModel.SyncDownContacts(); } else { MessageFlyout.Hide(); } }
private async void SaveOffline_OnClick(object sender, RoutedEventArgs e) { try { DisplayProgressFlyout("Loading Remote Data, please wait!"); await SendRequest("SELECT Name, Id, OwnerId FROM Account", "Account"); await SendRequest("SELECT Name, Id, AccountId, OwnerId, Amount FROM Opportunity", "Opportunity"); } catch { } finally { MessageFlyout.Hide(); } }
private void LoadData() { DisplayProgressFlyout("Loading Local Data, please wait!"); var accounts = _store.GetAccounts(); var opps = _store.GetOpportunities(); AccountTable.Visibility = Visibility.Visible; foreach (var account in accounts) { Accounts.Add(JsonConvert.DeserializeObject <Account>(account[0].ToString())); } foreach (var opp in opps) { Opportunities.Add(JsonConvert.DeserializeObject <Opportunity>(opp[0].ToString())); } MessageFlyout.Hide(); }
private void ClearOffline_OnClick(object sender, RoutedEventArgs e) { try { DisplayProgressFlyout("Deleting local data, please wait!"); AccountTable.Visibility = Visibility.Collapsed; _store.DeleteAccountsSoup(); _store.DeleteOpportunitiesSoup(); _store.CreateAccountsSoup(); _store.CreateOpportunitiesSoup(); Accounts.Clear(); Opportunities.Clear(); } catch { } finally { MessageFlyout.Hide(); } }
private void CloseMessageButton_OnClick(object sender, RoutedEventArgs e) { MessageFlyout.Hide(); }
private void DisplayProgressFlyout(string text) { MessageContent.Text = text; Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => MessageFlyout.ShowAt(TitleBlock)); }
private void DisplayProgressFlyout(string text) { MessageContent.Text = text; MessageFlyout.ShowAt(RunReport); }
private void DisplayProgressFlyout(string text) { MessageContent.Text = text; MessageFlyout.ShowAt(ContactsTable); }