Interaction logic for BookmarkItem.xaml
Наследование: System.Windows.Controls.UserControl
Пример #1
0
        public void AddBookmark(string url, string title, TabView tv, MainWindow mw)
        {
            if (ItemsCount != 3)
            {
                bookmarkItem = new BookmarkPanelItem(url, title, tv, mw, this);
                Canvas canvas1 = new Canvas();
                mainCanvas.Children.Add(canvas1);
                Canvas.SetTop(canvas1, RowsCount * bookmarkTop);
                Canvas.SetLeft(bookmarkItem, ItemsCount * bookmarkLeft);
                bookmarkItem.Width = bookmarkWidth;

                bookmarkItem.Height = bookmarkHeight;
                canvas1.Children.Add(bookmarkItem);
                ItemsCount += 1;
                if (ItemsCount == 3)
                {
                    ItemsCount = 0;
                    RowsCount += 1;
                }
                if (RowsCount > 3)
                {
                    mainCanvas.Height = (RowsCount + 1) * bookmarkTop;
                }
            }
        }
        public void AddBookmark(string url, string title, TabView tv, MainWindow mw)
        {
            if (ItemsCount != 3)
                {

                    bookmarkItem = new BookmarkPanelItem(url, title, tv, mw, this);
                    Canvas canvas1 = new Canvas();
                    mainCanvas.Children.Add(canvas1);
                    Canvas.SetTop(canvas1, RowsCount * bookmarkTop);
                    Canvas.SetLeft(bookmarkItem, ItemsCount * bookmarkLeft);
                    bookmarkItem.Width = bookmarkWidth;

                    bookmarkItem.Height = bookmarkHeight;
                    canvas1.Children.Add(bookmarkItem);
                    ItemsCount += 1;
                    if (ItemsCount == 3) {
                        ItemsCount = 0;
                        RowsCount += 1;
                    }
                    if (RowsCount > 3)
                    {
                        mainCanvas.Height = (RowsCount + 1) * bookmarkTop;
                    }

            }
        }