Exemplo n.º 1
0
        private void resizeItems()
        {
            //собираема
            List <PersonChat> allChats =
                GetVisualChilds <PersonChat>(mainCanvas as DependencyObject);
            int z = 1;

            foreach (PersonChat ch in allChats)
            {
                ch.personChatId = "person" + z;
                ch.profileChatNumber.Content = ch.personChatId;
                personWindows.Add(ch.Name, ch);
                z++;
            }

            int i      = 0;
            int j      = 0;
            int startX = -5;
            int startY = 0;

            int xSumm = 0;
            int ySumm = 0;
            int hh    = 0;

            foreach (KeyValuePair <string, PersonChat> kvp in personWindows)
            {
                PersonChat pc = kvp.Value;
                hh = pc.person_width + pc.person_width_margin;

                xSumm   = startX + i * (pc.person_width + pc.person_width_margin);
                ySumm   = startY + j * (pc.person_height + pc.person_height_margin);
                pc.left = xSumm;
                pc.top  = ySumm;
                pc.normalize();
                i++;

                if (i % 7 == 0)
                {
                    j++;
                    i = 0;
                }
                pc.wire(this);
            }
            //Canvas.SetLeft(console, xSumm + hh);
            //Canvas.SetTop(console, ySumm);
            //console.Width = hh - 5;
        }
Exemplo n.º 2
0
        private void nPreviewKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Escape)
            {
                foreach (KeyValuePair <string, PersonChat> kvp in personWindows)
                {
                    PersonChat pc = kvp.Value;
                    pc.isMin = true;
                    pc.normalize();
                }
            }

            if (e.Key == Key.Tab)
            {
                GNCHTA();
            }
        }