Skip to content

Commit

Permalink
fix #122
Browse files Browse the repository at this point in the history
  • Loading branch information
Yatao Li committed Feb 24, 2020
1 parent 3a76c2d commit 751fa12
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ViewModels/MainWindowViewModel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ type MainWindowViewModel(cfg: config.ConfigObject.Workspace option, ?_maingrid:
trace "ToggleFullScreen %A" this.Fullscreen

let updateBackgroundImage() =
if not <| Object.ReferenceEquals(m_bgimg_src, null) then
m_bgimg_src.Dispose()
m_bgimg_src <- null
try
let new_img = new Bitmap(States.background_image_file)
ignore <| this.RaiseAndSetIfChanged(&m_bgimg_src, new_img, "BackgroundImage")
Expand All @@ -58,7 +55,8 @@ type MainWindowViewModel(cfg: config.ConfigObject.Workspace option, ?_maingrid:
ignore <| this.RaiseAndSetIfChanged(&m_bgimg_halign, States.background_image_halign, "BackgroundImageHAlign")
ignore <| this.RaiseAndSetIfChanged(&m_bgimg_valign, States.background_image_valign, "BackgroundImageVAlign")
ignore <| this.RaiseAndSetIfChanged(&m_bgimg_stretch, States.background_image_stretch, "BackgroundImageStretch")
with _ -> ()
with _ ->
ignore <| this.RaiseAndSetIfChanged(&m_bgimg_src, null, "BackgroundImage")

do
match cfg with
Expand Down

0 comments on commit 751fa12

Please sign in to comment.