Skip to content

Instantly share code, notes, and snippets.

@mrlacey
Last active December 14, 2015 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrlacey/5161035 to your computer and use it in GitHub Desktop.
Save mrlacey/5161035 to your computer and use it in GitHub Desktop.
On low spec WP8 devices we had an issue where the UI option to create a secondary tile wasn't always being enabled properly. After identifying the most likely cause as the `CanPin()` method I had to refactor it to make it debuggable and in doing so made the binding/timing issue go away (solved it).
internal bool CanPin()
{
return !this.IsPinned()
&& this.UnderlyingModel != null
&& !this.IsRunningInKidsCorner()
&& (this.UnderlyingModel.IsSpecial
|| string.IsNullOrWhiteSpace(this.UnderlyingModel.ArtUrl)
|| (!string.IsNullOrWhiteSpace(this.UnderlyingModel.ArtUrl)
&& this.imageCacher.IsCached(this.UnderlyingModel.ArtUrl)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment