Esempio n. 1
0
        private void MenuItem_Click_2(object sender, RoutedEventArgs e)
        {
            if (Minimum)
            {
                SlideFade.CreateAnimationToMaximum();
                Minimum = false;

                App.Instance.OpenChats.Clear();
                view.Refresh();
                SlideFade.CreateAnimationInMinimum(listbox1);
                App.Instance.OpenChats.AddRange(TmpOpenChats);
                view.Refresh();

                Topmost = false;

                btn_maximum1.Visibility = System.Windows.Visibility.Collapsed;
                btn_maximum2.Visibility = System.Windows.Visibility.Collapsed;
            }
        }
Esempio n. 2
0
        private void btn_minimize_Click(object sender, RoutedEventArgs e)
        {
            if (!Desktop)
            {
                TmpOpenChats = App.Instance.OpenChats.ToArray();
                App.Instance.OpenChats.Clear();
                view.Refresh();
                SlideFade.CreateAnimationInMinimum(listbox1);
                App.Instance.OpenChats.AddRange(App.Instance.Contacts.Values.ToArray());
                view.Refresh();

                Topmost = true;

                /*LastLeft = Left;
                 * Width = 70;
                 * Left = SystemParameters.PrimaryScreenWidth - 70;
                 * Minimum = true;*/
                SlideFade.CreateAnimationToMinimum();
                btn_maximum1.Visibility = System.Windows.Visibility.Visible;
                btn_maximum2.Visibility = System.Windows.Visibility.Visible;
            }
        }
Esempio n. 3
0
        private void listbox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (!App.Instance.LoginComplete)
            {
                if (listbox1.SelectedIndex != -1)
                {
                    listbox1.SelectedIndex = -1;
                }

                return;
            }

            if (listbox1.SelectedIndex != -1)
            {
                Contact contact = listbox1.SelectedItem as Contact;

                if (Minimum)
                {
                    /*Width = 850;
                     * Left = LastLeft;*/
                    SlideFade.CreateAnimationToMaximum();
                    Minimum = false;

                    App.Instance.OpenChats.Clear();
                    view.Refresh();
                    SlideFade.CreateAnimationInMinimum(listbox1);
                    App.Instance.OpenChats.AddRange(TmpOpenChats);
                    view.Refresh();

                    Topmost = false;
                }

                if (!App.Instance.OpenChats.Contains(contact))
                {
                    App.Instance.OpenChats.Add(contact);
                }

                if (page_Chat.ChattingWith != contact || CurrentPage != "chat")
                {
                    btn_home.BorderThickness     = new Thickness(0);
                    btn_contacts.BorderThickness = new Thickness(0);
                    btn_chat.BorderThickness     = new Thickness(0, 0, 0, 2);
                    btn_settings.BorderThickness = new Thickness(0);

                    SlideFade.StartAnimationIn(page_Chat);

                    page_Home.Visibility     = System.Windows.Visibility.Hidden;
                    page_Contacts.Visibility = System.Windows.Visibility.Hidden;
                    page_Chat.Visibility     = System.Windows.Visibility.Visible;
                    page_Settings.Visibility = System.Windows.Visibility.Hidden;
                }


                page_Chat.StartChattingWith(contact);
                contact.MarkAllMessagesRead();
                Console.WriteLine("ChatWith(\"{0}\");", contact.NickName);
                listbox1.SelectedIndex = -1;

                CurrentPage = "chat";
            }
        }