private void ButtonSelectIcon_Click(object sender, RoutedEventArgs e)
        {
            var path = Dialogs.SelectIconFile(this);

            if (!string.IsNullOrEmpty(path))
            {
                if (path.EndsWith("exe", StringComparison.CurrentCultureIgnoreCase))
                {
                    path = SaveFileIconToTemp(path);

                    if (string.IsNullOrEmpty(path))
                    {
                        return;
                    }
                }

                ImageIcon.Source = BitmapExtensions.BitmapFromFile(path);
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(ImageIcon.Tag.ToString()));
            }
        }
Esempio n. 2
0
 public string SelectIconFile()
 {
     return(Invoke(() => Dialogs.SelectIconFile(PlayniteWindows.CurrentWindow)));
 }