Example #1
0
 private void divdeplans()
 {
     string[]        lines = File.ReadAllLines(loc);
     TileLayout.Tile ti    = new TileLayout.Tile()
     {
         Width         = St1.Width,
         ChildMinWidth = 400,
         Childheight   = 100,
         Height        = 300,
         Background    = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor(AppTheme.Background))),
         Margin        = new Thickness(5)
     };
     St1.Children.Add(ti);
     for (int i = 0; i < lines.Count() - 3; i++)
     {
         //Constractor
         PowerPlan bed = new PowerPlan(GetStrBetweenTags(lines[i + 3], "GUID: ", "  ("), GetStrBetweenTags(lines[i + 3], "(", ")"));
         //u should have used (i + 3) instead of (i)
         if (lines[i + 3].Contains("*"))
         {
             PowerItems.Add(new PowerItem(bed, true));
             ti.Add(PowerItems[PowerItems.Count - 1]);
         }
         else
         {
             PowerItems.Add(new PowerItem(bed));
             ti.Add(PowerItems[PowerItems.Count - 1]);
         }
     }
 }
Example #2
0
        public PowerItem(PowerPlan MyPlan, bool IsActive = false) : this()
        {
            this.Plan = MyPlan;
            Children.Add(CreateTextBlock());
            if (IsActive == true)
            {
                Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.ActiveItems));
            }

            this.IsActive = IsActive;
        }