예제 #1
0
        public DesktopButton(IoItem desktopItem)
        {
            this.desktopItem = desktopItem;

            InitializeComponent();

            Background = new ImageBrush(desktopItem.GetLargeIcon()){Stretch = Stretch.None};
            DisplayName = desktopItem.Name;

            settings = SharedSettings.GetInstance();
            ColorComponents();
            settings.ColorsUpdated+=SettingsColorsUpdated;
        }
예제 #2
0
        private void CreateButton(IoItem location)
        {
            var settings = SharedSettings.GetInstance();

            var content = new WrapPanel();
            content.Children.Add(new Image { Source = location.GetSmallIcon(), Height = 16, Width = 16, Margin = new Thickness(2) });
            content.Children.Add(new TextBlock { Text = location.Name, Margin = new Thickness(2) });
            var btnLocation = new Button
                                  {
                                      Content = content,
                                      Tag = location,
                                      HorizontalContentAlignment = HorizontalAlignment.Left,
                                      Foreground = settings.UiForeBrush,
                                      Background = settings.UiGradientBrushV,
                                      Margin = new Thickness(5)
                                  };
            btnLocation.Click += btnLocation_Click;

            pnlButtons.Children.Add(btnLocation);
        }
예제 #3
0
        private void CreateButton(IoItem item)
        {
            var settings = SharedSettings.GetInstance();

            var content = new WrapPanel();
            content.Children.Add(new Image { Source = item.GetSmallIcon(), Height = 16, Width = 16, Margin = new Thickness(2) });
            content.Children.Add(new TextBlock { Text = item.Name, Margin = new Thickness(2), TextTrimming = TextTrimming.CharacterEllipsis, Width = 70});
            var btnProgram = new Button
            {
                Content = content,
                Tag = item,
                HorizontalContentAlignment = HorizontalAlignment.Left,
                Foreground = settings.UiForeBrush,
                Background = settings.UiGradientBrushV,
                Margin = new Thickness(5),
                Width = 100,
                ToolTip = item.Name
            };
            btnProgram.Click+=BtnProgramClick;
            pnlPrograms.Children.Add(btnProgram);
        }