Skip to content

How to use transition with image opacity? #447

Closed Answered by IanWitham
fsharpn00b asked this question in Q&A
Discussion options

You must be logged in to vote

That's a bit odd because I tested my solution with your code and it worked. It's also the solution I'm using for a project I'm working on. Perhaps you missed a step?

I also came up with another solution which does not require Styles.xaml. Simply initialize the transitions within the init function, which ensures they are only created once when the Image is created:

Image.create [
      Image.init (fun image ->
          image.Transitions <- Transitions()
          image.Transitions.Add (DoubleTransition(Duration = (TimeSpan.FromSeconds 2.0), Property=Image.OpacityProperty))
          )
      Image.height 1920
      Image.width 1080
      Image.opacity state.Current.image_1_opacity
      Im…

Replies: 5 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@IanWitham
Comment options

Answer selected by fsharpn00b
@fsharpn00b
Comment options

@fsharpn00b
Comment options

@JaggerJo
Comment options

@fsharpn00b
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants