Ejemplo n.º 1
0
        private async void BT_Link_Click(object sender, RoutedEventArgs e)
        {
            if (linkData == null)
            {
                string url = TB_Link.Text;
                BT_Link.Kind      = MaterialDesignThemes.Wpf.PackIconKind.ProgressUpload;
                BT_Link.IsEnabled = false;
                linkData          = await KakaoRequestClass.GetScrapData(url);

                if (linkData != null)
                {
                    BT_Link.Kind      = MaterialDesignThemes.Wpf.PackIconKind.Delete;
                    BT_Pic.IsEnabled  = false;
                    BT_Pic.Foreground = Brushes.LightGray;
                }
                else
                {
                    MessageBox.Show("오류가 발생했습니다.\n다시 시도해보세요.");
                    BT_Link.Kind = MaterialDesignThemes.Wpf.PackIconKind.Add;
                }
                BT_Link.IsEnabled = true;
            }
            else
            {
                linkData          = null;
                BT_Link.Kind      = MaterialDesignThemes.Wpf.PackIconKind.Add;
                BT_Pic.IsEnabled  = true;
                BT_Pic.Foreground = Brushes.Gray;
            }
        }