public static void DialogWindow(Dialog dialog) { if (!DialogWindowFocus(dialog)) { DialogWindow dialogWindow = new DialogWindow(dialog); dialogWindow.Show(); dialogWindow.Activate(); } }
public static bool DialogWindowFocus(Dialog dialog) { if (dialog.IsOpened) { if (dialog.Window.WindowState == WindowState.Minimized) dialog.Window.WindowState = WindowState.Normal; dialog.Window.Activate(); return true; } return false; }
public DialogWindow(Dialog dialog) { CurrentDialog = dialog; dialog.Window = this; InitializeComponent(); Loaded += OnLoaded; DataContext = CurrentDialog; Closed += DialogClosed; Activated += DialogWindow_Activated; GotFocus += DialogWindow_GotFocus; }
public static void UpDialog(Dialog d) { dialogs.Move(dialogs.IndexOf(d), 0); }
private async void LoadDatA() { Start.State = "Подключение..."; User user = await Api.Request.GetUser(); Account.CurrentUser = user; HelloUser.Text = "Привет, " + Account.CurrentUser.Name + "!"; //System.Threading.Thread.Sleep(3000); Start.State = "Загрузка..."; List<Message> messagesList = await Api.Request.GetDialogs(); messagesList.RemoveAll(x => x.user_id < 0); Memory.messages.AddRange(messagesList); int[] userIds = messagesList.Select(x => x.user_id).ToArray(); List<User> usersList = await Api.Request.GetUsers(userIds, "photo_50,online,last_seen,online_mobile,sex"); Memory.users.AddRange(usersList); foreach (Message message in messagesList) { var d = new Dialog(message.user_id); Memory.dialogs.Add(d); } List<User> friendsList = await Api.Request.GetFriends(null, "photo_50,online,last_seen,online_mobile,sex"); Memory.users.AddRange(friendsList); LongPoll.Start(); //System.Threading.Thread.Sleep(3000); this.DialogResult = true; this.Close(); }