[WPF] Refactor code in context backend
[WPF] Fix figure filling issue