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

XAML Constructor Parameter with Binding

$
0
0

I have a custom renderer to display a video player, which takes in one parameter: the URL of the video. It works fine, even in XAML:

  <ui:VideoContentView x:Name="Video">
    <x:Arguments>
      <x:String>
        https://09-lvl3-pdl.vimeocdn.com/01/3604/4/118020995/330937778.mp4?expires=1443633975&amp;token=0002ee6b1e005dc2064f8
      </x:String>
    </x:Arguments>
  </ui:VideoContentView>

But I would like to bind the URL, rather than hard-coding it. The problem is that when I try to bind the argument:

  <ui:VideoContentView x:Name="Video">
    <x:Arguments>
      <x:String>
        {Binding ContentUrl}
      </x:String>
    </x:Arguments>
  </ui:VideoContentView>

...the page does not load. I do not get an error, either.

Is this a bug, or is there something special I should be doing to bind to a constructor parameter?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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