public PowerItem()
        {
            string color = AppTheme.GetAnotherColor(AppTheme.Background);

            Background           = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor(color)));
            MouseLeftButtonDown += PowerItem_MouseLeftButtonDown;
            MouseEnter          += PowerItem_MouseEnter;
            MouseLeave          += PowerItem_MouseLeave;
        }
Beispiel #2
0
        private void Load()
        {
            List <TextBox> GroupsNames = Data.LoadGroupNames();

            foreach (TextBox GroupName in GroupsNames)
            {
                foreach (object child in Grid1.Children)
                {
                    if (child is TextBox)
                    {
                        if ((child as TextBox).Name == GroupName.Name)
                        {
                            (child as TextBox).Text = GroupName.Text;
                        }
                    }
                    //thats all folks
                }
            }
            ShortcutItems = Data.LoadShortcuts();
            foreach (ShortcutsSaveData item in ShortcutItems)
            {
                Tile parent = GetParent(item.ParentTile);
                item.item.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor(ScrollViewer1.Background.ToString())));
                parent.Add(item.item);
            }
            Data.SaveShortcuts(ShortcutItems);
        }
Beispiel #3
0
 public void SetScrollViewer(ScrollViewer viewer)
 {
     viewer.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor(AppTheme.Background)));
     viewer.AllowDrop  = true;
     viewer.Drop      += Tile_Drop;
     viewer.MouseDown += Ti_MouseDown;
 }
Beispiel #4
0
 private void Tile_Drop(object sender, DragEventArgs e)
 {
     string[] Files = (string[])e.Data.GetData(DataFormats.FileDrop, false);
     foreach (string File in Files)
     {
         ShortcutItem shortcutitem = new ShortcutItem(File)
         {
             Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor((sender as ScrollViewer).Background.ToString())))
         };
         if (!shortcutitem.IsThereisErrors)
         {
             Tile Tile = (sender as ScrollViewer).Content as Tile;
             Tile.Add(shortcutitem);
             ShortcutItems.Add(new ShortcutsSaveData(FindTileName(sender as ScrollViewer), shortcutitem));
         }
     }
     Data.SaveShortcuts(ShortcutItems);
 }
Beispiel #5
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]);
         }
     }
 }
Beispiel #6
0
 private void StackPanel_MouseEnter(object sender, MouseEventArgs e)
 {
     (sender as StackPanel).Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor(AppTheme.Background)));
 }
Beispiel #7
0
 private void SetTheme()
 {
     Grid1.Background     = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.Background));
     St.Background        = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor(Grid1.Background.ToString())));
     St_text.Foreground   = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.Foreground));
     power_txt.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.Foreground));
     St_text1.Foreground  = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.Foreground));
     foreach (object obj1 in St1.Children)
     {
         if (obj1 is StackPanel)
         {
             (obj1 as StackPanel).Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.Background));
         }
     }
 }
Beispiel #8
0
 private void SetTheme()
 {
     Grid1.Background            = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor(AppTheme.Background)));
     stp1.Background             = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor(Grid1.Background.ToString())));
     ThemeSettings_Tb.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor(Grid1.Background.ToString())));
     ThemeSettings_Tb.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor(AppTheme.Foreground)));
     Save_Button.Background      = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.Background));
     Save_Button.Foreground      = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.Foreground));
     //Irritate through the the parent Holder and set the proper theme to the children
     foreach (object obj1 in Grid2.Children)
     {
         if (obj1 is StackPanel)
         {
             foreach (object obj2 in (obj1 as StackPanel).Children)
             {
                 if (obj2 is TextBox)
                 {
                     (obj2 as TextBox).Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor(stp1.Background.ToString())));
                     (obj2 as TextBox).Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.Foreground));
                 }
                 else if (obj2 is Button)
                 {
                     (obj2 as Button).Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.Background));
                     (obj2 as Button).Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.Foreground));
                 }
             }
         }
         if (obj1 is TextBlock)
         {
             (obj1 as TextBlock).Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.Foreground));
         }
     }
 }
Beispiel #9
0
 private void SetTheme()
 {
     Grid1.Background            = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor(AppTheme.Background)));
     stp1.Background             = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor(Grid1.Background.ToString())));
     ThemeSettings_Tb.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor(Grid1.Background.ToString())));
     ThemeSettings_Tb.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor(AppTheme.Foreground)));
     Save_Button.Background      = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.Background));
     Save_Button.Foreground      = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.Foreground));
     foreach (object obj1 in Grid2.Children)
     {
         if (obj1 is StackPanel)
         {
             foreach (object obj2 in (obj1 as StackPanel).Children)
             {
                 if (obj2 is TextBox)
                 {
                     (obj2 as TextBox).Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor(stp1.Background.ToString())));
                     (obj2 as TextBox).Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.Foreground));
                 }
             }
         }
         if (obj1 is TextBlock)
         {
             (obj1 as TextBlock).Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.Foreground));
         }
     }
 }
        private void SetColor(PowerItem item)
        {
            string color = AppTheme.GetAnotherColor(AppTheme.Background);

            item.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor(color)));
        }