chore: Try Catch
This commit is contained in:
@@ -30,6 +30,7 @@ Public Class MyImage
|
||||
Set(value As String)
|
||||
If String.IsNullOrEmpty(value) Then Exit Property
|
||||
_SourceData = value
|
||||
Try
|
||||
If Not value.StartsWithF("http") Then ' 本地资源直接使用
|
||||
MyBase.Source = New MyBitmap(_SourceData)
|
||||
Exit Property
|
||||
@@ -56,6 +57,9 @@ Public Class MyImage
|
||||
MyBase.Source = New MyBitmap(TempFilePath)
|
||||
End If
|
||||
End Sub, TaskScheduler.FromCurrentSynchronizationContext())
|
||||
Catch ex As Exception
|
||||
Log(ex, "加载图片失败")
|
||||
End Try
|
||||
End Set
|
||||
End Property
|
||||
Public Shared Shadows ReadOnly SourceProperty As DependencyProperty = DependencyProperty.Register("Source", GetType(String), GetType(MyImage), New PropertyMetadata(New PropertyChangedCallback(
|
||||
|
||||
Reference in New Issue
Block a user