Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Can you bind BoxView width?

$
0
0

I have a BoxView which is acting like a progressbar (solid color full width) and have a timer which polls every 250 ms to update the vm property but the width doesn't update when bound.

 BoxViewBar.SetBinding(WidthProperty, "PrecentageRemainingAsWidth");

If I don't data bind but have a timer to update the BoxViewBar by calling the below then it works but the width jumps back to 320 (initial width) after the end of the layoutTo animation

  var bound = BoxViewBar.Bounds;
  bound.Width = ViewModel.PrecentageRemainingAsWidth;
  BoxViewBar.LayoutTo(bound)

any ideas/solutions - has anything tried animating BoxViews like this?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>