Merged Theming with AsyncDialogs
This commit is contained in:
@@ -50,26 +50,27 @@ namespace PolyChat
|
||||
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
|
||||
{
|
||||
Dialog dialog = new Dialog(
|
||||
Dialog.TYPE_ERROR,
|
||||
heading,
|
||||
message,
|
||||
new DialogButton(
|
||||
"Retry",
|
||||
() =>
|
||||
{
|
||||
Controller.Connect(param);
|
||||
Partners.Add(new ChatPartner(
|
||||
"Connecting...",
|
||||
param
|
||||
));
|
||||
updateNoChatsPlaceholder();
|
||||
}
|
||||
),
|
||||
new DialogButton(
|
||||
"Ignore",
|
||||
() => { /* do nothing */ }
|
||||
)
|
||||
);
|
||||
Dialog.TYPE_ERROR,
|
||||
heading,
|
||||
message,
|
||||
new DialogButton(
|
||||
"Retry",
|
||||
() =>
|
||||
{
|
||||
Controller.Connect(param);
|
||||
Partners.Add(new ChatPartner(
|
||||
"Connecting...",
|
||||
param
|
||||
));
|
||||
updateNoChatsPlaceholder();
|
||||
}
|
||||
),
|
||||
new DialogButton(
|
||||
"Ignore",
|
||||
() => { /* do nothing */ }
|
||||
)
|
||||
);
|
||||
SafelyOpenDialog(dialog);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -102,7 +103,9 @@ namespace PolyChat
|
||||
{
|
||||
string ip = IP.GetIPFromCode(dialog.getValue());
|
||||
Controller.Connect(ip);
|
||||
Partners.Add(new ChatPartner(
|
||||
ChatPartner pa = Partners.FirstOrDefault(p => p.Code == ip);
|
||||
if (pa == null)
|
||||
Partners.Add(new ChatPartner(
|
||||
"Connecting...",
|
||||
ip
|
||||
));
|
||||
@@ -188,7 +191,7 @@ namespace PolyChat
|
||||
|
||||
private void OnDeleteChat(object sender = null, RoutedEventArgs e = null)
|
||||
{
|
||||
Controller.CloseChat(selectedPartner.Code);
|
||||
Controller.CloseChat(selectedPartner.Code,delete: true);
|
||||
Partners.Remove(selectedPartner);
|
||||
updateNoChatsPlaceholder();
|
||||
updateNoChatSelected();
|
||||
|
||||
Reference in New Issue
Block a user