Friday, May 6, 2016

Xamarin UWP custom CommandBar

1 comment

I'd like to create a custom CommandBar for the UWP part of my Xamarin project.

I want to make a logo on a background color. The only way to get this, is making a visualbrush or grid, to contain both the background color and the picture.

I've read it can be done like so;

<Window.Resources>     <VisualBrush x:Key="myBrush">         <VisualBrush.Visual>             <Grid>                 <Rectangle Fill="Red" />                 <Image Source="troll.png" />             </Grid>         </VisualBrush.Visual>     </VisualBrush> </Window.Resources> 

I need to add this commandbar during runtime like so:

var _globalAppBar = new CommandBar(); _globalAppBar.Background = [Link  to above layout] 

Questions:

  1. How or where can I add this in my Xamarin UWP project? Add a XAML file?

  2. How can I link during run time to the layout? Or is there a better way to do this?

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

1 comment:



  1. All your hard about curating this informative post on Xamarin UWP custom CommandBar is helpful to Xamarin Developers is much appreciated.

    ReplyDelete