Exemple #1
0
 private void resize(object sender, SizeChangedEventArgs e)
 {
     leftScroller.Width   = this.ActualWidth / 2;
     rightScroller.Width  = this.ActualWidth / 2;
     happyHourList.Margin = new Thickness(0, this.ActualHeight * 0.06, 0, 0);
     if (this.ActualHeight > 500)
     {
         for (int i = 0; i < specials.Length; i++)
         {
             SpecialItem it = specialsList.Children[i] as SpecialItem;
             it.Title.FontSize       = this.ActualHeight * 0.04;
             it.Title.Padding        = new Thickness(this.ActualHeight * 0.01);
             it.Description.FontSize = this.ActualHeight * 0.03;
             it.Description.Padding  = new Thickness(this.ActualHeight * 0.01);
         }
         for (int i = 0; i < happyHour.Length; i++)
         {
             SpecialItem it_2 = happyHourList.Children[i] as SpecialItem;
             it_2.Title.FontSize       = this.ActualHeight * 0.04;
             it_2.Title.Padding        = new Thickness(this.ActualHeight * 0.01);
             it_2.Description.FontSize = this.ActualHeight * 0.03;
             it_2.Description.Padding  = new Thickness(this.ActualHeight * 0.01);
         }
     }
 }
Exemple #2
0
 public Specials()
 {
     InitializeComponent();
     for (int i = 0; i < specials.Length; i++)
     {
         SpecialItem it = new SpecialItem();
         it.Title.Content    = specials[i][0];
         it.Description.Text = specials[i][1];
         specialsList.Children.Add(it);
     }
     for (int i = 0; i < happyHour.Length; i++)
     {
         SpecialItem it_2 = new SpecialItem();
         it_2.Title.Content    = happyHour[i][0];
         it_2.Description.Text = happyHour[i][1];
         happyHourList.Children.Add(it_2);
     }
 }