public TaskbarButton(ApplicationViewModel applicationViewModel, TaskbarIconsSize iconsSize) { DataContext = applicationViewModel; InitializeComponent(); Id = applicationViewModel.Application.Id; SetIconSize(iconsSize); }
public void SetIconSize(TaskbarIconsSize newIconsSize) { int newSize = newIconsSize == TaskbarIconsSize.Large ? LargeIconSize : SmallIconSize; if (AppButton.Width != newSize) { AppButton.Width = newSize; Width = AppButton.Width + MarginSize; } if (AppButton.Height != newSize) { AppButton.Height = newSize; Height = AppButton.Height + MarginSize; } }
private void SetMainButtonIconSize(TaskbarIconsSize newIconsSize) { var newSize = (newIconsSize == TaskbarIconsSize.Small) ? MainIconSmallSize : MainIconLargeSize; if (MainButton.Height != newSize) { MainButton.Height = newSize; } if (MainButton.Width != newSize) { MainButton.Width = newSize; } }
private void SetIconSize(TaskbarIconsSize newIconsSize) { if (CurrentIconSize != newIconsSize) { CurrentIconSize = newIconsSize; foreach (var taskbarButton in ButtonContainer.Children.OfType <TaskbarButton>()) { taskbarButton.SetIconSize(newIconsSize); } SetMainButtonIconSize(newIconsSize); NotifyTaskbarOfChange(); } }
private void SetIconSize(TaskbarIconsSize newIconsSize) { if (CurrentIconSize != newIconsSize) { CurrentIconSize = newIconsSize; foreach (var taskbarButton in ButtonContainer.Children.OfType<TaskbarButton>()) { taskbarButton.SetIconSize(newIconsSize); } SetMainButtonIconSize(newIconsSize); NotifyTaskbarOfChange(); } }