A
A
Abc Edc2016-05-13 12:10:22
Angular
Abc Edc, 2016-05-13 12:10:22

How to make a component with subsequent reuse in XAML?

I want to make, for example, my own picker, but so that I can reuse a la directives, now the components are like in angular.
But only reached the announcement

namespace Chainhub.Forms.UI.Controls
{
    public partial class BoxPickerControl : ContentView
    {
        public BoxPickerControl()
        {
           InitializeComponent();
        }
    }
}

<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Chainhub.Forms.UI.Controls.BoxPickerControl">
  <StackLayout>
    <StackLayout>
    <StackLayout  BackgroundColor="#383940" Padding="5,5,5,5"  Orientation="Horizontal">
      <StackLayout  HorizontalOptions="StartAndExpand">
        <Label Text="Categories"   TextColor="White"></Label>
      </StackLayout>

   ...
</ContentView>

etc
xmlns:controls="clr-namespace:Chainhub.Forms.UI.Controls;assebmly=Chainhub.Forms"

logged in
and called just to check that everything is ok
<controls:BoxPickerControl>
        
      </controls:BoxPickerControl>

and successfully caught
target invocation exception

What have I done wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AxisPod, 2016-05-17
@AxisPod

It is not necessary as in angular, but it is necessary to read books on WPF. Most likely, you won't need to make any new controls for your purposes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question