Example #1
0
        private void FiveColumnLayout(int icol1, int icol2, int icol3, int icol4, int icol5)
        {
            //ServiceManager sm = new ServiceManager();
            //sm.UpdateMemLisArray(5);

            DBManager dm = new DBManager();


            var d_width  = 1024;
            var d_height = 768;

            int i_width  = Convert.ToInt32(d_width / 5);
            int i_height = Convert.ToInt32(d_height);

            arrUserControl = new ucPin[5];

            ColumnDefinition coldef1 = new ColumnDefinition();

            coldef1.Width = new GridLength(i_width);
            gridMain.ColumnDefinitions.Add(coldef1);
            ucPin uc1 = new ucPin();

            arrUserControl[0] = uc1;
            arrUserControl[0].lboxPin.Height = i_height - 40;
            arrUserControl[0].PinHeader.Text = "Stöðin";

            Grid.SetColumn(arrUserControl[0], 0);
            Grid.SetRow(arrUserControl[0], 0);
            gridMain.Children.Add(arrUserControl[0]);

            ColumnDefinition coldef2 = new ColumnDefinition();

            coldef2.Width = new GridLength(i_width);
            gridMain.ColumnDefinitions.Add(coldef2);
            ucPin uc2 = new ucPin();

            //UserControl1 uc2 = new UserControl1();
            arrUserControl[1] = uc2;
            arrUserControl[1].lboxPin.Height      = i_height - 40;
            arrUserControl[1].PinHeader.Text      = "Miðbæjarsvæði";
            arrUserControl[1].lboxPin.ItemsSource = dm.LoadPin2FromFile();
            Grid.SetColumn(arrUserControl[1], 1);
            Grid.SetRow(arrUserControl[1], 0);
            gridMain.Children.Add(arrUserControl[1]);

            ColumnDefinition coldef3 = new ColumnDefinition();

            coldef3.Width = new GridLength(i_width);
            gridMain.ColumnDefinitions.Add(coldef3);
            ucPin uc3 = new ucPin();

            //UserControl1 uc3 = new UserControl1();
            arrUserControl[2] = uc3;
            arrUserControl[2].lboxPin.Height = i_height - 40;
            arrUserControl[2].PinHeader.Text = "Breiðholt - Ikea";
            //arrUserControl[2].lboxPin.ItemsSource = sm.arrMemListDtoPin[2];
            Grid.SetColumn(arrUserControl[2], 2);
            Grid.SetRow(arrUserControl[2], 0);
            gridMain.Children.Add(arrUserControl[2]);

            ColumnDefinition coldef4 = new ColumnDefinition();

            coldef4.Width = new GridLength(i_width);
            gridMain.ColumnDefinitions.Add(coldef4);
            ucPin uc4 = new ucPin();

            //UserControl1 uc4 = new UserControl1();
            arrUserControl[3] = uc4;
            arrUserControl[3].lboxPin.Height = i_height - 40;
            arrUserControl[3].PinHeader.Text = "Árbær - Bauhaus.";
            //arrUserControl[3].lboxPin.ItemsSource = sm.arrMemListDtoPin[3];
            Grid.SetColumn(arrUserControl[3], 3);
            Grid.SetRow(arrUserControl[3], 0);
            gridMain.Children.Add(arrUserControl[3]);

            ColumnDefinition coldef5 = new ColumnDefinition();

            coldef4.Width = new GridLength(i_width);
            gridMain.ColumnDefinitions.Add(coldef5);
            ucPin uc5 = new ucPin();

            //UserControl1 uc5 = new UserControl1();
            arrUserControl[4] = uc5;
            arrUserControl[4].lboxPin.Height = i_height - 40;
            arrUserControl[4].PinHeader.Text = "Renna.";
            //arrUserControl[4].lboxPin.ItemsSource = sm.arrMemListDtoPin[4];
            Grid.SetColumn(arrUserControl[4], 4);
            Grid.SetRow(arrUserControl[4], 0);
            gridMain.Children.Add(arrUserControl[4]);
        }
Example #2
0
        private void FourColumnLayout(int icol1, int icol2, int icol3, int icol4)
        {
            //ServiceManager sm = new ServiceManager();
            // sm.UpdateMemLisArray(4);

            var d_width  = System.Windows.SystemParameters.PrimaryScreenWidth;
            var d_height = System.Windows.SystemParameters.PrimaryScreenHeight;

            int i_width  = Convert.ToInt32(d_width / 4);
            int i_height = Convert.ToInt32(d_height);

            arrUserControl = new ucPin[4];

            ColumnDefinition coldef1 = new ColumnDefinition();

            coldef1.Width = new GridLength(i_width);
            gridMain.ColumnDefinitions.Add(coldef1);
            ucPin uc1 = new ucPin();

            arrUserControl[0] = uc1;
            arrUserControl[0].lboxPin.Height = i_height - 40;
            arrUserControl[0].PinHeader.Text = "Stöðin";
            //arrUserControl[0].lboxPin.ItemsSource = sm.arrMemListDtoPin[0];
            Grid.SetColumn(arrUserControl[0], 0);
            Grid.SetRow(arrUserControl[0], 0);
            gridMain.Children.Add(arrUserControl[0]);

            ColumnDefinition coldef2 = new ColumnDefinition();

            coldef2.Width = new GridLength(i_width);
            gridMain.ColumnDefinitions.Add(coldef2);
            ucPin uc2 = new ucPin();

            arrUserControl[1] = uc2;
            arrUserControl[1].lboxPin.Height = i_height - 40;
            arrUserControl[1].PinHeader.Text = "Miðbæjarsvæði";
            //arrUserControl[1].lboxPin.ItemsSource = sm.arrMemListDtoPin[1];
            Grid.SetColumn(arrUserControl[1], 1);
            Grid.SetRow(arrUserControl[1], 0);
            gridMain.Children.Add(arrUserControl[1]);

            ColumnDefinition coldef3 = new ColumnDefinition();

            coldef3.Width = new GridLength(i_width);
            gridMain.ColumnDefinitions.Add(coldef3);
            ucPin uc3 = new ucPin();

            arrUserControl[2] = uc3;
            arrUserControl[2].lboxPin.Height = i_height - 40;
            arrUserControl[2].PinHeader.Text = "Breiðholt - Ikea";
            //arrUserControl[2].lboxPin.ItemsSource = sm.arrMemListDtoPin[2];
            Grid.SetColumn(arrUserControl[2], 2);
            Grid.SetRow(arrUserControl[2], 0);
            gridMain.Children.Add(arrUserControl[2]);

            ColumnDefinition coldef4 = new ColumnDefinition();

            coldef4.Width = new GridLength(i_width);
            gridMain.ColumnDefinitions.Add(coldef4);
            ucPin uc4 = new ucPin();

            arrUserControl[3] = uc4;
            arrUserControl[3].lboxPin.Height = i_height - 40;
            arrUserControl[3].PinHeader.Text = "Árbær - Bauhaus.";
            //arrUserControl[3].lboxPin.ItemsSource = sm.arrMemListDtoPin[3];
            Grid.SetColumn(arrUserControl[3], 3);
            Grid.SetRow(arrUserControl[3], 0);
            gridMain.Children.Add(arrUserControl[3]);
        }